github.com/FUSIONFoundation/efsn@v3.6.2-0.20200916075423-dbb5dd5d2cc7+incompatible/contracts/fsn/FSNContract.sol (about)

     1  pragma solidity ^0.5.4;
     2  
     3  contract FSNContract {
     4      address constant precompile = address(0x9999999999999999999999999999999999999999);
     5  
     6      // these events will be generated by the low level impl.
     7      event LogFusionAssetReceived(bytes32 indexed _asset, address indexed _from, uint256 _value, uint64 _start, uint64 _end, SendAssetFlag _flag);
     8      event LogFusionAssetSent(bytes32 indexed _asset, address indexed _to, uint256 _value, uint64 _start, uint64 _end, SendAssetFlag _flag);
     9  
    10      enum SendAssetFlag {
    11          UseAny,                 // 0
    12          UseAnyToTimeLock,       // 1
    13          UseTimeLock,            // 2
    14          UseTimeLockToTimeLock,  // 3
    15          UseAsset,               // 4
    16          UseAssetToTimeLock      // 5
    17      }
    18  
    19      function _sendAsset(bytes32 asset, address to, uint256 value, uint64 start, uint64 end, SendAssetFlag flag) internal returns (bool, bytes memory) {
    20          bytes memory input = abi.encode(1, asset, to, value, start, end, flag);
    21          return precompile.call(input);
    22      }
    23  }