Sepolia Testnet

Contract

0xfEDB3BeEc7283c93d12C3b56f70C39AbAD776831

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Set Associated C...54873712024-03-14 23:58:1296 days ago1710460692IN
0xfEDB3BeE...bAD776831
0 ETH0.000037351.24916057
Set Balance Of54873702024-03-14 23:58:0096 days ago1710460680IN
0xfEDB3BeE...bAD776831
0 ETH0.000059151.27904789
0x6080604054871942024-03-14 23:20:3696 days ago1710458436IN
 Create: LegacyTokenState
0 ETH0.000044830.13077884

Advanced mode:
Parent Transaction Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LegacyTokenState

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2024-03-15
*/

/*
   ____            __   __        __   _
  / __/__ __ ___  / /_ / /  ___  / /_ (_)__ __
 _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
     /___/

* Synthetix: legacy/LegacyTokenState.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/legacy/LegacyTokenState.sol
* Docs: https://docs.synthetix.io/contracts/legacy/LegacyTokenState
*
* Contract Dependencies: 
*	- LegacyOwned
* Libraries: (none)
*
* MIT License
* ===========
*
* Copyright (c) 2024 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/



pragma solidity ^0.5.16;

contract LegacyOwned {
    address public owner;
    address public nominatedOwner;

    constructor(address _owner) public {
        owner = _owner;
    }

    function nominateOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner);
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}


contract LegacyTokenState is LegacyOwned {
    // the address of the contract that can modify balances and allowances
    // this can only be changed by the owner of this contract
    address public associatedContract;

    // ERC20 fields.
    mapping(address => uint) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    constructor(address _owner, address _associatedContract) public LegacyOwned(_owner) {
        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

    /* ========== SETTERS ========== */

    // Change the associated contract to a new address
    function setAssociatedContract(address _associatedContract) external onlyOwner {
        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

    function setAllowance(
        address tokenOwner,
        address spender,
        uint value
    ) external onlyAssociatedContract {
        allowance[tokenOwner][spender] = value;
    }

    function setBalanceOf(address account, uint value) external onlyAssociatedContract {
        balanceOf[account] = value;
    }

    /* ========== MODIFIERS ========== */

    modifier onlyAssociatedContract {
        require(msg.sender == associatedContract);
        _;
    }

    /* ========== EVENTS ========== */

    event AssociatedContractUpdated(address _associatedContract);
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_associatedContract","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_associatedContract","type":"address"}],"name":"AssociatedContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"associatedContract","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenOwner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setAllowance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_associatedContract","type":"address"}],"name":"setAssociatedContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setBalanceOf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161050e38038061050e8339818101604052604081101561003357600080fd5b508051602091820151600080546001600160a01b038085166001600160a01b0319928316179092556002805492841692909116821790556040805191825251929391927f73f20cff579e8a4086fa607db83867595f1b6a798e718c0bfa0b94a404128e03929181900390910190a1505061045c806100b26000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b14610155578063aefc4ccb1461015d578063b46310f614610165578063da46098c14610191578063dd62ed3e146101c75761009e565b806352f445ca146100a357806353a47bb7146100cb5780635b94db27146100ef57806370a082311461011557806379ba50971461014d575b600080fd5b6100c9600480360360208110156100b957600080fd5b50356001600160a01b03166101f5565b005b6100d3610260565b604080516001600160a01b039092168252519081900360200190f35b6100c96004803603602081101561010557600080fd5b50356001600160a01b031661026f565b61013b6004803603602081101561012b57600080fd5b50356001600160a01b03166102da565b60408051918252519081900360200190f35b6100c96102ec565b6100d3610376565b6100d3610385565b6100c96004803603604081101561017b57600080fd5b506001600160a01b038135169060200135610394565b6100c9600480360360608110156101a757600080fd5b506001600160a01b038135811691602081013590911690604001356103c7565b61013b600480360360408110156101dd57600080fd5b506001600160a01b038135811691602001351661040a565b6000546001600160a01b0316331461020c57600080fd5b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f73f20cff579e8a4086fa607db83867595f1b6a798e718c0bfa0b94a404128e039181900360200190a150565b6001546001600160a01b031681565b6000546001600160a01b0316331461028657600080fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60036020526000908152604090205481565b6001546001600160a01b0316331461030357600080fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031681565b6002546001600160a01b031681565b6002546001600160a01b031633146103ab57600080fd5b6001600160a01b03909116600090815260036020526040902055565b6002546001600160a01b031633146103de57600080fd5b6001600160a01b0392831660009081526004602090815260408083209490951682529290925291902055565b60046020908152600092835260408084209091529082529020548156fea265627a7a723158204d45d621e7fb068ff826044cd07cd4fc88976e9683de143e64f4b68c051e7fb364736f6c6343000510003200000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b14610155578063aefc4ccb1461015d578063b46310f614610165578063da46098c14610191578063dd62ed3e146101c75761009e565b806352f445ca146100a357806353a47bb7146100cb5780635b94db27146100ef57806370a082311461011557806379ba50971461014d575b600080fd5b6100c9600480360360208110156100b957600080fd5b50356001600160a01b03166101f5565b005b6100d3610260565b604080516001600160a01b039092168252519081900360200190f35b6100c96004803603602081101561010557600080fd5b50356001600160a01b031661026f565b61013b6004803603602081101561012b57600080fd5b50356001600160a01b03166102da565b60408051918252519081900360200190f35b6100c96102ec565b6100d3610376565b6100d3610385565b6100c96004803603604081101561017b57600080fd5b506001600160a01b038135169060200135610394565b6100c9600480360360608110156101a757600080fd5b506001600160a01b038135811691602081013590911690604001356103c7565b61013b600480360360408110156101dd57600080fd5b506001600160a01b038135811691602001351661040a565b6000546001600160a01b0316331461020c57600080fd5b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f73f20cff579e8a4086fa607db83867595f1b6a798e718c0bfa0b94a404128e039181900360200190a150565b6001546001600160a01b031681565b6000546001600160a01b0316331461028657600080fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60036020526000908152604090205481565b6001546001600160a01b0316331461030357600080fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031681565b6002546001600160a01b031681565b6002546001600160a01b031633146103ab57600080fd5b6001600160a01b03909116600090815260036020526040902055565b6002546001600160a01b031633146103de57600080fd5b6001600160a01b0392831660009081526004602090815260408083209490951682529290925291902055565b60046020908152600092835260408084209091529082529020548156fea265627a7a723158204d45d621e7fb068ff826044cd07cd4fc88976e9683de143e64f4b68c051e7fb364736f6c63430005100032

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9

-----Decoded View---------------
Arg [0] : _owner (address): 0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9
Arg [1] : _associatedContract (address): 0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9
Arg [1] : 00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
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.