FTM Testnet

Contract

0x71D6374761Dcb3e331Ee08051998A0A958438571

Overview

FTM Balance

Fantom LogoFantom LogoFantom Logo0 FTM

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value

There are no matching entries

Please try again later

Latest 1 internal transaction

Parent Transaction Hash Block From To Value
240439242024-02-01 13:58:06106 days ago1706795886  Contract Creation0 FTM
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xff895d8c...7fbFcAf21
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
TokenManagerProxy

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 1000 runs

Other Settings:
london EvmVersion, MIT license
/**
 *Submitted for verification at testnet.ftmscan.com on 2024-01-08
*/

// Source: contracts/proxies/TokenManagerProxy.sol

pragma solidity 0.8.21;

// SPDX-License-Identifier: MIT

// File @axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/[email protected]

// General interface for upgradable contracts
interface IProxy {
    error InvalidOwner();
    error InvalidImplementation();
    error SetupFailed();
    error NotOwner();
    error AlreadyInitialized();

    function implementation() external view returns (address);

    function setup(bytes calldata setupParams) external;
}

// File @axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/[email protected]

/**
 * @title BaseProxy Contract
 * @dev This abstract contract implements a basic proxy that stores an implementation address. Fallback function
 * calls are delegated to the implementation. This contract is meant to be inherited by other proxy contracts.
 */
abstract contract BaseProxy is IProxy {
    // bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
    // keccak256('owner')
    bytes32 internal constant _OWNER_SLOT = 0x02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c0;

    /**
     * @dev Returns the current implementation address.
     * @return implementation_ The address of the current implementation contract
     */
    function implementation() public view virtual returns (address implementation_) {
        assembly {
            implementation_ := sload(_IMPLEMENTATION_SLOT)
        }
    }

    /**
     * @dev Shadows the setup function of the implementation contract so it can't be called directly via the proxy.
     * @param params The setup parameters for the implementation contract.
     */
    function setup(bytes calldata params) external {}

    /**
     * @dev Returns the contract ID. It can be used as a check during upgrades. Meant to be implemented in derived contracts.
     * @return bytes32 The contract ID
     */
    function contractId() internal pure virtual returns (bytes32);

    /**
     * @dev Fallback function. Delegates the call to the current implementation contract.
     */
    fallback() external payable virtual {
        address implementation_ = implementation();
        assembly {
            calldatacopy(0, 0, calldatasize())

            let result := delegatecall(gas(), implementation_, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())

            switch result
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev Payable fallback function. Can be overridden in derived contracts.
     */
    receive() external payable virtual {}
}

// File contracts/interfaces/ITokenManagerProxy.sol

/**
 * @title ITokenManagerProxy Interface
 * @notice This interface is for a proxy for token manager contracts.
 */
interface ITokenManagerProxy is IProxy {
    error ZeroAddress();

    /**
     * @notice Returns implementation type of this token manager.
     * @return uint256 The implementation type of this token manager.
     */
    function implementationType() external view returns (uint256);

    /**
     * @notice Returns the interchain token ID of the token manager.
     * @return bytes32 The interchain token ID of the token manager.
     */
    function interchainTokenId() external view returns (bytes32);

    /**
     * @notice Returns token address that this token manager manages.
     * @return address The token address.
     */
    function tokenAddress() external view returns (address);

    /**
     * @notice Returns implementation type and token address.
     * @return uint256 The implementation type.
     * @return address The token address.
     */
    function getImplementationTypeAndTokenAddress() external view returns (uint256, address);
}

// File contracts/interfaces/IBaseTokenManager.sol

/**
 * @title IBaseTokenManager
 * @notice This contract is defines the base token manager interface implemented by all token managers.
 */
interface IBaseTokenManager {
    /**
     * @notice A function that returns the token id.
     */
    function interchainTokenId() external view returns (bytes32);

    /**
     * @notice A function that should return the address of the token.
     * Must be overridden in the inheriting contract.
     * @return address address of the token.
     */
    function tokenAddress() external view returns (address);

    /**
     * @notice A function that should return the token address from the init params.
     */
    function getTokenAddressFromParams(bytes calldata params) external pure returns (address);
}

// File contracts/interfaces/ITokenManagerImplementation.sol

/**
 * @title ITokenManagerImplementation Interface
 * @notice Interface for returning the token manager implementation type.
 */
interface ITokenManagerImplementation {
    /**
     * @notice Returns the implementation address for a given token manager type.
     * @param tokenManagerType The type of token manager.
     * @return tokenManagerAddress_ The address of the token manager implementation.
     */
    function tokenManagerImplementation(uint256 tokenManagerType) external view returns (address tokenManagerAddress_);
}

// File contracts/proxies/TokenManagerProxy.sol

/**
 * @title TokenManagerProxy
 * @notice This contract is a proxy for token manager contracts.
 * @dev This contract implements BaseProxy and ITokenManagerProxy.
 */
contract TokenManagerProxy is BaseProxy, ITokenManagerProxy {
    bytes32 private constant CONTRACT_ID = keccak256('token-manager');

    address public immutable interchainTokenService;
    uint256 public immutable implementationType;
    bytes32 public immutable interchainTokenId;
    address public immutable tokenAddress;

    /**
     * @notice Constructs the TokenManagerProxy contract.
     * @param interchainTokenService_ The address of the interchain token service.
     * @param implementationType_ The token manager type.
     * @param tokenId The identifier for the token.
     * @param params The initialization parameters for the token manager contract.
     */
    constructor(address interchainTokenService_, uint256 implementationType_, bytes32 tokenId, bytes memory params) {
        if (interchainTokenService_ == address(0)) revert ZeroAddress();

        interchainTokenService = interchainTokenService_;
        implementationType = implementationType_;
        interchainTokenId = tokenId;

        address implementation_ = _tokenManagerImplementation(interchainTokenService_, implementationType_);
        if (implementation_ == address(0)) revert InvalidImplementation();

        (bool success, ) = implementation_.delegatecall(abi.encodeWithSelector(IProxy.setup.selector, params));
        if (!success) revert SetupFailed();

        tokenAddress = IBaseTokenManager(implementation_).getTokenAddressFromParams(params);
    }

    /**
     * @notice Getter for the contract id.
     * @return bytes32 The contract id.
     */
    function contractId() internal pure override returns (bytes32) {
        return CONTRACT_ID;
    }

    /**
     * @notice Returns implementation type and token address.
     * @return implementationType_ The implementation type.
     * @return tokenAddress_ The token address.
     */
    function getImplementationTypeAndTokenAddress() external view returns (uint256 implementationType_, address tokenAddress_) {
        implementationType_ = implementationType;
        tokenAddress_ = tokenAddress;
    }

    /**
     * @notice Returns the address of the current implementation.
     * @return implementation_ The address of the current implementation.
     */
    function implementation() public view override(BaseProxy, IProxy) returns (address implementation_) {
        implementation_ = _tokenManagerImplementation(interchainTokenService, implementationType);
    }

    /**
     * @notice Returns the implementation address from the interchain token service for the provided type.
     * @param interchainTokenService_ The address of the interchain token service.
     * @param implementationType_ The token manager type.
     * @return implementation_ The address of the implementation.
     */
    function _tokenManagerImplementation(
        address interchainTokenService_,
        uint256 implementationType_
    ) internal view returns (address implementation_) {
        implementation_ = ITokenManagerImplementation(interchainTokenService_).tokenManagerImplementation(implementationType_);
    }
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"interchainTokenService_","type":"address"},{"internalType":"uint256","name":"implementationType_","type":"uint256"},{"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"internalType":"bytes","name":"params","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"InvalidImplementation","type":"error"},{"inputs":[],"name":"InvalidOwner","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"SetupFailed","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"getImplementationTypeAndTokenAddress","outputs":[{"internalType":"uint256","name":"implementationType_","type":"uint256"},{"internalType":"address","name":"tokenAddress_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"implementation_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementationType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interchainTokenId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interchainTokenService","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"params","type":"bytes"}],"name":"setup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

Deployed Bytecode

0x6080604052600436106100745760003560e01c80635c60da1b1161004e5780635c60da1b146101815780639d76ea58146101965780639ded06df146101ca578063d4ae3c42146101e95761007b565b806309c6bed9146100ad578063129d81881461010b5780634fdf7cb51461014d5761007b565b3661007b57005b600061008561025f565b90503660008037600080366000845af43d6000803e8080156100a6573d6000f35b3d6000fd5b005b3480156100b957600080fd5b506100e17f000000000000000000000000b5fb4be02232b1bba4dc8f81dc24c26980de9e3c81565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561011757600080fd5b5061013f7ff60cd19fca372e0351a2619fe63435203a8699105c84850681b4aabbd3d9f6e081565b604051908152602001610102565b34801561015957600080fd5b5061013f7f000000000000000000000000000000000000000000000000000000000000000081565b34801561018d57600080fd5b506100e161025f565b3480156101a257600080fd5b506100e17f0000000000000000000000006b9ee4ae432ffe426491fea0032ae350fd9ffe8581565b3480156101d657600080fd5b506100ab6101e5366004610349565b5050565b3480156101f557600080fd5b50604080517f0000000000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000006b9ee4ae432ffe426491fea0032ae350fd9ffe8516602082015201610102565b60006102ab7f000000000000000000000000b5fb4be02232b1bba4dc8f81dc24c26980de9e3c7f00000000000000000000000000000000000000000000000000000000000000006102b0565b905090565b6040517f7e151fa60000000000000000000000000000000000000000000000000000000081526004810182905260009073ffffffffffffffffffffffffffffffffffffffff841690637e151fa690602401602060405180830381865afa15801561031e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034291906103bb565b9392505050565b6000806020838503121561035c57600080fd5b823567ffffffffffffffff8082111561037457600080fd5b818501915085601f83011261038857600080fd5b81358181111561039757600080fd5b8660208285010111156103a957600080fd5b60209290920196919550909350505050565b6000602082840312156103cd57600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461034257600080fdfea2646970667358221220d011ec6a9d8ff1de78334122dc7f461e39a52c3c3e3116b86bd148633a67d06664736f6c63430008150033

Deployed Bytecode Sourcemap

5762:3148:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2313:23;2339:16;:14;:16::i;:::-;2313:42;;2409:14;2406:1;2403;2390:34;2513:1;2510;2494:14;2491:1;2474:15;2467:5;2454:61;2550:16;2547:1;2544;2529:38;2590:6;2610:68;;;;2729:16;2726:1;2719:27;2610:68;2646:16;2643:1;2636:27;2583:178;;5903:47;;;;;;;;;;;;;;;;;;190:42:1;178:55;;;160:74;;148:2;133:18;5903:47:0;;;;;;;;6007:42;;;;;;;;;;;;;;;;;;391:25:1;;;379:2;364:18;6007:42:0;245:177:1;5957:43:0;;;;;;;;;;;;;;;8046:208;;;;;;;;;;;;;:::i;6056:37::-;;;;;;;;;;;;;;;1845:49;;;;;;;;;;-1:-1:-1;1845:49:0;;;;;:::i;:::-;;;;7657:221;;;;;;;;;;-1:-1:-1;7657:221:0;;;7813:18;1379:25:1;;1452:42;7858:12:0;1440:55:1;1435:2;1420:18;;1413:83;1352:18;7657:221:0;1205:297:1;8046:208:0;8121:23;8175:71;8203:22;8227:18;8175:27;:71::i;:::-;8157:89;;8046:208;:::o;8598:309::-;8799:100;;;;;;;;391:25:1;;;8745:23:0;;8799:79;;;;;;364:18:1;;8799:100:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;8781:118;8598:309;-1:-1:-1;;;8598:309:0:o;609:591:1:-;679:6;687;740:2;728:9;719:7;715:23;711:32;708:52;;;756:1;753;746:12;708:52;796:9;783:23;825:18;866:2;858:6;855:14;852:34;;;882:1;879;872:12;852:34;920:6;909:9;905:22;895:32;;965:7;958:4;954:2;950:13;946:27;936:55;;987:1;984;977:12;936:55;1027:2;1014:16;1053:2;1045:6;1042:14;1039:34;;;1069:1;1066;1059:12;1039:34;1114:7;1109:2;1100:6;1096:2;1092:15;1088:24;1085:37;1082:57;;;1135:1;1132;1125:12;1082:57;1166:2;1158:11;;;;;1188:6;;-1:-1:-1;609:591:1;;-1:-1:-1;;;;609:591:1:o;1507:313::-;1577:6;1630:2;1618:9;1609:7;1605:23;1601:32;1598:52;;;1646:1;1643;1636:12;1598:52;1678:9;1672:16;1728:42;1721:5;1717:54;1710:5;1707:65;1697:93;;1786:1;1783;1776:12

Swarm Source

ipfs://d011ec6a9d8ff1de78334122dc7f461e39a52c3c3e3116b86bd148633a67d066

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
[ 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.