ETH Price: $3,343.53 (+7.20%)
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ChonkMakeover

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;

interface IChonksMain {
    function unequipAll(uint256 _chonkTokenId) external;
    function chonkMakeover(
        uint256 _chonkTokenId,
        uint256[] calldata _traitTokenIds,
        uint8[] calldata _traitCategories,
        uint8 _bodyIndex,
        string memory _backgroundColor,
        bool _render3D
    ) external;
    function transferFrom(address from, address to, uint256 tokenId) external;
}

/// This helper contract works around the limitations in ChonksMain's ChonkMakeover function, primarily `equipMany` not being able to be called with a zero tokenId to unequip.
/// @dev If you wish to keep the same Trait equipped, make sure you send that data in the `data` parameter since it first unequips all Traits.
contract ChonkMakeover {

    IChonksMain public immutable chonksMain = IChonksMain(0x07152bfde079b5319e5308C43fB1Dbc9C76cb4F9);

    function onERC721Received(
        address,
        address from,
        uint256 tokenId,
        bytes memory data
    ) public virtual returns (bytes4) {
        (
            uint256[] memory traitTokenIds,
            uint8[] memory traitCategories,
            uint8 bodyIndex,
            string memory backgroundColor,
            bool render3D
        ) = abi.decode(data, (uint256[], uint8[], uint8, string, bool));

        // Unequip all Traits
        chonksMain.unequipAll(tokenId);

        // Change the look of the chonk
        chonksMain.chonkMakeover(tokenId, traitTokenIds, traitCategories, bodyIndex, backgroundColor, render3D);

        // Transfer it back to the original owner
        chonksMain.transferFrom(address(this), from, tokenId);

        return this.onERC721Received.selector;
    }

}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "solady/=lib/solady/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "scripty/=lib/scripty/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"chonksMain","outputs":[{"internalType":"contract IChonksMain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"}]

60a06040527307152bfde079b5319e5308c43fb1dbc9c76cb4f960805234801561002857600080fd5b506080516106ef6100576000396000818160710152818160d401528181610167015261020401526106ef6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063150b7a021461003b578063ba7270f31461006c575b600080fd5b61004e610049366004610303565b6100ab565b6040516001600160e01b031990911681526020015b60405180910390f35b6100937f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610063565b600080600080600080868060200190518101906100c891906104d5565b945094509450945094507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633044825b896040518263ffffffff1660e01b815260040161012091815260200190565b600060405180830381600087803b15801561013a57600080fd5b505af115801561014e573d6000803e3d6000fd5b505060405163f40bdd2560e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016925063f40bdd2591506101a8908b9089908990899089908990600401610603565b600060405180830381600087803b1580156101c257600080fd5b505af11580156101d6573d6000803e3d6000fd5b50506040516323b872dd60e01b81523060048201526001600160a01b038c81166024830152604482018c90527f00000000000000000000000000000000000000000000000000000000000000001692506323b872dd9150606401600060405180830381600087803b15801561024a57600080fd5b505af115801561025e573d6000803e3d6000fd5b50630a85bd0160e11b9d9c50505050505050505050505050565b80356001600160a01b038116811461028f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156102d3576102d3610294565b604052919050565b600067ffffffffffffffff8211156102f5576102f5610294565b50601f01601f191660200190565b6000806000806080858703121561031957600080fd5b61032285610278565b935061033060208601610278565b925060408501359150606085013567ffffffffffffffff81111561035357600080fd5b8501601f8101871361036457600080fd5b8035610377610372826102db565b6102aa565b81815288602083850101111561038c57600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600067ffffffffffffffff8211156103c8576103c8610294565b5060051b60200190565b805160ff8116811461028f57600080fd5b600082601f8301126103f457600080fd5b81516020610404610372836103ae565b8083825260208201915060208460051b87010193508684111561042657600080fd5b602086015b848110156104495761043c816103d2565b835291830191830161042b565b509695505050505050565b60005b8381101561046f578181015183820152602001610457565b50506000910152565b600082601f83011261048957600080fd5b8151610497610372826102db565b8181528460208386010111156104ac57600080fd5b6104bd826020830160208701610454565b949350505050565b8051801515811461028f57600080fd5b600080600080600060a086880312156104ed57600080fd5b855167ffffffffffffffff8082111561050557600080fd5b818801915088601f83011261051957600080fd5b81516020610529610372836103ae565b82815260059290921b8401810191818101908c84111561054857600080fd5b948201945b838610156105665785518252948201949082019061054d565b918b015191995090935050508082111561057f57600080fd5b61058b89838a016103e3565b9550610599604089016103d2565b945060608801519150808211156105af57600080fd5b506105bc88828901610478565b9250506105cb608087016104c5565b90509295509295909350565b600081518084526105ef816020860160208601610454565b601f01601f19169290920160200192915050565b600060c08201888352602060c08185015281895180845260e086019150828b01935060005b8181101561064457845183529383019391830191600101610628565b50508481036040860152885180825290820192508189019060005b8181101561067e57825160ff168552938301939183019160010161065f565b50505060ff8716606085015250828103608084015261069d81866105d7565b9150506106ae60a083018415159052565b97965050505050505056fea264697066735822122045672c850f74b7cd165b9bab461398e285e9ccf658fb0379e90c3792b3d1891c64736f6c63430008160033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063150b7a021461003b578063ba7270f31461006c575b600080fd5b61004e610049366004610303565b6100ab565b6040516001600160e01b031990911681526020015b60405180910390f35b6100937f00000000000000000000000007152bfde079b5319e5308c43fb1dbc9c76cb4f981565b6040516001600160a01b039091168152602001610063565b600080600080600080868060200190518101906100c891906104d5565b945094509450945094507f00000000000000000000000007152bfde079b5319e5308c43fb1dbc9c76cb4f96001600160a01b0316633044825b896040518263ffffffff1660e01b815260040161012091815260200190565b600060405180830381600087803b15801561013a57600080fd5b505af115801561014e573d6000803e3d6000fd5b505060405163f40bdd2560e01b81526001600160a01b037f00000000000000000000000007152bfde079b5319e5308c43fb1dbc9c76cb4f916925063f40bdd2591506101a8908b9089908990899089908990600401610603565b600060405180830381600087803b1580156101c257600080fd5b505af11580156101d6573d6000803e3d6000fd5b50506040516323b872dd60e01b81523060048201526001600160a01b038c81166024830152604482018c90527f00000000000000000000000007152bfde079b5319e5308c43fb1dbc9c76cb4f91692506323b872dd9150606401600060405180830381600087803b15801561024a57600080fd5b505af115801561025e573d6000803e3d6000fd5b50630a85bd0160e11b9d9c50505050505050505050505050565b80356001600160a01b038116811461028f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156102d3576102d3610294565b604052919050565b600067ffffffffffffffff8211156102f5576102f5610294565b50601f01601f191660200190565b6000806000806080858703121561031957600080fd5b61032285610278565b935061033060208601610278565b925060408501359150606085013567ffffffffffffffff81111561035357600080fd5b8501601f8101871361036457600080fd5b8035610377610372826102db565b6102aa565b81815288602083850101111561038c57600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600067ffffffffffffffff8211156103c8576103c8610294565b5060051b60200190565b805160ff8116811461028f57600080fd5b600082601f8301126103f457600080fd5b81516020610404610372836103ae565b8083825260208201915060208460051b87010193508684111561042657600080fd5b602086015b848110156104495761043c816103d2565b835291830191830161042b565b509695505050505050565b60005b8381101561046f578181015183820152602001610457565b50506000910152565b600082601f83011261048957600080fd5b8151610497610372826102db565b8181528460208386010111156104ac57600080fd5b6104bd826020830160208701610454565b949350505050565b8051801515811461028f57600080fd5b600080600080600060a086880312156104ed57600080fd5b855167ffffffffffffffff8082111561050557600080fd5b818801915088601f83011261051957600080fd5b81516020610529610372836103ae565b82815260059290921b8401810191818101908c84111561054857600080fd5b948201945b838610156105665785518252948201949082019061054d565b918b015191995090935050508082111561057f57600080fd5b61058b89838a016103e3565b9550610599604089016103d2565b945060608801519150808211156105af57600080fd5b506105bc88828901610478565b9250506105cb608087016104c5565b90509295509295909350565b600081518084526105ef816020860160208601610454565b601f01601f19169290920160200192915050565b600060c08201888352602060c08185015281895180845260e086019150828b01935060005b8181101561064457845183529383019391830191600101610628565b50508481036040860152885180825290820192508189019060005b8181101561067e57825160ff168552938301939183019160010161065f565b50505060ff8716606085015250828103608084015261069d81866105d7565b9150506106ae60a083018415159052565b97965050505050505056fea264697066735822122045672c850f74b7cd165b9bab461398e285e9ccf658fb0379e90c3792b3d1891c64736f6c63430008160033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.