Contract
0xB89A664FdAf504CDc7826B97Ba6e522d9b78dbE7
5
Contract Overview
Balance:
0 xDAI
xDAI Value:
$0.00
My Name Tag:
Not Available, login to update
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0xa26cc4cfaa5f9acc6ea0d23fc3e2e060d8f87384b1a0c1225773a618d4e31d75 | 0x60a03461 | 27313240 | 63 days 23 hrs ago | 0x56e44874f624ebde6efcc783efd685f0fbdc6dcf | IN | Create: BaseCoinWrapper | 0 xDAI | 0.000136615 |
[ Download CSV Export ]
Contract Source Code Verified (Exact Match)
Contract Name:
BaseCoinWrapper
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IWrapper { error NotSupportedToken(); error NotAddedMarket(); error NotRemovedMarket(); function wrap(IERC20 token) external view returns (IERC20 wrappedToken, uint256 rate); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "../interfaces/IWrapper.sol"; contract BaseCoinWrapper is IWrapper { IERC20 private constant _BASE = IERC20(0x0000000000000000000000000000000000000000); IERC20 private immutable _wBase; constructor(IERC20 wBase) { _wBase = wBase; } function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) { if(token == _BASE) { return (_wBase, 1e18); } else if (token == _wBase) { return (_BASE, 1e18); } else { revert NotSupportedToken(); } } }
{ "optimizer": { "enabled": true, "runs": 1000000 }, "viaIR": true, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
[{"inputs":[{"internalType":"contract IERC20","name":"wBase","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NotAddedMarket","type":"error"},{"inputs":[],"name":"NotRemovedMarket","type":"error"},{"inputs":[],"name":"NotSupportedToken","type":"error"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"wrap","outputs":[{"internalType":"contract IERC20","name":"wrappedToken","type":"address"},{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a03461006f57601f61020738819003918201601f19168301916001600160401b038311848410176100745780849260209460405283398101031261006f57516001600160a01b038116810361006f5760805260405161017c908161008b823960805181818160ba015260e80152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c63023276f01461002857600080fd5b346100955760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610095576004359073ffffffffffffffffffffffffffffffffffffffff9081831683036100955750610086604092610098565b90918351921682526020820152f35b80fd5b73ffffffffffffffffffffffffffffffffffffffff90811690816100e65750507f000000000000000000000000000000000000000000000000000000000000000090670de0b6b3a764000090565b7f0000000000000000000000000000000000000000000000000000000000000000160361011c57600090670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fdfea26469706673582212208d411b6713168dad85a233dcf25b2831e8ab5dc575f33b31516a9964b28f0cda64736f6c63430008130033000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d
-----Decoded View---------------
Arg [0] : wBase (address): 0xe91d153e0b41518a2ce8dd3d7944fa863463a97d
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.