ETH Price: $2,686.79 (+2.61%)

Contract

0xeaE9B3ce4FA9f4E2a84CB434579a6768dAB81A3c
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Candidate135745342021-11-08 7:41:001193 days ago1636357260IN
0xeaE9B3ce...8dAB81A3c
0 ETH0.00498876105.58016401
Set Uint114944542020-12-21 4:12:521515 days ago1608523972IN
0xeaE9B3ce...8dAB81A3c
0 ETH0.0020457246.5

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LnConfig

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 999999 runs

Other Settings:
istanbul EvmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2020-12-21
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

contract LnAdmin {
    address public admin;
    address public candidate;

    constructor(address _admin) public {
        require(_admin != address(0), "admin address cannot be 0");
        admin = _admin;
        emit AdminChanged(address(0), _admin);
    }

    function setCandidate(address _candidate) external onlyAdmin {
        address old = candidate;
        candidate = _candidate;
        emit CandidateChanged(old, candidate);
    }

    function becomeAdmin() external {
        require(msg.sender == candidate, "Only candidate can become admin");
        address old = admin;
        admin = candidate;
        emit AdminChanged(old, admin);
    }

    modifier onlyAdmin {
        require((msg.sender == admin), "Only the contract admin can perform this action");
        _;
    }

    event CandidateChanged(address oldCandidate, address newCandidate);
    event AdminChanged(address oldAdmin, address newAdmin);
}

contract LnConfig is LnAdmin {
    mapping(bytes32 => uint) internal mUintConfig;

    constructor(address _admin) public LnAdmin(_admin) {}

    //some configue keys
    bytes32 public constant BUILD_RATIO = "BuildRatio"; // percent, base 10e18

    function getUint(bytes32 key) external view returns (uint) {
        return mUintConfig[key];
    }

    function setUint(bytes32 key, uint value) external onlyAdmin {
        mUintConfig[key] = value;
        emit SetUintConfig(key, value);
    }

    function deleteUint(bytes32 key) external onlyAdmin {
        delete mUintConfig[key];
        emit SetUintConfig(key, 0);
    }

    function batchSet(bytes32[] calldata names, uint[] calldata values) external onlyAdmin {
        require(names.length == values.length, "Input lengths must match");

        for (uint i = 0; i < names.length; i++) {
            mUintConfig[names[i]] = values[i];
            emit SetUintConfig(names[i], values[i]);
        }
    }

    event SetUintConfig(bytes32 key, uint value);
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldCandidate","type":"address"},{"indexed":false,"internalType":"address","name":"newCandidate","type":"address"}],"name":"CandidateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"key","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"SetUintConfig","type":"event"},{"inputs":[],"name":"BUILD_RATIO","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"names","type":"bytes32[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"batchSet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"becomeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"candidate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"deleteUint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"getUint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_candidate","type":"address"}],"name":"setCandidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setUint","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161093e38038061093e8339818101604052602081101561003357600080fd5b5051806001600160a01b038116610091576040805162461bcd60e51b815260206004820152601960248201527f61646d696e20616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f9281900390910190a15050610844806100fa6000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80636c8381f811610076578063e2a4853a1161005b578063e2a4853a1461020f578063e2b202bf14610232578063f851a4401461024f576100a3565b80636c8381f8146101c1578063bd02d0f5146101f2576100a3565b806307880b7f146100a857806325971dff146100dd5780634d6daf04146100e557806362b12feb146100ff575b600080fd5b6100db600480360360208110156100be57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610257565b005b6100db61034e565b6100ed61045d565b60408051918252519081900360200190f35b6100db6004803603604081101561011557600080fd5b81019060208101813564010000000081111561013057600080fd5b82018360208201111561014257600080fd5b8035906020019184602083028401116401000000008311171561016457600080fd5b91939092909160208101903564010000000081111561018257600080fd5b82018360208201111561019457600080fd5b803590602001918460208302840111640100000000831117156101b657600080fd5b509092509050610481565b6101c9610614565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100ed6004803603602081101561020857600080fd5b5035610630565b6100db6004803603604081101561022557600080fd5b5080359060200135610642565b6100db6004803603602081101561024857600080fd5b5035610703565b6101c96107c3565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806107e0602f913960400191505060405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831617928390556040805192821680845293909116602083015280517f7f730391c4f0fa1bea34bcb9bff8c30a079b21a0359759160cb990648ab84c729281900390910190a15050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146103d457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f6e6c792063616e6469646174652063616e206265636f6d652061646d696e00604482015290519081900360640190fd5b600080546001547fffffffffffffffffffffffff0000000000000000000000000000000000000000821673ffffffffffffffffffffffffffffffffffffffff91821617928390556040805192821680845293909116602083015280517f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f9281900390910190a150565b7f4275696c64526174696f0000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806107e0602f913960400191505060405180910390fd5b82811461055f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e707574206c656e67746873206d757374206d617463680000000000000000604482015290519081900360640190fd5b60005b8381101561060d5782828281811061057657fe5b905060200201356002600087878581811061058d57fe5b905060200201358152602001908152602001600020819055507f7a94ff4a6f535d3c32d95ee8133406802cfc54b8a1e2b2221bc78df903b40c258585838181106105d357fe5b905060200201358484848181106105e657fe5b604080519485526020918202939093013590840152508051918290030190a1600101610562565b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60009081526002602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806107e0602f913960400191505060405180910390fd5b600082815260026020908152604091829020839055815184815290810183905281517f7a94ff4a6f535d3c32d95ee8133406802cfc54b8a1e2b2221bc78df903b40c25929181900390910190a15050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806107e0602f913960400191505060405180910390fd5b600081815260026020908152604080832083905580518481529182019290925281517f7a94ff4a6f535d3c32d95ee8133406802cfc54b8a1e2b2221bc78df903b40c25929181900390910190a150565b60005473ffffffffffffffffffffffffffffffffffffffff168156fe4f6e6c792074686520636f6e74726163742061646d696e2063616e20706572666f726d207468697320616374696f6ea264697066735822122095956ffad9c067082ab8041d65e077f7f2ac15011de783ae3dbb1ce8982b35b264736f6c634300060c00330000000000000000000000009ffde95ad5f740fb7843a420b2432f77641e28e8

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a35760003560e01c80636c8381f811610076578063e2a4853a1161005b578063e2a4853a1461020f578063e2b202bf14610232578063f851a4401461024f576100a3565b80636c8381f8146101c1578063bd02d0f5146101f2576100a3565b806307880b7f146100a857806325971dff146100dd5780634d6daf04146100e557806362b12feb146100ff575b600080fd5b6100db600480360360208110156100be57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610257565b005b6100db61034e565b6100ed61045d565b60408051918252519081900360200190f35b6100db6004803603604081101561011557600080fd5b81019060208101813564010000000081111561013057600080fd5b82018360208201111561014257600080fd5b8035906020019184602083028401116401000000008311171561016457600080fd5b91939092909160208101903564010000000081111561018257600080fd5b82018360208201111561019457600080fd5b803590602001918460208302840111640100000000831117156101b657600080fd5b509092509050610481565b6101c9610614565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100ed6004803603602081101561020857600080fd5b5035610630565b6100db6004803603604081101561022557600080fd5b5080359060200135610642565b6100db6004803603602081101561024857600080fd5b5035610703565b6101c96107c3565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806107e0602f913960400191505060405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831617928390556040805192821680845293909116602083015280517f7f730391c4f0fa1bea34bcb9bff8c30a079b21a0359759160cb990648ab84c729281900390910190a15050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146103d457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f6e6c792063616e6469646174652063616e206265636f6d652061646d696e00604482015290519081900360640190fd5b600080546001547fffffffffffffffffffffffff0000000000000000000000000000000000000000821673ffffffffffffffffffffffffffffffffffffffff91821617928390556040805192821680845293909116602083015280517f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f9281900390910190a150565b7f4275696c64526174696f0000000000000000000000000000000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806107e0602f913960400191505060405180910390fd5b82811461055f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e707574206c656e67746873206d757374206d617463680000000000000000604482015290519081900360640190fd5b60005b8381101561060d5782828281811061057657fe5b905060200201356002600087878581811061058d57fe5b905060200201358152602001908152602001600020819055507f7a94ff4a6f535d3c32d95ee8133406802cfc54b8a1e2b2221bc78df903b40c258585838181106105d357fe5b905060200201358484848181106105e657fe5b604080519485526020918202939093013590840152508051918290030190a1600101610562565b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60009081526002602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806107e0602f913960400191505060405180910390fd5b600082815260026020908152604091829020839055815184815290810183905281517f7a94ff4a6f535d3c32d95ee8133406802cfc54b8a1e2b2221bc78df903b40c25929181900390910190a15050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806107e0602f913960400191505060405180910390fd5b600081815260026020908152604080832083905580518481529182019290925281517f7a94ff4a6f535d3c32d95ee8133406802cfc54b8a1e2b2221bc78df903b40c25929181900390910190a150565b60005473ffffffffffffffffffffffffffffffffffffffff168156fe4f6e6c792074686520636f6e74726163742061646d696e2063616e20706572666f726d207468697320616374696f6ea264697066735822122095956ffad9c067082ab8041d65e077f7f2ac15011de783ae3dbb1ce8982b35b264736f6c634300060c0033

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

0000000000000000000000009ffde95ad5f740fb7843a420b2432f77641e28e8

-----Decoded View---------------
Arg [0] : _admin (address): 0x9FfDe95AD5f740fb7843A420B2432F77641e28E8

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000009ffde95ad5f740fb7843a420b2432f77641e28e8


Deployed Bytecode Sourcemap

1028:1054:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;338:184;;;;;;;;;;;;;;;;-1:-1:-1;338:184:0;;;;:::i;:::-;;530:216;;;:::i;1205:50::-;;;:::i;:::-;;;;;;;;;;;;;;;;1688:338;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1688:338:0;;-1:-1:-1;1688:338:0;-1:-1:-1;1688:338:0;:::i;112:24::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1287:101;;;;;;;;;;;;;;;;-1:-1:-1;1287:101:0;;:::i;1396:145::-;;;;;;;;;;;;;;;;-1:-1:-1;1396:145:0;;;;;;;:::i;1549:131::-;;;;;;;;;;;;;;;;-1:-1:-1;1549:131:0;;:::i;85:20::-;;;:::i;338:184::-;807:5;;;;793:10;:19;784:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;424:9:::1;::::0;;::::1;444:22:::0;;::::1;::::0;;::::1;;::::0;;;;482:32:::1;::::0;;424:9;;::::1;482:32:::0;;;504:9;;;::::1;482:32;::::0;::::1;::::0;;;::::1;::::0;;;;;;;;::::1;876:1;338:184:::0;:::o;530:216::-;595:9;;;;581:10;:23;573:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;651:11;665:5;;;689:9;681:17;;;665:5;689:9;;;681:17;;;;;714:24;;;665:5;;;714:24;;;732:5;;;;714:24;;;;;;;;;;;;;;;;530:216;:::o;1205:50::-;;;:::o;1688:338::-;807:5;;;;793:10;:19;784:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1794:29;;::::1;1786:66;;;::::0;;::::1;::::0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;1870:6;1865:154;1882:16:::0;;::::1;1865:154;;;1944:6;;1951:1;1944:9;;;;;;;;;;;;;1920:11;:21;1932:5;;1938:1;1932:8;;;;;;;;;;;;;1920:21;;;;;;;;;;;:33;;;;1973:34;1987:5;;1993:1;1987:8;;;;;;;;;;;;;1997:6;;2004:1;1997:9;;;;;;;1973:34;::::0;;;;;1997:9:::1;::::0;;::::1;::::0;;;::::1;;1973:34:::0;;::::1;::::0;-1:-1:-1;1973:34:0;;;;;;;;::::1;1900:3;;1865:154;;;;1688:338:::0;;;;:::o;112:24::-;;;;;;:::o;1287:101::-;1340:4;1364:16;;;:11;:16;;;;;;;1287:101::o;1396:145::-;807:5;;;;793:10;:19;784:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1468:16:::1;::::0;;;:11:::1;:16;::::0;;;;;;;;:24;;;1508:25;;;;;;;::::1;::::0;;;;;::::1;::::0;;;;;;;;;::::1;1396:145:::0;;:::o;1549:131::-;807:5;;;;793:10;:19;784:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1619:16:::1;::::0;;;:11:::1;:16;::::0;;;;;;;1612:23;;;1651:21;;;;;;;::::1;::::0;;;;;;::::1;::::0;;;;;;;;;::::1;1549:131:::0;:::o;85:20::-;;;;;;:::o

Swarm Source

ipfs://95956ffad9c067082ab8041d65e077f7f2ac15011de783ae3dbb1ce8982b35b2

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