Address Contract Partially Verified
Address
0x0aF747AE064Bf2489740ccd44D26750BC85e2aD0
Balance
0 ETH
Nonce
1
Code Size
3210 bytes
Creator
0xa0E230De...6775 at tx 0x38ae4087...e1c720
Indexed Transactions
0
Contract Bytecode
3210 bytes
0x606060405236156101045763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610106578063095ea7b31461019657806318160ddd146101c957806323b872dd146101eb57806327e235e314610224578063313ce567146102525780633f4ba83a146102785780635c6581651461028a5780635c975abb146102be57806370a08231146102e25780638456cb59146103105780638da5cb5b1461032257806395d89b411461034e578063a0821be3146103de578063a55956831461040c578063a9059cbb14610430578063dd62ed3e14610463578063e9ed866714610497578063f2fde38b146104cc575bfe5b341561010e57fe5b6101166104ea565b60408051602080825283518183015283519192839290830191850190808383821561015c575b80518252602083111561015c57601f19909201916020918201910161013c565b505050905090810190601f1680156101885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019e57fe5b6101b5600160a060020a0360043516602435610521565b604080519115158252519081900360200190f35b34156101d157fe5b6101d961058c565b60408051918252519081900360200190f35b34156101f357fe5b6101b5600160a060020a0360043581169060243516604435610598565b604080519115158252519081900360200190f35b341561022c57fe5b6101d9600160a060020a03600435166105df565b60408051918252519081900360200190f35b341561025a57fe5b6102626105f1565b6040805160ff9092168252519081900360200190f35b341561028057fe5b6102886105f6565b005b341561029257fe5b6101d9600160a060020a0360043581169060243516610677565b60408051918252519081900360200190f35b34156102c657fe5b6101b5610694565b604080519115158252519081900360200190f35b34156102ea57fe5b6101d9600160a060020a03600435166106a4565b60408051918252519081900360200190f35b341561031857fe5b6102886106c3565b005b341561032a57fe5b610332610749565b60408051600160a060020a039092168252519081900360200190f35b341561035657fe5b610116610758565b60408051602080825283518183015283519192839290830191850190808383821561015c575b80518252602083111561015c57601f19909201916020918201910161013c565b505050905090810190601f1680156101885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103e657fe5b6101d9600160a060020a036004351661078f565b60408051918252519081900360200190f35b341561041457fe5b610288600160a060020a0360043516602435604435610831565b005b341561043857fe5b6101b5600160a060020a036004351660243561096e565b604080519115158252519081900360200190f35b341561046b57fe5b6101d9600160a060020a03600435811690602435166109b3565b60408051918252519081900360200190f35b341561049f57fe5b6104b3600160a060020a03600435166109e0565b6040805192835260208301919091528051918290030190f35b34156104d457fe5b610288600160a060020a03600435166109f9565b005b60408051808201909152600a81527f4150445420546f6b656e00000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6702ea11e32ad5000081565b60035460009060a060020a900460ff16156105b35760006000fd5b816105bd8561078f565b10156105c95760006000fd5b6105d4848484610a92565b90505b5b9392505050565b60016020526000908152604090205481565b600681565b60035433600160a060020a039081169116146106125760006000fd5b60035460a060020a900460ff16151561062b5760006000fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a15b5b5b565b600260209081526000928352604080842090915290825290205481565b60035460a060020a900460ff1681565b600160a060020a0381166000908152600160205260409020545b919050565b60035433600160a060020a039081169116146106df5760006000fd5b60035460a060020a900460ff16156106f75760006000fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a15b5b5b565b600354600160a060020a031681565b60408051808201909152600481527f4150445400000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a038116600090815260046020526040812060010154429010156107d25750600160a060020a0381166000908152600160205260409020546106be565b600160a060020a03821660009081526004602090815260408083205460019092529091205410156107ff57fe5b50600160a060020a038116600090815260046020908152604080832054600190925290912054036106be565b5b919050565b600354600090819033600160a060020a039081169116146108525760006000fd5b600160a060020a0385166000908152600460205260409020600101544290111561089c57600160a060020a03851660009081526004602052604090205484101561089c5760006000fd5b5b600160a060020a038516600090815260016020526040902054849010156108c45760006000fd5b5050600160a060020a0383166000818152600460209081526040918290205482519081529081018590524262015180850290810182840181905292519093917f89f85a4bd38f70943757e43dedd843409e565220cb52ba80fc297d1246b3b9bb919081900360600190a26040805180820182528581526020808201848152600160a060020a038916600090815260049092529290209051815590516001909101555b5b5050505050565b60035460009060a060020a900460ff16156109895760006000fd5b816109933361078f565b101561099f5760006000fd5b6109a98383610b9f565b90505b5b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b6004602052600090815260409020805460019091015482565b60035433600160a060020a03908116911614610a155760006000fd5b600160a060020a0381161515610a2b5760006000fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a038316600090815260016020526040812054829010801590610ae25750600160a060020a0380851660009081526002602090815260408083203390941683529290522054829010155b8015610b075750600160a060020a038316600090815260016020526040902054828101115b1515610b135760006000fd5b600160a060020a03808416600081815260016020908152604080832080548801905588851680845281842080548990039055600283528184203390961684529482529182902080548790039055815186815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060015b9392505050565b600160a060020a033316600090815260016020526040812054829010801590610be15750600160a060020a038316600090815260016020526040902054828101115b1515610bed5760006000fd5b600160a060020a03338116600081815260016020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b929150505600a165627a7a7230582003948e38ed78eebf2ed5559c6ffec973c873aa926c6ac850a409ac8b743106580029
Verified Source Code Partial Match
Compiler: v0.4.11+commit.68ef5810
Optimization: Yes (200 runs)
APDTToken.sol 265 lines
/**
*Submitted for verification at Etherscan.io on 2019-07-08
*/
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
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 StandardToken is Token {
function transfer(address _to, uint256 _value) returns (bool success) {
require(balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]);
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]);
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping (address => uint256) public balances; // *added public
mapping (address => mapping (address => uint256)) public allowed; // *added public
}
contract APDTToken is StandardToken, Pausable {
string public constant name = "APDT Token";
string public constant symbol = "APDT";
uint8 public constant decimals = 6;
uint256 public constant totalSupply = 210000000000000000;
// Holds the amount and date of a given balance lock.
struct BalanceLock {
uint256 amount;
uint256 unlockDate;
}
// A mapping of balance lock to a given address.
mapping (address => BalanceLock) public balanceLocks;
// An event to notify that _owner has locked a balance.
event BalanceLocked(address indexed _owner, uint256 _oldLockedAmount,
uint256 _newLockedAmount, uint256 _expiry);
/** @dev Constructor for the contract.
*/
function APDTToken()
Pausable() {
balances[msg.sender] = totalSupply;
Transfer(0x0, msg.sender, totalSupply);
}
/** @dev Sets a token balance to be locked by the sender, on the condition
* that the amount is equal or greater than the previous amount, or if the
* previous lock time has expired.
* @param _value The amount be locked.
*/
//设置锁仓
function lockBalance(address addr, uint256 _value,uint256 lockingDays) onlyOwner {
// Check if the lock on previously locked tokens is still active.
if (balanceLocks[addr].unlockDate > now) { // 未到可转账日期
// Only allow confirming the lock or adding to it.
require(_value >= balanceLocks[addr].amount);
}
// Ensure that no more than the balance can be locked.
require(balances[addr] >= _value);
// convert days to seconds
uint256 lockingPeriod = lockingDays*24*3600;
// Lock tokens and notify.
uint256 _expiry = now + lockingPeriod;
BalanceLocked(addr, balanceLocks[addr].amount, _value, _expiry);
balanceLocks[addr] = BalanceLock(_value, _expiry);
}
/** @dev Returns the balance that a given address has available for transfer.
* @param _owner The address of the token owner.
*/
// 返回用户当前可用余额
function availableBalance(address _owner) constant returns(uint256) {
if (balanceLocks[_owner].unlockDate < now) {
return balances[_owner];
} else {
assert(balances[_owner] >= balanceLocks[_owner].amount);
return balances[_owner] - balanceLocks[_owner].amount;
}
}
/** @dev Send `_value` token to `_to` from `msg.sender`, on the condition
* that there are enough unlocked tokens in the `msg.sender` account.
* @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) whenNotPaused returns (bool success) {
require(availableBalance(msg.sender) >= _value);
return super.transfer(_to, _value);
}
/** @dev Send `_value` token to `_to` from `_from` on the condition
* that there are enough unlocked tokens in the `_from` account.
* @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) whenNotPaused
returns (bool success) {
require(availableBalance(_from) >= _value);
return super.transferFrom(_from, _to, _value);
}
}
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
allowance 0xdd62ed3e
address _owner
address _spender
returns: uint256
allowed 0x5c658165
address
address
returns: uint256
approve 0x095ea7b3
address _spender
uint256 _value
returns: bool
availableBalance 0xa0821be3
address _owner
returns: uint256
balanceLocks 0xe9ed8667
address
returns: uint256, uint256
balanceOf 0x70a08231
address _owner
returns: uint256
balances 0x27e235e3
address
returns: uint256
decimals 0x313ce567
No parameters
returns: uint8
lockBalance 0xa5595683
address addr
uint256 _value
uint256 lockingDays
name 0x06fdde03
No parameters
returns: string
owner 0x8da5cb5b
No parameters
returns: address
pause 0x8456cb59
No parameters
paused 0x5c975abb
No parameters
returns: bool
symbol 0x95d89b41
No parameters
returns: string
totalSupply 0x18160ddd
No parameters
returns: uint256
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
Recent Transactions
No transactions found for this address