Skip to content

Instantly share code, notes, and snippets.

@thegostep
Created August 21, 2018 20:22
Show Gist options
  • Save thegostep/c096e42e267c8a20ad2d9f8d6737ef9e to your computer and use it in GitHub Desktop.
Save thegostep/c096e42e267c8a20ad2d9f8d6737ef9e to your computer and use it in GitHub Desktop.
Comparison of _tranche as first parameter vs after _from address
interface ERC777Token {
function name() public view returns (string);
function symbol() public view returns (string);
function totalSupply() public view returns (uint256);
function balanceOf(address owner) public view returns (uint256);
function granularity() public view returns (uint256);
function defaultOperators() public view returns (address[]);
function authorizeOperator(address operator) public;
function revokeOperator(address operator) public;
function isOperatorFor(address operator, address tokenHolder) public view returns (bool);
function send(address to, uint256 amount, bytes data) public;
function operatorSend(address from, address to, uint256 amount, bytes data, bytes operatorData) public;
function burn(uint256 amount, bytes data) public;
function operatorBurn(address from, uint256 amount, bytes data, bytes operatorData) public;
event Sent(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bytes data,
bytes operatorData
);
event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);
event Burned(address indexed operator, address indexed from, uint256 amount, bytes operatorData);
event AuthorizedOperator(address indexed operator, address indexed tokenHolder);
event RevokedOperator(address indexed operator, address indexed tokenHolder);
}
interface IERCPFT is ERC777Token {
function getDefaultTranche(address _owner) external view returns (bytes32);
function setDefaultTranche(bytes32 _tranche) external;
function operatorSetDefaultTranche(bytes32 _tranche, address _owner) external;
function balanceOfByTranche(bytes32 _tranche, address _owner) external view returns (uint256);
function sendByTranche(bytes32 _tranche, address _to, uint256 _amount, bytes _data) external returns (bytes32);
function sendByTranches(bytes32[] _tranches, address[] _tos, uint256[] _amounts, bytes _data) external returns (bytes32);
function operatorSendByTranche(bytes32 _tranche, address _from, address _to, uint256 _amount, bytes _data, bytes _operatorData) external returns (bytes32[]);
function operatorSendByTranches(bytes32[] _tranches, address[] _froms, address[] _tos, uint256[] _amounts, bytes _data, bytes _operatorData) external returns (bytes32[]);
function trancheByIndex(address _owner, uint256 _index) external view returns (bytes32);
function tranchesOf(address _owner) external view returns (uint256);
function defaultOperatorsByTranche(bytes32 _tranche) public view returns (address[]);
function authorizeOperatorByTranche(bytes32 _tranche, address _operator) public;
function revokeOperatorByTranche(bytes32 _tranche, address _operator) public;
function isOperatorForTranche(bytes32 _tranche, address _operator, address _owner) public view returns (bool);
event SentByTranche(
bytes32 indexed fromTranche,
bytes32 toTranche,
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bytes data,
bytes operatorData
);
event MintedByTranche(bytes32 indexed tranche, address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);
event BurnedByTranche(bytes32 indexed tranche, address indexed operator, address indexed from, uint256 amount, bytes operatorData);
event AuthorizedOperatorByTranche(bytes32 indexed tranche, address indexed operator, address indexed tokenHolder);
event RevokedOperatorByTranche(bytes32 indexed tranche, address indexed operator, address indexed tokenHolder);
}
interface IERCST is IERCPFT, IERC165 {
function getDocument(bytes32 _name) public view returns (string, bytes32);
function setDocument(bytes32 _name, string _uri, bytes32 _documentHash) public;
function finishMinting(bytes32 _declaration) public;
function mintable() public view returns (bool);
function verifySendTranche(address _from, address _to, bytes32 _tranche, uint256 _amount, bytes _data) public view returns (byte, bytes32, bytes32);
function mint(bytes32 _tranche, address _owner, uint256 _amount, bytes _data) public;
function burn(bytes32 _tranche, address _owner, uint256 _amount, bytes _data) public;
}
interface ERC777Token {
function name() public view returns (string);
function symbol() public view returns (string);
function totalSupply() public view returns (uint256);
function balanceOf(address owner) public view returns (uint256);
function granularity() public view returns (uint256);
function defaultOperators() public view returns (address[]);
function authorizeOperator(address operator) public;
function revokeOperator(address operator) public;
function isOperatorFor(address operator, address tokenHolder) public view returns (bool);
function send(address to, uint256 amount, bytes data) public;
function operatorSend(address from, address to, uint256 amount, bytes data, bytes operatorData) public;
function burn(uint256 amount, bytes data) public;
function operatorBurn(address from, uint256 amount, bytes data, bytes operatorData) public;
event Sent(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bytes data,
bytes operatorData
);
event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);
event Burned(address indexed operator, address indexed from, uint256 amount, bytes operatorData);
event AuthorizedOperator(address indexed operator, address indexed tokenHolder);
event RevokedOperator(address indexed operator, address indexed tokenHolder);
}
interface IERCPFT is ERC777Token {
function getDefaultTranche(address _owner) external view returns (bytes32);
function setDefaultTranche(bytes32 _tranche) external;
function operatorSetDefaultTranche(address _owner, bytes32 _tranche) external;
function balanceOfByTranche(address _owner, bytes32 _tranche) external view returns (uint256);
function sendByTranche(bytes32 _tranche, address _to, uint256 _amount, bytes _data) external returns (bytes32);
function sendByTranches(bytes32[] _tranches, address[] _tos, uint256[] _amounts, bytes _data) external returns (bytes32);
function operatorSendByTranche(address _from, bytes32 _tranche, address _to, uint256 _amount, bytes _data, bytes _operatorData) external returns (bytes32[]);
function operatorSendByTranches(address[] _froms, bytes32[] _tranches, address[] _tos, uint256[] _amounts, bytes _data, bytes _operatorData) external returns (bytes32[]);
function trancheByIndex(address _owner, uint256 _index) external view returns (bytes32);
function tranchesOf(address _owner) external view returns (uint256);
function defaultOperatorsByTranche(bytes32 _tranche) public view returns (address[]);
function authorizeOperatorByTranche(address _operator, bytes32 _tranche) public;
function revokeOperatorByTranche(address _operator, bytes32 _tranche) public;
function isOperatorForTranche(address _operator, address _owner, bytes32 _tranche) public view returns (bool);
event SentByTranche(
address indexed operator,
address indexed from,
bytes32 indexed fromTranche,
address indexed to,
bytes32 toTranche,
uint256 amount,
bytes data,
bytes operatorData
);
event MintedByTranche(address indexed operator, address indexed to, bytes32 indexed tranche, uint256 amount, bytes data, bytes operatorData);
event BurnedByTranche(address indexed operator, address indexed from, bytes32 indexed tranche, uint256 amount, bytes operatorData);
event AuthorizedOperatorByTranche(address indexed operator, address indexed tokenHolder, bytes32 indexed tranche);
event RevokedOperatorByTranche(address indexed operator, address indexed tokenHolder, bytes32 indexed tranche);
}
interface IERCST is IERCPFT, IERC165 {
function getDocument(bytes32 _name) public view returns (string, bytes32);
function setDocument(bytes32 _name, string _uri, bytes32 _documentHash) public;
function finishMinting(bytes32 _declaration) public;
function mintable() public view returns (bool);
function verifySendTranche(address _from, address _to, bytes32 _tranche, uint256 _amount, bytes _data) public view returns (byte, bytes32, bytes32);
function mint(address _owner, bytes32 _tranche, uint256 _amount, bytes _data) public;
function burn(address _owner, bytes32 _tranche, uint256 _amount, bytes _data) public;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment