Closed YoshihitoAso closed 3 years ago
balances(コントラクト入庫残高)
// account => token => amount mapping(address => mapping(address => uint256)) private balances;
commitments(エスクロー中数量:拘束数量)
// account => token => amount mapping(address => mapping(address => uint256)) private commitments;
latest escrow id(直近エスクローID)
uint256 public latestEscrowId
token fallback
/// @param _from アカウントアドレス:残高を保有するアドレス /// @param _value デポジット数量 function tokenFallback(address _from, uint _value, bytes memory /*_data*/) public
withdraw
/// @param _token トークンアドレス /// @return 処理結果 function withdraw(address _token)
create escrow
/// @param _token トークンアドレス /// @param _recipient トークン受領者 /// @param _amount 数量 /// @param _agent エスクローエージェント /// @param _data イベント出力用の任意のデータ function createEscrow( address _token, address _recipient, uint256 _amount, address _agent, string memory _data )
cancel escrow
/// @param _escrowId エスクローID function cancelEscrow(uint256 _escrowId)
finish escrow
/// @param _escrowId エスクローID function finishEscrow(uint256 _escrowId)
escrow created
event EscrowCreated( uint256 indexed escrowId, address indexed token, address sender, address recipient, uint256 amount, address agent, string data );
escrow canceled
event EscrowCanceled( uint256 indexed escrowId, address indexed token, address sender, address recipient, uint256 amount, address agent );
escrow finished
event EscrowFinished( uint256 indexed escrowId, address indexed token, address sender, address recipient, uint256 amount, address agent );
withdrawn
event Withdrawn( address indexed token, address indexed account );
1. Is your feature request related to a problem? Please describe.
2. Describe the solution you'd like
Specifications
State
balances(コントラクト入庫残高)
commitments(エスクロー中数量:拘束数量)
latest escrow id(直近エスクローID)
Methods
token fallback
withdraw
create escrow
cancel escrow
finish escrow
Events
escrow created
escrow canceled
escrow finished
withdrawn