Latest 7 txns

TxHash Age From To Value [TxFee]
0xe5ae3221f7644ffc2fa4597dd65f9b2b2d573112e1f36987aee5aa82cebc42f77 days 13 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0x2486df2056912b105e0912016f022e885a084b7f0 Ether0.000043327
0x9f296c39aa598d1ff7ef122b960e5f922984f00cb045562f08f4dd8ac59fb1bb7 days 13 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0x2486df2056912b105e0912016f022e885a084b7f0 Ether0.000043305
0xebe5096c986f991a21a6e970fe6e866f78800a9e0b96fe5d43d367c93b81e3727 days 13 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0x2486df2056912b105e0912016f022e885a084b7f0 Ether0.000083736
0x209e59b28e1a3dfe6cf591249ba60104d0172ff4ff1a7c098e955dc96edee3457 days 13 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0x2486df2056912b105e0912016f022e885a084b7f0 Ether0.000042216
0x4880e5ad8ccdc763824da30acdd5666d57a8716f54a5e824e4fcd6047248246a7 days 14 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0x2486df2056912b105e0912016f022e885a084b7f0 Ether0.000042293
0x424173a5edcf99089206182b891d941bb61eb6daa835cb4df2b1c0c2c1f7ecbc7 days 14 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0x2486df2056912b105e0912016f022e885a084b7f0 Ether0.000022203
0x62a4ac110dfbd749dc5cda67972c3101b9341396b2c64e7fc67d6a7a587512d77 days 14 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN    Contract Creation0 Ether0.000883406
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: BatchRequester
Compiler Text: v0.5.2+commit.1df8f40c
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.5.0;


contract DebtEngine {
}


contract LoanManager {
    function debtEngine() external view returns (DebtEngine);
    
    function requestLoan(uint128 _amount, address _model, address _oracle, address _borrower, uint256 _salt, uint64 _expiration, bytes calldata _loanData) external returns (bytes32 id);
}


contract ERC165 {
    bytes4 private constant _InterfaceId_ERC165 = 0x01ffc9a7;
    /**
    * 0x01ffc9a7 ===
    *   bytes4(keccak256('supportsInterface(bytes4)'))
    */

    /**
    * @dev a mapping of interface id to whether or not it's supported
    */
    mapping(bytes4 => bool) private _supportedInterfaces;

    /**
    * @dev A contract implementing SupportsInterfaceWithLookup
    * implement ERC165 itself
    */
    constructor()
        internal
    {
        _registerInterface(_InterfaceId_ERC165);
    }

    /**
    * @dev implement supportsInterface(bytes4) using a lookup table
    */
    function supportsInterface(bytes4 interfaceId)
        external
        view
        returns (bool)
    {
        return _supportedInterfaces[interfaceId];
    }

    /**
    * @dev internal method for registering an interface
    */
    function _registerInterface(bytes4 interfaceId)
        internal
    {
        require(interfaceId != 0xffffffff, "Can't register 0xffffffff");
        _supportedInterfaces[interfaceId] = true;
    }
}


interface IERC721Base {
    function assetsOf(address _owner) external view returns (uint256[] memory);
    function totalSupply() external view returns (uint256);
    function tokenByIndex(uint256 _index) external view returns (uint256);
    function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256);
    function ownerOf(uint256 _assetId) external view returns (address);
    function balanceOf(address _owner) external view returns (uint256);
    function isApprovedForAll(address _operator, address _assetHolder) external view returns (bool);
    function isAuthorized(address _operator, uint256 _assetId) external view returns (bool);

    function setApprovalForAll(address _operator, bool _authorized) external;
    function approve(address _operator, uint256 _assetId) external;
    function safeTransferFrom(address _from, address _to, uint256 _assetId) external;
    function safeTransferFrom(address _from, address _to, uint256 _assetId, bytes calldata _userData) external;
    function transferFrom(address _from, address _to, uint256 _assetId) external;
}


/**
    A contract implementing LoanApprover is able to approve loan requests using callbacks,
    to approve a loan the contract should respond the callbacks the result of
    one designated value XOR keccak256("approve-loan-request")

    keccak256("approve-loan-request"): 0xdfcb15a077f54a681c23131eacdfd6e12b5e099685b492d382c3fd8bfc1e9a2a

    To receive calls on the callbacks, the contract should also implement the following ERC165 interfaces:

    approveRequest: 0x76ba6009
    settleApproveRequest: 0xcd40239e
    LoanApprover: 0xbbfa4397
*/
contract LoanApprover {
    /**
        Request the approve of a loan created using requestLoan, if the borrower is this contract,
        to approve the request the contract should return:

        _futureDebt XOR 0xdfcb15a077f54a681c23131eacdfd6e12b5e099685b492d382c3fd8bfc1e9a2a

        @param _futureDebt ID of the loan to approve

        @return _futureDebt XOR keccak256("approve-loan-request"), if the approve is accepted
    */
    function approveRequest(bytes32 _futureDebt) external returns (bytes32);

    /**
        Request the approve of a loan being settled, the contract can be called as borrower or creator.
        To approve the request the contract should return:

        _id XOR 0xdfcb15a077f54a681c23131eacdfd6e12b5e099685b492d382c3fd8bfc1e9a2a

        @param _requestData All the parameters of the loan request
        @param _loanData Data to feed to the Model
        @param _isBorrower True if this contract is the borrower, False if the contract is the creator
        @param _id loanManager.requestSignature(_requestDatam _loanData)

        @return _id XOR keccak256("approve-loan-request"), if the approve is accepted
    */
    function settleApproveRequest(
        bytes calldata _requestData,
        bytes calldata _loanData,
        bool _isBorrower,
        uint256 _id
    )
        external returns (bytes32);
}


contract BatchRequester is ERC165, LoanApprover{
    LoanManager public loanManager;
    uint256 public salt;

    uint128 public amount;
    address public model;
    address public oracle;
    uint64 public expiration;
    bytes public loanData;

    constructor() public {
        _registerInterface(0x76ba6009);
        _registerInterface(0xcd40239e);
        _registerInterface(0xbbfa4397);
    }

    function setLoanManager(LoanManager _loanManager) external {
        loanManager = _loanManager;
    }

    function setAmount(uint128 _amount) external {
        amount = _amount;
    }

    function setModel(address _model) external {
        model = _model;
    }

    function setOracle(address _oracle) external {
        oracle = _oracle;
    }

    function setExpiration(uint64 _expiration) external {
        expiration = _expiration;
    }

    function setLoanData(bytes calldata _loanData) external {
        loanData = _loanData;
    }

    function requestBatchLoans(uint256 _length, bytes memory _loanData) public {
        if (_loanData.length == 0)
            _loanData = loanData;

        for(; _length > 0;) {
            loanManager.requestLoan(
                amount,
                model,
                oracle,
                address(this),
                salt,
                expiration,
                _loanData
            );
            salt++;
            _length -= _length;
        }
    }

    function approveRequest(bytes32 _futureDebt) external returns (bytes32) {
        return _futureDebt ^ 0xdfcb15a077f54a681c23131eacdfd6e12b5e099685b492d382c3fd8bfc1e9a2a;
    }

    function settleApproveRequest(bytes calldata, bytes calldata, bool, uint256) external returns (bytes32) { }
}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"model","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_loanData","type":"bytes"}],"name":"setLoanData","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"expiration","outputs":[{"name":"","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"loanData","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_loanManager","type":"address"}],"name":"setLoanManager","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_model","type":"address"}],"name":"setModel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_futureDebt","type":"bytes32"}],"name":"approveRequest","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"oracle","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint128"}],"name":"setAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"amount","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"loanManager","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"bytes"},{"name":"","type":"bytes"},{"name":"","type":"bool"},{"name":"","type":"uint256"}],"name":"settleApproveRequest","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"salt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_length","type":"uint256"},{"name":"_loanData","type":"bytes"}],"name":"requestBatchLoans","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_expiration","type":"uint64"}],"name":"setExpiration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

  Contract Creation Code Switch To Opcodes View
608060405234801561001057600080fd5b506100437f01ffc9a7000000000000000000000000000000000000000000000000000000006401000000006100de810204565b6100757f76ba6009000000000000000000000000000000000000000000000000000000006401000000006100de810204565b6100a77fcd40239e000000000000000000000000000000000000000000000000000000006401000000006100de810204565b6100d97fbbfa4397000000000000000000000000000000000000000000000000000000006401000000006100de810204565b6101ac565b7fffffffff00000000000000000000000000000000000000000000000000000000808216141561016f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f43616e2774207265676973746572203078666666666666666600000000000000604482015290519081900360640190fd5b7fffffffff00000000000000000000000000000000000000000000000000000000166000908152602081905260409020805460ff19166001179055565b610ae3806101bb6000396000f3fe608060405234801561001057600080fd5b5060043610610128576000357c0100000000000000000000000000000000000000000000000000000000900480637adbf973116100bf578063b3ccbcfe1161008e578063b3ccbcfe146103ba578063b700f67a146103c2578063bfa0b1331461048c578063c91ec0c914610494578063dadce8b01461054157610128565b80637adbf973146103305780637dc0d1d0146103565780639d59011e1461035e578063aa8c217c1461038d57610128565b80634a590818116100fb5780634a590818146102385780635772ae70146102b557806360c326ea146102db57806376ba60091461030157610128565b806301ffc9a71461012d5780630ad9d0521461017d5780633a8b55f1146101a15780634665096d14610213575b600080fd5b6101696004803603602081101561014357600080fd5b50357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916610568565b604080519115158252519081900360200190f35b61018561059c565b60408051600160a060020a039092168252519081900360200190f35b610211600480360360208110156101b757600080fd5b8101906020810181356401000000008111156101d257600080fd5b8201836020820111156101e457600080fd5b8035906020019184600183028401116401000000008311171561020657600080fd5b5090925090506105ab565b005b61021b6105bc565b6040805167ffffffffffffffff9092168252519081900360200190f35b6102406105e4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561027a578181015183820152602001610262565b50505050905090810190601f1680156102a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610211600480360360208110156102cb57600080fd5b5035600160a060020a0316610672565b610211600480360360208110156102f157600080fd5b5035600160a060020a03166106a1565b61031e6004803603602081101561031757600080fd5b50356106d0565b60408051918252519081900360200190f35b6102116004803603602081101561034657600080fd5b5035600160a060020a03166106f5565b610185610724565b6102116004803603602081101561037457600080fd5b50356fffffffffffffffffffffffffffffffff16610733565b610395610767565b604080516fffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61018561077f565b61031e600480360360808110156103d857600080fd5b8101906020810181356401000000008111156103f357600080fd5b82018360208201111561040557600080fd5b8035906020019184600183028401116401000000008311171561042757600080fd5b91939092909160208101903564010000000081111561044557600080fd5b82018360208201111561045757600080fd5b8035906020019184600183028401116401000000008311171561047957600080fd5b919350915080351515906020013561078e565b61031e61079a565b610211600480360360408110156104aa57600080fd5b813591908101906040810160208201356401000000008111156104cc57600080fd5b8201836020820111156104de57600080fd5b8035906020019184600183028401116401000000008311171561050057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506107a0945050505050565b6102116004803603602081101561055757600080fd5b503567ffffffffffffffff166109c9565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660009081526020819052604090205460ff1690565b600454600160a060020a031681565b6105b760068383610a1c565b505050565b60055474010000000000000000000000000000000000000000900467ffffffffffffffff1681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561066a5780601f1061063f5761010080835404028352916020019161066a565b820191906000526020600020905b81548152906001019060200180831161064d57829003601f168201915b505050505081565b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b7fdfcb15a077f54a681c23131eacdfd6e12b5e099685b492d382c3fd8bfc1e9a2a1890565b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031681565b600380546fffffffffffffffffffffffffffffffff19166fffffffffffffffffffffffffffffffff92909216919091179055565b6003546fffffffffffffffffffffffffffffffff1681565b600154600160a060020a031681565b60009695505050505050565b60025481565b80511515610836576006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561082e5780601f106108035761010080835404028352916020019161082e565b820191906000526020600020905b81548152906001019060200180831161081157829003601f168201915b505050505090505b60008211156109c557600154600354600480546005546002546040517ff8201a320000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff909516938501848152600160a060020a0393841660248701819052848416604488018190523060648901819052608489018590527401000000000000000000000000000000000000000090950467ffffffffffffffff1660a4890181905260e060c48a019081528b5160e48b01528b5197909a169963f8201a329993979296959491938c9361010490910190602085019080838360005b8381101561093557818101518382015260200161091d565b50505050905090810190601f1680156109625780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b15801561098757600080fd5b505af115801561099b573d6000803e3d6000fd5b505050506040513d60208110156109b157600080fd5b505060028054600101905560009150610836565b5050565b6005805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610a5d5782800160ff19823516178555610a8a565b82800160010185558215610a8a579182015b82811115610a8a578235825591602001919060010190610a6f565b50610a96929150610a9a565b5090565b610ab491905b80821115610a965760008155600101610aa0565b9056fea165627a7a72305820e35b78ed9738fb665ae1c006618f335e338defcb6d89e0732c1226b4d5dbc78b0029

   Swarm Source:
bzzr://e35b78ed9738fb665ae1c006618f335e338defcb6d89e0732c1226b4d5dbc78b

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward