Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
3188543 | 42 days ago | Contract Creation | 0 S |
Loading...
Loading
Contract Name:
SonicUSDDecoderAndSanitizer
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; import {BaseDecoderAndSanitizer} from "src/base/DecodersAndSanitizers/BaseDecoderAndSanitizer.sol"; import {SonicGatewayDecoderAndSanitizer} from "src/base/DecodersAndSanitizers/Protocols/SonicGatewayDecoderAndSanitizer.sol"; contract SonicUSDDecoderAndSanitizer is BaseDecoderAndSanitizer, SonicGatewayDecoderAndSanitizer { constructor(address _boringVault) BaseDecoderAndSanitizer(_boringVault) {} }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; import {DecoderCustomTypes} from "src/interfaces/DecoderCustomTypes.sol"; contract BaseDecoderAndSanitizer { error BaseDecoderAndSanitizer__FunctionSelectorNotSupported(); //============================== IMMUTABLES =============================== /** * @notice The BoringVault contract address. */ address internal immutable boringVault; constructor(address _boringVault) { boringVault = _boringVault; } function approve(address spender, uint256) external pure returns (bytes memory addressesFound) { addressesFound = abi.encodePacked(spender); } function transfer(address _to, uint256) external pure returns (bytes memory addressesFound) { addressesFound = abi.encodePacked(_to); } function claimFees(address feeAsset) external pure returns (bytes memory addressesFound) { addressesFound = abi.encodePacked(feeAsset); } function claimYield(address yieldAsset) external pure returns (bytes memory addressesFound) { addressesFound = abi.encodePacked(yieldAsset); } function withdrawNonBoringToken(address token, uint256 /*amount*/ ) external pure returns (bytes memory addressesFound) { addressesFound = abi.encodePacked(token); } function withdrawNativeFromDrone() external pure returns (bytes memory addressesFound) { return addressesFound; } //============================== FALLBACK =============================== /** * @notice The purpose of this function is to revert with a known error, * so that during merkle tree creation we can verify that a * leafs decoder and sanitizer implments the required function * selector. */ fallback() external { revert BaseDecoderAndSanitizer__FunctionSelectorNotSupported(); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; import {BaseDecoderAndSanitizer} from "src/base/DecodersAndSanitizers/BaseDecoderAndSanitizer.sol"; abstract contract SonicGatewayDecoderAndSanitizer is BaseDecoderAndSanitizer { ////////////////// Sonic Gateway ////////////////// //bridges mainnet -> sonic function deposit(uint96 /*uid*/, address token, uint256 /*amount*/) external pure virtual returns (bytes memory addressesFound) { return abi.encodePacked(token); } //bridges sonic -> mainnet function withdraw(uint96 /*uid*/, address token, uint256 /*amount*/) external pure virtual returns (bytes memory addressesFound) { return abi.encodePacked(token); } function claim(uint256 /*id*/, address token, uint256 /*amount*/, bytes calldata /*proof*/) external pure virtual returns (bytes memory addressesFound) { return abi.encodePacked(token); } //if the bridge is "dead", we can cancel our deposit if needed function cancelDepositWhileDead(uint256 /*id*/, address token, uint256 /*amount*/, bytes calldata /*proof*/) external pure virtual returns (bytes memory addressesFound) { return abi.encodePacked(token); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; contract DecoderCustomTypes { // ========================================= BALANCER ========================================= struct JoinPoolRequest { address[] assets; uint256[] maxAmountsIn; bytes userData; bool fromInternalBalance; } struct ExitPoolRequest { address[] assets; uint256[] minAmountsOut; bytes userData; bool toInternalBalance; } enum SwapKind { GIVEN_IN, GIVEN_OUT } struct SingleSwap { bytes32 poolId; SwapKind kind; address assetIn; address assetOut; uint256 amount; bytes userData; } struct FundManagement { address sender; bool fromInternalBalance; address recipient; bool toInternalBalance; } // ========================================= UNISWAP V3 ========================================= struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } struct IncreaseLiquidityParams { uint256 tokenId; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } struct DecreaseLiquidityParams { uint256 tokenId; uint128 liquidity; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } struct CollectParams { uint256 tokenId; address recipient; uint128 amount0Max; uint128 amount1Max; } struct ExactInputParams { bytes path; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; } struct PancakeSwapExactInputParams { bytes path; address recipient; uint256 amountIn; uint256 amountOutMinimum; } // ========================================= MORPHO BLUE ========================================= struct MarketParams { address loanToken; address collateralToken; address oracle; address irm; uint256 lltv; } // ========================================= 1INCH ========================================= struct SwapDescription { address srcToken; address dstToken; address payable srcReceiver; address payable dstReceiver; uint256 amount; uint256 minReturnAmount; uint256 flags; } // ========================================= PENDLE ========================================= struct TokenInput { // TOKEN DATA address tokenIn; uint256 netTokenIn; address tokenMintSy; // AGGREGATOR DATA address pendleSwap; SwapData swapData; } struct TokenOutput { // TOKEN DATA address tokenOut; uint256 minTokenOut; address tokenRedeemSy; // AGGREGATOR DATA address pendleSwap; SwapData swapData; } struct ApproxParams { uint256 guessMin; uint256 guessMax; uint256 guessOffchain; // pass 0 in to skip this variable uint256 maxIteration; // every iteration, the diff between guessMin and guessMax will be divided by 2 uint256 eps; // the max eps between the returned result & the correct result, base 1e18. Normally this number will be set // to 1e15 (1e18/1000 = 0.1%) } struct SwapData { SwapType swapType; address extRouter; bytes extCalldata; bool needScale; } enum SwapType { NONE, KYBERSWAP, ONE_INCH, // ETH_WETH not used in Aggregator ETH_WETH } struct LimitOrderData { address limitRouter; uint256 epsSkipMarket; // only used for swap operations, will be ignored otherwise FillOrderParams[] normalFills; FillOrderParams[] flashFills; bytes optData; } struct FillOrderParams { Order order; bytes signature; uint256 makingAmount; } struct Order { uint256 salt; uint256 expiry; uint256 nonce; OrderType orderType; address token; address YT; address maker; address receiver; uint256 makingAmount; uint256 lnImpliedRate; uint256 failSafeRate; bytes permit; } enum OrderType { SY_FOR_PT, PT_FOR_SY, SY_FOR_YT, YT_FOR_SY } // ========================================= EIGEN LAYER ========================================= struct QueuedWithdrawalParams { // Array of strategies that the QueuedWithdrawal contains address[] strategies; // Array containing the amount of shares in each Strategy in the `strategies` array uint256[] shares; // The address of the withdrawer address withdrawer; } struct Withdrawal { // The address that originated the Withdrawal address staker; // The address that the staker was delegated to at the time that the Withdrawal was created address delegatedTo; // The address that can complete the Withdrawal + will receive funds when completing the withdrawal address withdrawer; // Nonce used to guarantee that otherwise identical withdrawals have unique hashes uint256 nonce; // Block number when the Withdrawal was created uint32 startBlock; // Array of strategies that the Withdrawal contains address[] strategies; // Array containing the amount of shares in each Strategy in the `strategies` array uint256[] shares; } struct SignatureWithExpiry { // the signature itself, formatted as a single bytes object bytes signature; // the expiration timestamp (UTC) of the signature uint256 expiry; } struct EarnerTreeMerkleLeaf { address earner; bytes32 earnerTokenRoot; } struct TokenTreeMerkleLeaf { address token; uint256 cumulativeEarnings; } struct RewardsMerkleClaim { uint32 rootIndex; uint32 earnerIndex; bytes earnerTreeProof; EarnerTreeMerkleLeaf earnerLeaf; uint32[] tokenIndices; bytes[] tokenTreeProofs; TokenTreeMerkleLeaf[] tokenLeaves; } // ========================================= CCIP ========================================= // If extraArgs is empty bytes, the default is 200k gas limit. struct EVM2AnyMessage { bytes receiver; // abi.encode(receiver address) for dest EVM chains bytes data; // Data payload EVMTokenAmount[] tokenAmounts; // Token transfers address feeToken; // Address of feeToken. address(0) means you will send msg.value. bytes extraArgs; // Populate this with _argsToBytes(EVMExtraArgsV2) } /// @dev RMN depends on this struct, if changing, please notify the RMN maintainers. struct EVMTokenAmount { address token; // token address on the local chain. uint256 amount; // Amount of tokens. } struct EVMExtraArgsV1 { uint256 gasLimit; } // ========================================= OFT ========================================= struct SendParam { uint32 dstEid; // Destination endpoint ID. bytes32 to; // Recipient address. uint256 amountLD; // Amount to send in local decimals. uint256 minAmountLD; // Minimum amount to send in local decimals. bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message. bytes composeMsg; // The composed message for the send() operation. bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations. } struct MessagingFee { uint256 nativeFee; uint256 lzTokenFee; } // ========================================= L1StandardBridge ========================================= struct WithdrawalTransaction { uint256 nonce; address sender; address target; uint256 value; uint256 gasLimit; bytes data; } struct OutputRootProof { bytes32 version; bytes32 stateRoot; bytes32 messagePasserStorageRoot; bytes32 latestBlockhash; } // ========================================= Mantle L1StandardBridge ========================================= struct MantleWithdrawalTransaction { uint256 nonce; address sender; address target; uint256 mntValue; uint256 value; uint256 gasLimit; bytes data; } // ========================================= Linea Bridge ========================================= struct ClaimMessageWithProofParams { bytes32[] proof; uint256 messageNumber; uint32 leafIndex; address from; address to; uint256 fee; uint256 value; address payable feeRecipient; bytes32 merkleRoot; bytes data; } // ========================================= Scroll Bridge ========================================= struct L2MessageProof { uint256 batchIndex; bytes merkleProof; } // ========================================= Camelot V3 ========================================= struct CamelotMintParams { address token0; address token1; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } // ========================================= Velodrome V3 ========================================= struct VelodromeMintParams { address token0; address token1; int24 tickSpacing; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; uint160 sqrtPriceX96; } // ========================================= Karak ========================================= struct QueuedWithdrawal { address staker; address delegatedTo; uint256 nonce; uint256 start; WithdrawRequest request; } struct WithdrawRequest { address[] vaults; uint256[] shares; address withdrawer; } // ========================================= Term Finance ================================== /// @dev TermAuctionOfferSubmission represents an offer submission to offeror an amount of money for a specific interest rate struct TermAuctionOfferSubmission { /// @dev For an existing offer this is the unique onchain identifier for this offer. For a new offer this is a randomized input that will be used to generate the unique onchain identifier. bytes32 id; /// @dev The address of the offeror address offeror; /// @dev Hash of the offered price as a percentage of the initial loaned amount vs amount returned at maturity. This stores 9 decimal places bytes32 offerPriceHash; /// @dev The maximum amount of purchase tokens that can be lent uint256 amount; /// @dev The address of the ERC20 purchase token address purchaseToken; } }
{ "remappings": [ "@solmate/=lib/solmate/src/", "@forge-std/=lib/forge-std/src/", "@ds-test/=lib/forge-std/lib/ds-test/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "@ccip/=lib/ccip/", "@oapp-auth/=lib/OAppAuth/src/", "@devtools-oapp-evm/=lib/OAppAuth/lib/devtools/packages/oapp-evm/contracts/oapp/", "@layerzerolabs/lz-evm-messagelib-v2/=lib/OAppAuth/node_modules/@layerzerolabs/lz-evm-messagelib-v2/", "@layerzerolabs/lz-evm-protocol-v2/=lib/OAppAuth/lib/LayerZero-V2/packages/layerzero-v2/evm/protocol/", "@layerzerolabs/oapp-evm/=lib/OAppAuth/lib/devtools/packages/oapp-evm/", "@lz-oapp-evm/=lib/OAppAuth/lib/LayerZero-V2/packages/layerzero-v2/evm/oapp/contracts/oapp/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "LayerZero-V2/=lib/OAppAuth/lib/", "OAppAuth/=lib/OAppAuth/", "ccip/=lib/ccip/contracts/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "halmos-cheatcodes/=lib/OAppAuth/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "solidity-bytes-utils/=lib/OAppAuth/node_modules/solidity-bytes-utils/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_boringVault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BaseDecoderAndSanitizer__FunctionSelectorNotSupported","type":"error"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"cancelDepositWhileDead","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"claim","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"feeAsset","type":"address"}],"name":"claimFees","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"yieldAsset","type":"address"}],"name":"claimYield","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint96","name":"","type":"uint96"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint96","name":"","type":"uint96"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"withdrawNativeFromDrone","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawNonBoringToken","outputs":[{"internalType":"bytes","name":"addressesFound","type":"bytes"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
60a060405234801561000f575f80fd5b5060405161042238038061042283398101604081905261002e9161003f565b6001600160a01b031660805261006c565b5f6020828403121561004f575f80fd5b81516001600160a01b0381168114610065575f80fd5b9392505050565b6080516103a16100815f395f50506103a15ff3fe608060405234801561000f575f80fd5b506004361061009c575f3560e01c8063990161421161006457806399016142146100f1578063999927df146100de5780639f63522414610104578063a9059cbb146100b5578063da3ef9d2146101175761009c565b8063095ea7b3146100b557806309f0e0c2146100b557806315a0ea6a146100de5780635eaf5260146100f15780637542cda814610104575b604051633790be8760e21b815260040160405180910390fd5b6100c86100c33660046101e4565b61011e565b6040516100d5919061020c565b60405180910390f35b6100c86100ec366004610257565b610148565b6100c86100ff366004610277565b610171565b6100c8610112366004610303565b61019e565b60606100c8565b606082604051602001610131919061034e565b604051602081830303815290604052905092915050565b60608160405160200161015b919061034e565b6040516020818303038152906040529050919050565b606084604051602001610184919061034e565b604051602081830303815290604052905095945050505050565b6060826040516020016101b1919061034e565b60405160208183030381529060405290509392505050565b80356001600160a01b03811681146101df575f80fd5b919050565b5f80604083850312156101f5575f80fd5b6101fe836101c9565b946020939093013593505050565b5f6020808352835180828501525f5b818110156102375785810183015185820160400152820161021b565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610267575f80fd5b610270826101c9565b9392505050565b5f805f805f6080868803121561028b575f80fd5b8535945061029b602087016101c9565b935060408601359250606086013567ffffffffffffffff808211156102be575f80fd5b818801915088601f8301126102d1575f80fd5b8135818111156102df575f80fd5b8960208285010111156102f0575f80fd5b9699959850939650602001949392505050565b5f805f60608486031215610315575f80fd5b83356bffffffffffffffffffffffff81168114610330575f80fd5b925061033e602085016101c9565b9150604084013590509250925092565b60609190911b6bffffffffffffffffffffffff191681526014019056fea26469706673582212204bf2c6b089c0adf3ec7575a682e2999b1f0308930a81443c582e2059acedefc764736f6c63430008150033000000000000000000000000d3dce716f3ef535c5ff8d041c1a41c3bd89b97ae
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061009c575f3560e01c8063990161421161006457806399016142146100f1578063999927df146100de5780639f63522414610104578063a9059cbb146100b5578063da3ef9d2146101175761009c565b8063095ea7b3146100b557806309f0e0c2146100b557806315a0ea6a146100de5780635eaf5260146100f15780637542cda814610104575b604051633790be8760e21b815260040160405180910390fd5b6100c86100c33660046101e4565b61011e565b6040516100d5919061020c565b60405180910390f35b6100c86100ec366004610257565b610148565b6100c86100ff366004610277565b610171565b6100c8610112366004610303565b61019e565b60606100c8565b606082604051602001610131919061034e565b604051602081830303815290604052905092915050565b60608160405160200161015b919061034e565b6040516020818303038152906040529050919050565b606084604051602001610184919061034e565b604051602081830303815290604052905095945050505050565b6060826040516020016101b1919061034e565b60405160208183030381529060405290509392505050565b80356001600160a01b03811681146101df575f80fd5b919050565b5f80604083850312156101f5575f80fd5b6101fe836101c9565b946020939093013593505050565b5f6020808352835180828501525f5b818110156102375785810183015185820160400152820161021b565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610267575f80fd5b610270826101c9565b9392505050565b5f805f805f6080868803121561028b575f80fd5b8535945061029b602087016101c9565b935060408601359250606086013567ffffffffffffffff808211156102be575f80fd5b818801915088601f8301126102d1575f80fd5b8135818111156102df575f80fd5b8960208285010111156102f0575f80fd5b9699959850939650602001949392505050565b5f805f60608486031215610315575f80fd5b83356bffffffffffffffffffffffff81168114610330575f80fd5b925061033e602085016101c9565b9150604084013590509250925092565b60609190911b6bffffffffffffffffffffffff191681526014019056fea26469706673582212204bf2c6b089c0adf3ec7575a682e2999b1f0308930a81443c582e2059acedefc764736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d3dce716f3ef535c5ff8d041c1a41c3bd89b97ae
-----Decoded View---------------
Arg [0] : _boringVault (address): 0xd3DCe716f3eF535C5Ff8d041c1A41C3bd89b97aE
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d3dce716f3ef535c5ff8d041c1a41c3bd89b97ae
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.