Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BaseCoinWrapper
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import "./Wrapper.sol";
contract BaseCoinWrapper is Wrapper {
constructor(IERC20 base, IERC20 wBase) Wrapper(base, wBase) {} // solhint-disable-line no-empty-blocks
function _wrap() internal view virtual override returns (IERC20 wrappedToken, uint256 rate) {
return (WBASE, 1e18);
}
function _unwrap() internal view virtual override returns (IERC20 unwrappedToken, uint256 rate) {
return (BASE, 1e18);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
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.23;
import "../interfaces/IWrapper.sol";
abstract contract Wrapper is IWrapper {
IERC20 public immutable BASE;
IERC20 public immutable WBASE;
constructor(IERC20 base, IERC20 wBase) {
BASE = base;
WBASE = wBase;
}
function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {
if(token == BASE) {
return _wrap();
} else if (token == WBASE) {
return _unwrap();
} else {
revert NotSupportedToken();
}
}
function _wrap() internal view virtual returns (IERC20 wrappedToken, uint256 rate) {} // solhint-disable-line no-empty-blocks
function _unwrap() internal view virtual returns (IERC20 unwrappedToken, uint256 rate) {} // solhint-disable-line no-empty-blocks
}{
"optimizer": {
"enabled": true,
"runs": 1000000
},
"evmVersion": "shanghai",
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IERC20","name":"base","type":"address"},{"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":[],"name":"BASE","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WBASE","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"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
60c03461008d57601f61034738819003918201601f19168301916001600160401b0383118484101761009157808492604094855283398101031261008d57610052602061004b836100a5565b92016100a5565b9060805260a05260405161028d90816100ba823960805181818160840152610186015260a05181818160f6015281816101cd01526101fb0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361008d5756fe60806040526004361015610011575f80fd5b5f3560e01c8063023276f01461011a5780638e0b3bf2146100ac5763ec342ad01461003a575f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a85760043573ffffffffffffffffffffffffffffffffffffffff80821682036100a857610175604092610184565b90918351921682526020820152f35b7f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff9081169080831682036101f9575050507f000000000000000000000000000000000000000000000000000000000000000090670de0b6b3a764000090565b7f0000000000000000000000000000000000000000000000000000000000000000160361022d5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fdfea2646970667358221220c965bd0e385da8a57bda1f0d846db9d146caf2dc9272b7d79f224933b0d6a4df64736f6c6343000817003300000000000000000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000006
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c8063023276f01461011a5780638e0b3bf2146100ac5763ec342ad01461003a575f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004200000000000000000000000000000000000006168152f35b346100a85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a85760043573ffffffffffffffffffffffffffffffffffffffff80821682036100a857610175604092610184565b90918351921682526020820152f35b7f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff9081169080831682036101f9575050507f000000000000000000000000420000000000000000000000000000000000000690670de0b6b3a764000090565b7f0000000000000000000000004200000000000000000000000000000000000006160361022d5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fdfea2646970667358221220c965bd0e385da8a57bda1f0d846db9d146caf2dc9272b7d79f224933b0d6a4df64736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000006
-----Decoded View---------------
Arg [0] : base (address): 0x0000000000000000000000000000000000000000
Arg [1] : wBase (address): 0x4200000000000000000000000000000000000006
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000004200000000000000000000000000000000000006
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.