ETH Price: $2,404.76 (-2.22%)

Contract

0x9e62FE15d0E99cE2b30CE0D256e9Ab7b6893AfF5
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
199203662024-05-21 19:27:47141 days ago1716319667  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MaplePoolDelegateCover

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
File 1 of 4 : MaplePoolDelegateCover.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.7;

import { ERC20Helper } from "../modules/erc20-helper/src/ERC20Helper.sol";

import { IMaplePoolDelegateCover } from "./interfaces/IMaplePoolDelegateCover.sol";

/*

    ███╗   ███╗ █████╗ ██████╗ ██╗     ███████╗    ██████╗ ██████╗      ██████╗ ██████╗ ██╗   ██╗███████╗██████╗
    ████╗ ████║██╔══██╗██╔══██╗██║     ██╔════╝    ██╔══██╗██╔══██╗    ██╔════╝██╔═══██╗██║   ██║██╔════╝██╔══██╗
    ██╔████╔██║███████║██████╔╝██║     █████╗      ██████╔╝██║  ██║    ██║     ██║   ██║██║   ██║█████╗  ██████╔╝
    ██║╚██╔╝██║██╔══██║██╔═══╝ ██║     ██╔══╝      ██╔═══╝ ██║  ██║    ██║     ██║   ██║╚██╗ ██╔╝██╔══╝  ██╔══██╗
    ██║ ╚═╝ ██║██║  ██║██║     ███████╗███████╗    ██║     ██████╔╝    ╚██████╗╚██████╔╝ ╚████╔╝ ███████╗██║  ██║
    ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚══════╝╚══════╝    ╚═╝     ╚═════╝      ╚═════╝ ╚═════╝   ╚═══╝  ╚══════╝╚═╝  ╚═╝

*/

contract MaplePoolDelegateCover is IMaplePoolDelegateCover {

    address public override asset;
    address public override poolManager;

    constructor(address poolManager_, address asset_) {
        require((poolManager = poolManager_) != address(0), "PDC:C:ZERO_PM_ADDRESS");
        require((asset       = asset_)       != address(0), "PDC:C:ZERO_A_ADDRESS");
    }

    function moveFunds(uint256 amount_, address recipient_) external override {
        require(msg.sender == poolManager,                        "PDC:MF:NOT_MANAGER");
        require(ERC20Helper.transfer(asset, recipient_, amount_), "PDC:MF:TRANSFER_FAILED");
    }

}

File 2 of 4 : ERC20Helper.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

import { IERC20Like } from "./interfaces/IERC20Like.sol";

/**
 * @title Small Library to standardize erc20 token interactions.
 */
library ERC20Helper {

    /**************************************************************************************************************************************/
    /*** Internal Functions                                                                                                             ***/
    /**************************************************************************************************************************************/

    function transfer(address token_, address to_, uint256 amount_) internal returns (bool success_) {
        return _call(token_, abi.encodeWithSelector(IERC20Like.transfer.selector, to_, amount_));
    }

    function transferFrom(address token_, address from_, address to_, uint256 amount_) internal returns (bool success_) {
        return _call(token_, abi.encodeWithSelector(IERC20Like.transferFrom.selector, from_, to_, amount_));
    }

    function approve(address token_, address spender_, uint256 amount_) internal returns (bool success_) {
        // If setting approval to zero fails, return false.
        if (!_call(token_, abi.encodeWithSelector(IERC20Like.approve.selector, spender_, uint256(0)))) return false;

        // If `amount_` is zero, return true as the previous step already did this.
        if (amount_ == uint256(0)) return true;

        // Return the result of setting the approval to `amount_`.
        return _call(token_, abi.encodeWithSelector(IERC20Like.approve.selector, spender_, amount_));
    }

    function _call(address token_, bytes memory data_) private returns (bool success_) {
        if (token_.code.length == uint256(0)) return false;

        bytes memory returnData;
        ( success_, returnData ) = token_.call(data_);

        return success_ && (returnData.length == uint256(0) || abi.decode(returnData, (bool)));
    }

}

File 3 of 4 : IMaplePoolDelegateCover.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.7;

interface IMaplePoolDelegateCover {

    /**
     *  @dev    Gets the address of the funds asset.
     *  @return asset_ The address of the funds asset.
     */
    function asset() external view returns(address asset_);

    /**
     *  @dev   Move funds from this address to another.
     *  @param amount_    The amount to move.
     *  @param recipient_ The address of the recipient.
     */
    function moveFunds(uint256 amount_, address recipient_) external;

    /**
     *  @dev    Gets the address of the pool manager.
     *  @return poolManager_ The address of the pool manager.
     */
    function poolManager() external view returns(address poolManager_);

}

File 4 of 4 : IERC20Like.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

/// @title Interface of the ERC20 standard as needed by ERC20Helper.
interface IERC20Like {

    function approve(address spender_, uint256 amount_) external returns (bool success_);

    function transfer(address recipient_, uint256 amount_) external returns (bool success_);

    function transferFrom(address owner_, address recipient_, uint256 amount_) external returns (bool success_);

}

Settings
{
  "remappings": [
    "contract-test-utils/=modules/erc20/modules/contract-test-utils/contracts/",
    "ds-test/=modules/forge-std/lib/ds-test/src/",
    "erc20-helper/=modules/erc20-helper/src/",
    "erc20/=modules/erc20/",
    "forge-std/=modules/forge-std/src/",
    "maple-proxy-factory/=modules/maple-proxy-factory/",
    "proxy-factory/=modules/maple-proxy-factory/modules/proxy-factory/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"poolManager_","type":"address"},{"internalType":"address","name":"asset_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"recipient_","type":"address"}],"name":"moveFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"poolManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5060405161049b38038061049b83398101604081905261002f9161012b565b600180546001600160a01b0319166001600160a01b03841690811790915561009e5760405162461bcd60e51b815260206004820152601560248201527f5044433a433a5a45524f5f504d5f41444452455353000000000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556101085760405162461bcd60e51b815260206004820152601460248201527f5044433a433a5a45524f5f415f414444524553530000000000000000000000006044820152606401610095565b505061015e565b80516001600160a01b038116811461012657600080fd5b919050565b6000806040838503121561013e57600080fd5b6101478361010f565b91506101556020840161010f565b90509250929050565b61032e8061016d6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806338d52e0f146100465780637378b20614610075578063dc4c90d31461008a575b600080fd5b600054610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b610088610083366004610281565b61009d565b005b600154610059906001600160a01b031681565b6001546001600160a01b031633146100f15760405162461bcd60e51b81526020600482015260126024820152712822219d26a31d2727aa2fa6a0a720a3a2a960711b60448201526064015b60405180910390fd5b600054610108906001600160a01b03168284610151565b61014d5760405162461bcd60e51b8152602060048201526016602482015275141110ce93518e9514905394d1915497d1905253115160521b60448201526064016100e8565b5050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526000906101a69085906101ae565b949350505050565b60006001600160a01b0383163b6101c757506000610252565b6060836001600160a01b0316836040516101e191906102bd565b6000604051808303816000865af19150503d806000811461021e576040519150601f19603f3d011682016040523d82523d6000602084013e610223565b606091505b50909250905081801561024e57508051158061024e57508080602001905181019061024e9190610258565b9150505b92915050565b60006020828403121561026a57600080fd5b8151801515811461027a57600080fd5b9392505050565b6000806040838503121561029457600080fd5b8235915060208301356001600160a01b03811681146102b257600080fd5b809150509250929050565b6000825160005b818110156102de57602081860181015185830152016102c4565b818111156102ed576000828501525b50919091019291505056fea26469706673582212207e5f4190ba28566bbc5095afa1a12723aae606f170c42a8ba80a8e22f1d87a8d64736f6c634300080700330000000000000000000000007ad5ffa5fdf509e30186f4609c2f6269f4b6158f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c806338d52e0f146100465780637378b20614610075578063dc4c90d31461008a575b600080fd5b600054610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b610088610083366004610281565b61009d565b005b600154610059906001600160a01b031681565b6001546001600160a01b031633146100f15760405162461bcd60e51b81526020600482015260126024820152712822219d26a31d2727aa2fa6a0a720a3a2a960711b60448201526064015b60405180910390fd5b600054610108906001600160a01b03168284610151565b61014d5760405162461bcd60e51b8152602060048201526016602482015275141110ce93518e9514905394d1915497d1905253115160521b60448201526064016100e8565b5050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526000906101a69085906101ae565b949350505050565b60006001600160a01b0383163b6101c757506000610252565b6060836001600160a01b0316836040516101e191906102bd565b6000604051808303816000865af19150503d806000811461021e576040519150601f19603f3d011682016040523d82523d6000602084013e610223565b606091505b50909250905081801561024e57508051158061024e57508080602001905181019061024e9190610258565b9150505b92915050565b60006020828403121561026a57600080fd5b8151801515811461027a57600080fd5b9392505050565b6000806040838503121561029457600080fd5b8235915060208301356001600160a01b03811681146102b257600080fd5b809150509250929050565b6000825160005b818110156102de57602081860181015185830152016102c4565b818111156102ed576000828501525b50919091019291505056fea26469706673582212207e5f4190ba28566bbc5095afa1a12723aae606f170c42a8ba80a8e22f1d87a8d64736f6c63430008070033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000007ad5ffa5fdf509e30186f4609c2f6269f4b6158f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

-----Decoded View---------------
Arg [0] : poolManager_ (address): 0x7aD5fFa5fdF509E30186F4609c2f6269f4B6158F
Arg [1] : asset_ (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000007ad5ffa5fdf509e30186f4609c2f6269f4b6158f
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.