Address Contract Partially Verified
Address
0xEe7527841A932d2912224E20a405e1a1FF747084
Balance
0 ETH
Nonce
1
Code Size
4096 bytes
Creator
0x88cED584...A369 at tx 0xda8d0f68...27c104
Indexed Transactions
0
Contract Bytecode
4096 bytes
0x608060405260043610610100577c0100000000000000000000000000000000000000000000000000000000600035046306fdde038114610105578063095ea7b31461018f57806318160ddd146101dc57806323b872dd14610203578063313ce5671461024657806345977d031461025b5780634eee966f146102875780635de4ccb0146103c1578063600440cb146103f257806370a08231146104075780638444b3911461043a57806395d89b41146104735780639738968c14610488578063a9059cbb1461049d578063c752ff62146104d6578063d7e7088a146104eb578063dd62ed3e1461051e578063eefa597b14610488578063ffeb7d7514610559575b600080fd5b34801561011157600080fd5b5061011a61058c565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015457818101518382015260200161013c565b50505050905090810190601f1680156101815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019b57600080fd5b506101c8600480360360408110156101b257600080fd5b50600160a060020a03813516906020013561061a565b604080519115158252519081900360200190f35b3480156101e857600080fd5b506101f16106b9565b60408051918252519081900360200190f35b34801561020f57600080fd5b506101c86004803603606081101561022657600080fd5b50600160a060020a038135811691602081013590911690604001356106bf565b34801561025257600080fd5b506101f16107bc565b34801561026757600080fd5b506102856004803603602081101561027e57600080fd5b50356107c2565b005b34801561029357600080fd5b50610285600480360360408110156102aa57600080fd5b8101906020810181356401000000008111156102c557600080fd5b8201836020820111156102d757600080fd5b803590602001918460018302840111640100000000831117156102f957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561034c57600080fd5b82018360208201111561035e57600080fd5b8035906020019184600183028401116401000000008311171561038057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610923945050505050565b3480156103cd57600080fd5b506103d6610ad1565b60408051600160a060020a039092168252519081900360200190f35b3480156103fe57600080fd5b506103d6610ae0565b34801561041357600080fd5b506101f16004803603602081101561042a57600080fd5b5035600160a060020a0316610aef565b34801561044657600080fd5b5061044f610b0a565b6040518082600481111561045f57fe5b60ff16815260200191505060405180910390f35b34801561047f57600080fd5b5061011a610b54565b34801561049457600080fd5b506101c8610baf565b3480156104a957600080fd5b506101c8600480360360408110156104c057600080fd5b50600160a060020a038135169060200135610bb4565b3480156104e257600080fd5b506101f1610c58565b3480156104f757600080fd5b506102856004803603602081101561050e57600080fd5b5035600160a060020a0316610c5e565b34801561052a57600080fd5b506101f16004803603604081101561054157600080fd5b50600160a060020a0381358116916020013516610e48565b34801561056557600080fd5b506102856004803603602081101561057c57600080fd5b5035600160a060020a0316610e73565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106125780601f106105e757610100808354040283529160200191610612565b820191906000526020600020905b8154815290600101906020018083116105f557829003601f168201915b505050505081565b600081158061064a5750336000908152600260209081526040808320600160a060020a0387168452909152902054155b151561065257fe5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005481565b600160a060020a038084166000908152600260209081526040808320338452825280832054938616835260019091528120549091906106fe9084610f06565b600160a060020a03808616600090815260016020526040808220939093559087168152205461072d9084610f2a565b600160a060020a0386166000908152600160205260409020556107508184610f2a565b600160a060020a03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b60085481565b60006107cc610b0a565b905060038160048111156107dc57fe5b14806107f3575060048160048111156107f157fe5b145b15156107fe57600080fd5b81151561080a57600080fd5b336000908152600160205260409020546108249083610f2a565b33600090815260016020526040812091909155546108429083610f2a565b6000556005546108529083610f06565b60055560048054604080517f753e88e500000000000000000000000000000000000000000000000000000000815233938101939093526024830185905251600160a060020a039091169163753e88e591604480830192600092919082900301818387803b1580156108c257600080fd5b505af11580156108d6573d6000803e3d6000fd5b5050600454604080518681529051600160a060020a0390921693503392507f7e5c344a8141a805725cb476f76c6953b842222b967edd1f78ddb6e8b3f397ac919081900360200190a35050565b600354600160a060020a0316331461093a57600080fd5b60065460026000196101006001841615020190911604158015610970575060075460026000196101006001841615020190911604155b151561097b57600080fd5b815161098e906006906020850190610f3c565b5080516109a2906007906020840190610f3c565b506040805181815260068054600260001961010060018416150201909116049282018390527fd131ab1e6f279deea74e13a18477e13e2107deb6dc8ae955648948be5841fb4692909160079181906020820190606083019086908015610a495780601f10610a1e57610100808354040283529160200191610a49565b820191906000526020600020905b815481529060010190602001808311610a2c57829003601f168201915b5050838103825284546002600019610100600184161502019091160480825260209091019085908015610abd5780601f10610a9257610100808354040283529160200191610abd565b820191906000526020600020905b815481529060010190602001808311610aa057829003601f168201915b505094505050505060405180910390a15050565b600454600160a060020a031681565b600354600160a060020a031681565b600160a060020a031660009081526001602052604090205490565b6000610b14610baf565b1515610b2257506001610b51565b600454600160a060020a03161515610b3c57506002610b51565b6005541515610b4d57506003610b51565b5060045b90565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106125780601f106105e757610100808354040283529160200191610612565b600190565b33600090815260016020526040812054610bce9083610f2a565b3360009081526001602052604080822092909255600160a060020a03851681522054610bfa9083610f06565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60055481565b610c66610baf565b1515610c7157600080fd5b600160a060020a0381161515610c8657600080fd5b600354600160a060020a03163314610c9d57600080fd5b6004610ca7610b0a565b6004811115610cb257fe5b1415610cbd57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117808355604080517f61d3d7a6000000000000000000000000000000000000000000000000000000008152905191909216926361d3d7a692808201926020929091829003018186803b158015610d3b57600080fd5b505afa158015610d4f573d6000803e3d6000fd5b505050506040513d6020811015610d6557600080fd5b50511515610d7257600080fd5b60005460048054604080517f4b2ba0dd0000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921692634b2ba0dd928282019260209290829003018186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d6020811015610dfa57600080fd5b505114610e0657600080fd5b60045460408051600160a060020a039092168252517f7845d5aa74cc410e35571258d954f23b82276e160fe8c188fa80566580f279cc9181900360200190a150565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600160a060020a0381161515610e8857600080fd5b600354600160a060020a03163314610e9f57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116919091179182905560408051929091168252517f41215aff8c294dab52583f38146756951783ca3d8b887e22e03f4b276d02606c916020908290030190a150565b6000828201838110801590610f1b5750828110155b1515610f2357fe5b9392505050565b600082821115610f3657fe5b50900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610f7d57805160ff1916838001178555610faa565b82800160010185558215610faa579182015b82811115610faa578251825591602001919060010190610f8f565b50610fb6929150610fba565b5090565b610b5191905b80821115610fb65760008155600101610fc056fea165627a7a72305820a12706ca3407337178db3795e4ccce576490e35e3cf80ae19327bca13fd4c04b0029
Verified Source Code Partial Match
Compiler: v0.5.1+commit.c8a2cb62
EVM: byzantium
Optimization: Yes (200 runs)
SHx.sol 327 lines
pragma solidity ^0.5.1;
/*
* ERC20 interface
* see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) public view returns (uint);
function allowance(address owner, address spender) public view returns (uint);
function transfer(address to, uint value) public returns (bool ok);
function transferFrom(address from, address to, uint value) public returns (bool ok);
function approve(address spender, uint value) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint a, uint b) internal pure returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint a, uint b) internal pure returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
function safeSub(uint a, uint b) internal pure returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
/**
* Standard ERC20 token with Short Hand Attack and approve() race condition mitigation.
*
* Based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, SafeMath {
/* Actual balances of token holders */
mapping(address => uint) balances;
/* approve() allowances */
mapping (address => mapping (address => uint)) allowed;
/* Interface declaration */
function isToken() public pure returns (bool weAre) {
return true;
}
function transfer(address _to, uint _value) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], _value);
balances[_to] = safeAdd(balances[_to], _value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
uint _allowance = allowed[_from][msg.sender];
balances[_to] = safeAdd(balances[_to], _value);
balances[_from] = safeSub(balances[_from], _value);
allowed[_from][msg.sender] = safeSub(_allowance, _value);
emit Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
function approve(address _spender, uint _value) public returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
assert((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* Upgrade agent interface inspired by Lunyr.
*
* Upgrade agent transfers tokens to a new version of a token contract.
* Upgrade agent can be set on a token by the upgrade master.
*
* Steps are
* - Upgradeabletoken.upgradeMaster calls UpgradeableToken.setUpgradeAgent()
* - Individual token holders can now call UpgradeableToken.upgrade()
* -> This results to call UpgradeAgent.upgradeFrom() that issues new tokens
* -> UpgradeableToken.upgrade() reduces the original total supply based on amount of upgraded tokens
*
* Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting.
*/
contract UpgradeAgent {
uint public originalSupply;
/** Interface marker */
function isUpgradeAgent() public pure returns (bool) {
return true;
}
/**
* Upgrade amount of tokens to a new version.
*
* Only callable by UpgradeableToken.
*
* @param _tokenHolder Address that wants to upgrade its tokens
* @param _amount Number of tokens to upgrade. The address may consider to hold back some amount of tokens in the old version.
*/
function upgradeFrom(address _tokenHolder, uint256 _amount) external;
}
/**
* A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision.
*
* First envisioned by Golem and Lunyr projects.
*/
contract UpgradeableToken is StandardToken {
/** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */
address public upgradeMaster;
/** The next contract where the tokens will be migrated. */
UpgradeAgent public upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 public totalUpgraded;
/**
* Upgrade states.
*
* - NotAllowed: The child contract has not reached a condition where the upgrade can bgun
* - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet
* - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet
* - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens
*
*/
enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Upgrade master updated.
*/
event NewUpgradeMaster(address upgradeMaster);
/**
* Do not allow construction without upgrade master set.
*/
constructor(address _upgradeMaster) public {
upgradeMaster = _upgradeMaster;
emit NewUpgradeMaster(upgradeMaster);
}
/**
* Allow the token holder to upgrade some of their tokens to a new contract.
*/
function upgrade(uint256 value) public {
UpgradeState state = getUpgradeState();
require(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading);
// Validate input value.
require(value != 0);
balances[msg.sender] = safeSub(balances[msg.sender], value);
// Take tokens out from circulation
totalSupply = safeSub(totalSupply, value);
totalUpgraded = safeAdd(totalUpgraded, value);
// Upgrade agent reissues the tokens
upgradeAgent.upgradeFrom(msg.sender, value);
emit Upgrade(msg.sender, address(upgradeAgent), value);
}
/**
* Set an upgrade agent that handles
*/
function setUpgradeAgent(address agent) external {
require(canUpgrade());
require(agent != address(0));
// Only a master can designate the next agent
require(msg.sender == upgradeMaster);
// Upgrade has already begun for an agent
require(getUpgradeState() != UpgradeState.Upgrading);
upgradeAgent = UpgradeAgent(agent);
// Bad interface
require(upgradeAgent.isUpgradeAgent());
// Make sure that token supplies match in source and target
require(upgradeAgent.originalSupply() == totalSupply);
emit UpgradeAgentSet(address(upgradeAgent));
}
/**
* Get the state of the token upgrade.
*/
function getUpgradeState() public view returns(UpgradeState) {
if(!canUpgrade()) return UpgradeState.NotAllowed;
else if(address(upgradeAgent) == address(0)) return UpgradeState.WaitingForAgent;
else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade;
else return UpgradeState.Upgrading;
}
/**
* Change the upgrade master.
*
* This allows us to set a new owner for the upgrade mechanism.
*/
function setUpgradeMaster(address master) public {
require(master != address(0));
require(msg.sender == upgradeMaster);
upgradeMaster = master;
emit NewUpgradeMaster(upgradeMaster);
}
/**
* Child contract can enable to provide the condition when the upgrade can begun.
*/
function canUpgrade() public pure returns(bool) {
return true;
}
}
/**
* Centrally issued Ethereum token. The SHx issued here are 'cross-issued' from Stellar.
* (GDSTRSHXHGJ7ZIVRBXEYE5Q74XUVCUSEKEBR7UCHEUUEK72N7I7KJ6JH:SHX)
*
* We mix in burnable and upgradeable traits.
*
* Token supply is created in the token contract creation and allocated to owner.
* The owner can then transfer from its supply to crowdsale participants.
* The owner, or anybody, can burn any excessive tokens they are holding.
*
*/
contract SHx is UpgradeableToken {
string public name;
string public symbol;
uint public decimals;
/** Name and symbol were updated. */
event UpdatedTokenInformation(string newName, string newSymbol);
constructor(address _owner, string memory _name, string memory _symbol, uint _totalSupply, uint _decimals) public UpgradeableToken(_owner) {
name = _name;
symbol = _symbol;
totalSupply = _totalSupply;
decimals = _decimals;
// Allocate initial balance to the owner
balances[_owner] = _totalSupply;
}
/**
* Owner can update token information here.
*
* It is often useful to conceal the actual token association, until
* the token operations, like central issuance or reissuance have been completed.
* In this case the initial token can be supplied with empty name and symbol information.
*
* This function allows the token owner to rename the token after the operations
* have been completed and then point the audience to use the token contract.
*/
function setTokenInformation(string memory _name, string memory _symbol) public {
require(msg.sender == upgradeMaster);
require(bytes(name).length == 0 && bytes(symbol).length == 0);
name = _name;
symbol = _symbol;
emit UpdatedTokenInformation(name, symbol);
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
canUpgrade 0x9738968c → bool
decimals 0x313ce567 → uint256
getUpgradeState 0x8444b391 → uint8
isToken 0xeefa597b → bool
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
totalUpgraded 0xc752ff62 → uint256
upgradeAgent 0x5de4ccb0 → address
upgradeMaster 0x600440cb → address
Write Contract 7 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address _spender
uint256 _value
returns: bool
setTokenInformation 0x4eee966f
string _name
string _symbol
setUpgradeAgent 0xd7e7088a
address agent
setUpgradeMaster 0xffeb7d75
address master
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
upgrade 0x45977d03
uint256 value
Token Balances (2)
View Transfers →Recent Transactions
No transactions found for this address