Latest 8 txns

TxHash Age From To Value [TxFee]
0x67f7cadd4d722d378764b349b12c432b66bf54eee46f467b9ce7ed651e228a6d7 days 11 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0xe852834bf3afa06a7b8fa680289f45583cae98400 Ether0.000083672
0xa279b7bfe6bafa0c393dd36d2bd64a6e5d1420baaa3ea3f827a8b145f35b65ff7 days 11 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0xe852834bf3afa06a7b8fa680289f45583cae98400 Ether0.000028305
0x13cffa21430c3a77c705edaa447f5945f3f3f09fcd9db5c13a7985bd750881507 days 11 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0xe852834bf3afa06a7b8fa680289f45583cae98400 Ether0.000022203
0xb028a9728c2d1150f3ba696a2b7ae954311accfe67504d5b98c2eebf7b727e467 days 11 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0xe852834bf3afa06a7b8fa680289f45583cae98400 Ether0.000042293
0x77694a494c671ff2163b1179ca115acf0497bc14a50036102706e494c9ad627e7 days 11 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0xe852834bf3afa06a7b8fa680289f45583cae98400 Ether0.000042216
0x3fc78d03f906d598add61495aaff65c3bd0559aa06ce01bd64e2e9be2c90f9997 days 11 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0xe852834bf3afa06a7b8fa680289f45583cae98400 Ether0.000043327
0xf458cd3a00934543a2c6a536e1e8d96984b6f3644a542ae5515dcd232c44c2f07 days 11 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN   0xe852834bf3afa06a7b8fa680289f45583cae98400 Ether0.000043305
0x0045ea46050b6e7d074be4d4ecf2e2ea72b524c81f38967671c186e0e3c995837 days 11 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78  IN    Contract Creation0 Ether0.001018372
[ 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 Model{
    function encodeData(uint128, uint256, uint24, uint40) external pure returns (bytes memory);
}

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) public {
        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) { }

    function requestBatchInsatalmentsLoans(uint256 _length, uint128 _cuota, uint256 _interestRate, uint24 _installments, uint40 _duration) public {
        bytes memory _loanData = Model(model).encodeData(
            _cuota,
            _interestRate,
            _installments,
            _duration
        );

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

    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":"_length","type":"uint256"},{"name":"_cuota","type":"uint128"},{"name":"_interestRate","type":"uint256"},{"name":"_installments","type":"uint24"},{"name":"_duration","type":"uint40"}],"name":"requestBatchInsatalmentsLoans","outputs":[],"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":"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
608060405234801561001057600080fd5b506100437f01ffc9a7000000000000000000000000000000000000000000000000000000006401000000006100de810204565b6100757f76ba6009000000000000000000000000000000000000000000000000000000006401000000006100de810204565b6100a77fcd40239e000000000000000000000000000000000000000000000000000000006401000000006100de810204565b6100d97fbbfa4397000000000000000000000000000000000000000000000000000000006401000000006100de810204565b6101ac565b7fffffffff00000000000000000000000000000000000000000000000000000000808216141561016f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f43616e2774207265676973746572203078666666666666666600000000000000604482015290519081900360640190fd5b7fffffffff00000000000000000000000000000000000000000000000000000000166000908152602081905260409020805460ff19166001179055565b610cef806101bb6000396000f3fe608060405234801561001057600080fd5b5060043610610133576000357c0100000000000000000000000000000000000000000000000000000000900480637adbf973116100bf578063b3ccbcfe1161008e578063b3ccbcfe14610418578063b700f67a14610420578063bfa0b133146104ea578063d355f139146104f2578063dadce8b01461050f57610133565b80637adbf9731461038e5780637dc0d1d0146103b45780639d59011e146103bc578063aa8c217c146103eb57610133565b80634a590818116101065780634a590818146102435780635772ae70146102c057806360c326ea146102e657806376ba60091461030c57806377ae6c471461033b57610133565b806301ffc9a7146101385780630ad9d052146101885780633a8b55f1146101ac5780634665096d1461021e575b600080fd5b6101746004803603602081101561014e57600080fd5b50357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916610536565b604080519115158252519081900360200190f35b61019061056a565b60408051600160a060020a039092168252519081900360200190f35b61021c600480360360208110156101c257600080fd5b8101906020810181356401000000008111156101dd57600080fd5b8201836020820111156101ef57600080fd5b8035906020019184600183028401116401000000008311171561021157600080fd5b509092509050610579565b005b61022661058a565b6040805167ffffffffffffffff9092168252519081900360200190f35b61024b6105b2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028557818101518382015260200161026d565b50505050905090810190601f1680156102b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61021c600480360360208110156102d657600080fd5b5035600160a060020a0316610640565b61021c600480360360208110156102fc57600080fd5b5035600160a060020a031661066f565b6103296004803603602081101561032257600080fd5b503561069e565b60408051918252519081900360200190f35b61021c600480360360a081101561035157600080fd5b5080359060208101356fffffffffffffffffffffffffffffffff1690604081013590606081013562ffffff16906080013564ffffffffff166106c3565b61021c600480360360208110156103a457600080fd5b5035600160a060020a031661097e565b6101906109ad565b61021c600480360360208110156103d257600080fd5b50356fffffffffffffffffffffffffffffffff166109bc565b6103f36109f0565b604080516fffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610190610a08565b6103296004803603608081101561043657600080fd5b81019060208101813564010000000081111561045157600080fd5b82018360208201111561046357600080fd5b8035906020019184600183028401116401000000008311171561048557600080fd5b9193909290916020810190356401000000008111156104a357600080fd5b8201836020820111156104b557600080fd5b803590602001918460018302840111640100000000831117156104d757600080fd5b9193509150803515159060200135610a17565b610329610a23565b61021c6004803603602081101561050857600080fd5b5035610a29565b61021c6004803603602081101561052557600080fd5b503567ffffffffffffffff16610bd5565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660009081526020819052604090205460ff1690565b600454600160a060020a031681565b61058560068383610c28565b505050565b60055474010000000000000000000000000000000000000000900467ffffffffffffffff1681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106385780601f1061060d57610100808354040283529160200191610638565b820191906000526020600020905b81548152906001019060200180831161061b57829003601f168201915b505050505081565b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b7fdfcb15a077f54a681c23131eacdfd6e12b5e099685b492d382c3fd8bfc1e9a2a1890565b60048054604080517fdf390d630000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff8816938101939093526024830186905262ffffff8516604484015264ffffffffff8416606484015251606092600160a060020a039092169163df390d63916084808301926000929190829003018186803b15801561075c57600080fd5b505afa158015610770573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561079957600080fd5b8101908080516401000000008111156107b157600080fd5b820160208101848111156107c457600080fd5b81516401000000008111828201871017156107de57600080fd5b50909450505050505b600086111561097657600154600354600480546005546002546040517ff8201a320000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff909516938501848152600160a060020a0393841660248701819052848416604488018190523060648901819052608489018590527401000000000000000000000000000000000000000090950467ffffffffffffffff1660a4890181905260e060c48a019081528b5160e48b01528b5197909a169963f8201a329993979296959491938c9361010490910190602085019080838360005b838110156108e65781810151838201526020016108ce565b50505050905090810190601f1680156109135780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b15801561093857600080fd5b505af115801561094c573d6000803e3d6000fd5b505050506040513d602081101561096257600080fd5b5050600280546001019055600095506107e7565b505050505050565b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031681565b600380546fffffffffffffffffffffffffffffffff19166fffffffffffffffffffffffffffffffff92909216919091179055565b6003546fffffffffffffffffffffffffffffffff1681565b600154600160a060020a031681565b60009695505050505050565b60025481565b6000811115610bd2576001805460035460048054600554600280546040517ff8201a320000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff909616948601858152600160a060020a0394851660248801819052858516604489018190523060648a0181905260848a018590527401000000000000000000000000000000000000000090960467ffffffffffffffff1660a48a0181905260e060c48b01908152600680546101009e8116159e909e0260001901909d169690960460e48b0181905297909a169a63f8201a329a98999298919794959194909392610104019084908015610b6f5780601f10610b4457610100808354040283529160200191610b6f565b820191906000526020600020905b815481529060010190602001808311610b5257829003601f168201915b505098505050505050505050602060405180830381600087803b158015610b9557600080fd5b505af1158015610ba9573d6000803e3d6000fd5b505050506040513d6020811015610bbf57600080fd5b5050600280546001019055506000610a29565b50565b6005805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c695782800160ff19823516178555610c96565b82800160010185558215610c96579182015b82811115610c96578235825591602001919060010190610c7b565b50610ca2929150610ca6565b5090565b610cc091905b80821115610ca25760008155600101610cac565b9056fea165627a7a723058200661dbef8f2a2d2975b10d17312ce7fab310d1ef57d8655e2643c2cc8c9a63d30029

   Swarm Source:
bzzr://0661dbef8f2a2d2975b10d17312ce7fab310d1ef57d8655e2643c2cc8c9a63d3

 

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