Skip to content

Instantly share code, notes, and snippets.

View ngmachado's full-sized avatar
💭
in the æther

Axe ngmachado

💭
in the æther
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
/*
Exemple of upgrader supertoken based on roles.
NOTICE: IS ONE EXAMPLE NOT PROD READY
*/
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
/*
Factory that can deploy any number of TradeableCashflow using registerAppByFactory from SF protocol
*/
import "./TradeableCashflow.sol";
import {ISuperfluid, ISuperToken, SuperAppDefinitions} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol";
contract TCFFactory {
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
library SafeCast96 {
/**
* @dev Returns the downcasted int96 from uint256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract SuperfluidEDEN2022 is ERC721, ERC721URIStorage, AccessControl {
using Counters for Counters.Counter;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/IERC20Metadata.sol";
/*
Each operation you get the gas as token;
There is small change of ragnorok of your balance;
*/
@ngmachado
ngmachado / Drip.md
Created October 5, 2021 10:53
Drip.md

Drip Contract Friendly Review

Notice

This is a friendly code review and my personal comments.

  • Lock the contracts to a specific compiler version
  • Add license to all contracts
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import {
ISuperfluid,
ISuperToken
} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol";
import {
IConstantFlowAgreementV1
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/utils/Counters.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/access/AccessControl.sol";
contract SuperERC721 is ERC721, AccessControl {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
pragma solidity ^0.7.0;
contract superSpreader {
event sendEther(address indexed receiver, uint256 amount);
event deposit(address indexed sender, uint256 amount);
mapping(address => bool) private _transferDone;
constructor() payable {
pragma solidity >=0.6.0 <0.7.0;
interface IERC2429 {
function defineHardRecovery(bytes32 _rootTree) external;
}
/*
Example of a recovery account as DMS and Will.
This contract define a new root as a mandatory recovery. A mandatory recovrey dont have a wait time to be active. After the activation is set, only the peers can recovery the account. We can think as the analogic lawyers :) gthat can prove the incapacity of the user.