ETH Price: $1,917.97 (-5.53%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Age:90D
Reset Filter

Transaction Hash
Method
Block
From
To

There are no matching entries

Update your filters to view other transactions

Age:90D
Reset Filter

Advanced mode:
Parent Transaction Hash Method Block
From
To

There are no matching entries

Update your filters to view other transactions

View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Erc2Vite

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-11-19
*/

pragma solidity ^0.4.24;

// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20

contract Token {
    /* This is a slight change to the ERC20 base standard.
    function totalSupply() constant returns (uint256 supply);
    is replaced with:
    uint256 public totalSupply;
    This automatically creates a getter function for the totalSupply.
    This is moved to the base contract since public getter functions are not
    currently recognised as an implementation of the matching abstract
    function by the compiler.
    */
    /// total amount of tokens
    uint256 public totalSupply;

    /// @param _owner The address from which the balance will be retrieved
    /// @return The balance
    function balanceOf(address _owner) constant returns (uint256 balance);

    /// @notice send `_value` token to `_to` from `msg.sender`
    /// @param _to The address of the recipient
    /// @param _value The amount of token to be transferred
    /// @return Whether the transfer was successful or not
    function transfer(address _to, uint256 _value) returns (bool success);

    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
    /// @param _from The address of the sender
    /// @param _to The address of the recipient
    /// @param _value The amount of token to be transferred
    /// @return Whether the transfer was successful or not
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success);

    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
    /// @param _spender The address of the account able to transfer the tokens
    /// @param _value The amount of tokens to be approved for transfer
    /// @return Whether the approval was successful or not
    function approve(address _spender, uint256 _value) returns (bool success);

    /// @param _owner The address of the account owning tokens
    /// @param _spender The address of the account able to transfer the tokens
    /// @return Amount of remaining tokens allowed to spent
    function allowance(address _owner, address _spender) constant returns (uint256 remaining);

    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}

contract Erc2Vite {
    
    mapping (address => string) public records;
    
    address public destoryAddr = 0x1111111111111111111111111111111111111111;

    uint256 public defaultCode = 203226;
    
    address public viteTokenAddress = 0x0;
	address public owner			= 0x0;
	
	uint public bindId = 0;
	event Bind(uint bindId, address indexed _ethAddr, string _viteAddr, uint256 amount, uint256 _invitationCode);
	
	/*
	 * public functions
	 */
	/// @dev Initialize the contract
	/// @param _viteTokenAddress ViteToken ERC20 token address
	/// @param _owner the owner of the contract
	function Erc2Vite(address _viteTokenAddress, address _owner) {
		require(_viteTokenAddress != address(0));
		require(_owner != address(0));

		viteTokenAddress = _viteTokenAddress;
		owner = _owner;
	}
    
    function bind(string _viteAddr, uint256 _invitationCode) public {

        require(bytes(_viteAddr).length == 55);
        
        var viteToken = Token(viteTokenAddress);
        uint256 apprAmount = viteToken.allowance(msg.sender, address(this));
        require(apprAmount > 0);
        
        require(viteToken.transferFrom(msg.sender, destoryAddr, apprAmount));
        
        records[msg.sender] = _viteAddr;

        if(_invitationCode == 0) {
            _invitationCode = defaultCode;
        }
        
        emit Bind(
            bindId++,
            msg.sender,
            _viteAddr,
            apprAmount,
            _invitationCode
        );
    }
    
    function () public payable {
        revert();
    }
    
    function destory() public {
        require(msg.sender == owner);
        selfdestruct(owner);
    }
    
}

Contract Security Audit

Contract ABI

API
[{"constant":true,"inputs":[],"name":"bindId","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"viteTokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"records","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"destory","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"defaultCode","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_viteAddr","type":"string"},{"name":"_invitationCode","type":"uint256"}],"name":"bind","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"destoryAddr","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_viteTokenAddress","type":"address"},{"name":"_owner","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"bindId","type":"uint256"},{"indexed":true,"name":"_ethAddr","type":"address"},{"indexed":false,"name":"_viteAddr","type":"string"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"_invitationCode","type":"uint256"}],"name":"Bind","type":"event"}]

608060405260018054600160a060020a031990811673111111111111111111111111111111111111111117909155620319da6002556003805482169055600480549091169055600060055534801561005657600080fd5b5060405160408061072a833981016040528051602090910151600160a060020a038216151561008457600080fd5b600160a060020a038116151561009957600080fd5b60038054600160a060020a03938416600160a060020a03199182161790915560048054929093169116179055610656806100d46000396000f30060806040526004361061008d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630571d61c811461009257806313b6969b146100b9578063469e9067146100ea5780636bdebcc9146101805780638da5cb5b14610197578063a0b5f771146101ac578063bbda8d61146101c1578063c54faa3c1461021c575b600080fd5b34801561009e57600080fd5b506100a7610231565b60408051918252519081900360200190f35b3480156100c557600080fd5b506100ce610237565b60408051600160a060020a039092168252519081900360200190f35b3480156100f657600080fd5b5061010b600160a060020a0360043516610246565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101956102e0565b005b3480156101a357600080fd5b506100ce610305565b3480156101b857600080fd5b506100a7610314565b3480156101cd57600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610195943694929360249392840191908190840183828082843750949750509335945061031a9350505050565b34801561022857600080fd5b506100ce610580565b60055481565b600354600160a060020a031681565b600060208181529181526040908190208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152929091908301828280156102d85780601f106102ad576101008083540402835291602001916102d8565b820191906000526020600020905b8154815290600101906020018083116102bb57829003601f168201915b505050505081565b600454600160a060020a031633146102f757600080fd5b600454600160a060020a0316ff5b600454600160a060020a031681565b60025481565b6000808351603714151561032d57600080fd5b600354604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523360048201523060248201529051600160a060020a039092169350839163dd62ed3e916044808201926020929091908290030181600087803b15801561039c57600080fd5b505af11580156103b0573d6000803e3d6000fd5b505050506040513d60208110156103c657600080fd5b50519050600081116103d757600080fd5b600154604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a039283166024820152604481018490529051918416916323b872dd916064808201926020929091908290030181600087803b15801561044c57600080fd5b505af1158015610460573d6000803e3d6000fd5b505050506040513d602081101561047657600080fd5b5051151561048357600080fd5b3360009081526020818152604090912085516104a19287019061058f565b508215156104af5760025492505b33600160a060020a03167f8cbe6b806fb927a9d20178aebca75b9f5c0406bd5824df11f60fc2b578d4ce6b60056000815480929190600101919050558684876040518085815260200180602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b8381101561053d578181015183820152602001610525565b50505050905090810190601f16801561056a5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a250505050565b600154600160a060020a031681565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106105d057805160ff19168380011785556105fd565b828001600101855582156105fd579182015b828111156105fd5782518255916020019190600101906105e2565b5061060992915061060d565b5090565b61062791905b808211156106095760008155600101610613565b905600a165627a7a72305820f7bd676f214dd8493af8e4af5c43de58909b02711e5fc7c01693a89573b13fcc00290000000000000000000000001b793e49237758dbd8b752afc9eb4b329d5da01600000000000000000000000020a33459a80035be34be91a77d19a0dfbb278735

Deployed Bytecode

0x60806040526004361061008d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630571d61c811461009257806313b6969b146100b9578063469e9067146100ea5780636bdebcc9146101805780638da5cb5b14610197578063a0b5f771146101ac578063bbda8d61146101c1578063c54faa3c1461021c575b600080fd5b34801561009e57600080fd5b506100a7610231565b60408051918252519081900360200190f35b3480156100c557600080fd5b506100ce610237565b60408051600160a060020a039092168252519081900360200190f35b3480156100f657600080fd5b5061010b600160a060020a0360043516610246565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101956102e0565b005b3480156101a357600080fd5b506100ce610305565b3480156101b857600080fd5b506100a7610314565b3480156101cd57600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610195943694929360249392840191908190840183828082843750949750509335945061031a9350505050565b34801561022857600080fd5b506100ce610580565b60055481565b600354600160a060020a031681565b600060208181529181526040908190208054825160026001831615610100026000190190921691909104601f8101859004850282018501909352828152929091908301828280156102d85780601f106102ad576101008083540402835291602001916102d8565b820191906000526020600020905b8154815290600101906020018083116102bb57829003601f168201915b505050505081565b600454600160a060020a031633146102f757600080fd5b600454600160a060020a0316ff5b600454600160a060020a031681565b60025481565b6000808351603714151561032d57600080fd5b600354604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523360048201523060248201529051600160a060020a039092169350839163dd62ed3e916044808201926020929091908290030181600087803b15801561039c57600080fd5b505af11580156103b0573d6000803e3d6000fd5b505050506040513d60208110156103c657600080fd5b50519050600081116103d757600080fd5b600154604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a039283166024820152604481018490529051918416916323b872dd916064808201926020929091908290030181600087803b15801561044c57600080fd5b505af1158015610460573d6000803e3d6000fd5b505050506040513d602081101561047657600080fd5b5051151561048357600080fd5b3360009081526020818152604090912085516104a19287019061058f565b508215156104af5760025492505b33600160a060020a03167f8cbe6b806fb927a9d20178aebca75b9f5c0406bd5824df11f60fc2b578d4ce6b60056000815480929190600101919050558684876040518085815260200180602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b8381101561053d578181015183820152602001610525565b50505050905090810190601f16801561056a5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a250505050565b600154600160a060020a031681565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106105d057805160ff19168380011785556105fd565b828001600101855582156105fd579182015b828111156105fd5782518255916020019190600101906105e2565b5061060992915061060d565b5090565b61062791905b808211156106095760008155600101610613565b905600a165627a7a72305820f7bd676f214dd8493af8e4af5c43de58909b02711e5fc7c01693a89573b13fcc0029

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

0000000000000000000000001b793e49237758dbd8b752afc9eb4b329d5da01600000000000000000000000020a33459a80035be34be91a77d19a0dfbb278735

-----Decoded View---------------
Arg [0] : _viteTokenAddress (address): 0x1b793E49237758dBD8b752AFC9Eb4b329d5Da016
Arg [1] : _owner (address): 0x20A33459A80035BE34bE91a77d19a0dfBB278735

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000001b793e49237758dbd8b752afc9eb4b329d5da016
Arg [1] : 00000000000000000000000020a33459a80035be34be91a77d19a0dfbb278735


Swarm Source

bzzr://f7bd676f214dd8493af8e4af5c43de58909b02711e5fc7c01693a89573b13fcc

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