Address Contract Partially Verified
Address
0xd2d0f85B690604C245F61513bf4679b24ed64C35
Balance
0 ETH
Nonce
1
Code Size
4707 bytes
Creator
0x4790fC64...6e98 at tx 0x9a75851a...a00385
Indexed Transactions
0
Contract Bytecode
4707 bytes
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e157806323b872dd1461020657806327e235e31461022e578063313ce5671461024d5780633eb51dc4146102765780635c65816514610298578063651398e6146102bd578063678f4467146102e157806370a08231146103035780638da5cb5b1461032257806395d89b411461035157806399ddb29b14610364578063a6f9dae114610383578063a7638346146103a2578063a9059cbb146103b5578063b556188e146103d7578063cb4360d9146103ea578063cf424b161461040f578063dd62ed3e14610431575b600080fd5b341561012c57600080fd5b610134610456565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610170578082015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101cd600160a060020a036004351660243561048d565b604051901515815260200160405180910390f35b34156101ec57600080fd5b6101f46104f9565b60405190815260200160405180910390f35b341561021157600080fd5b6101cd600160a060020a03600435811690602435166044356104ff565b341561023957600080fd5b6101f4600160a060020a036004351661061f565b341561025857600080fd5b610260610631565b60405160ff909116815260200160405180910390f35b341561028157600080fd5b6101f4600160a060020a0360043516602435610636565b34156102a357600080fd5b6101f4600160a060020a036004358116906024351661065a565b34156102c857600080fd5b6102df600160a060020a0360043516602435610677565b005b34156102ec57600080fd5b6102df600160a060020a0360043516602435610835565b341561030e57600080fd5b6101f4600160a060020a03600435166109ef565b341561032d57600080fd5b610335610a0a565b604051600160a060020a03909116815260200160405180910390f35b341561035c57600080fd5b610134610a19565b341561036f57600080fd5b6101f4600160a060020a0360043516610a50565b341561038e57600080fd5b6102df600160a060020a0360043516610a62565b34156103ad57600080fd5b6102df610aac565b34156103c057600080fd5b6101cd600160a060020a0360043516602435610ada565b34156103e257600080fd5b6101f4610b85565b34156103f557600080fd5b6102df600160a060020a0360043516602435604435610b8b565b341561041a57600080fd5b6101f4600160a060020a0360043516602435610f78565b341561043c57600080fd5b6101f4600160a060020a0360043581169060243516610f91565b60408051908101604052600881527f424644546f6b656e000000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b60008061050c8584610fbc565b151561051757600080fd5b50600160a060020a0380851660008181526002602090815260408083203390951683529381528382205492825260019052919091205483901080159061055d5750828110155b151561056857600080fd5b600160a060020a03808516600090815260016020526040808220805487019055918716815220805484900390556000198110156105cd57600160a060020a03808616600090815260026020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405190815260200160405180910390a3506001949350505050565b60016020526000908152604090205481565b601281565b60056020528160005260406000208160058110151561065157fe5b01549150829050565b600260209081526000928352604080842090915290825290205481565b60065460009033600160a060020a0390811691161461069557600080fd5b600160a060020a03831660009081526003602052604090205415806106d25750600160a060020a0383166000908152600360205260409020546002145b15156106dd57600080fd5b600160a060020a038316600090815260036020908152604080832060029055600190915290205461071f9061071a84670de0b6b3a76400006111ad565b6111df565b600160a060020a038085166000908152600160205260408082209390935533909116815220546107609061075b84670de0b6b3a76400006111ad565b6111ee565b600160a060020a03331660009081526001602052604081209190915590505b600481116107ec57600160a060020a0383166000908152600160205260409020546107bc906107b59060196004859003026111ad565b6064611200565b600160a060020a038416600090815260056020819052604090912090839081106107e257fe5b015560010161077f565b82600160a060020a031660008051602061121883398151915261081784670de0b6b3a76400006111ad565b600260405191825260208201526040908101905180910390a2505050565b60065460009033600160a060020a0390811691161461085357600080fd5b6007541561086057600080fd5b600160a060020a038316600090815260036020526040902054158061089d5750600160a060020a0383166000908152600360205260409020546001145b15156108a857600080fd5b600160a060020a03831660009081526003602090815260408083206001908190559091529020546108e59061071a84670de0b6b3a76400006111ad565b600160a060020a038085166000908152600160205260408082209390935533909116815220546109219061075b84670de0b6b3a76400006111ad565b600160a060020a03331660009081526001602052604081209190915590505b600481116109a657600160a060020a038316600090815260016020526040902054610976906107b59060196004859003026111ad565b600160a060020a0384166000908152600560208190526040909120908390811061099c57fe5b0155600101610940565b82600160a060020a03166000805160206112188339815191526109d184670de0b6b3a76400006111ad565b600160405191825260208201526040908101905180910390a2505050565b600160a060020a031660009081526001602052604090205490565b600654600160a060020a031681565b60408051908101604052600481527f4246445400000000000000000000000000000000000000000000000000000000602082015281565b60036020526000908152604090205481565b60065433600160a060020a03908116911614610a7d57600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60065433600160a060020a03908116911614610ac757600080fd5b60075415610ad457600080fd5b42600755565b6000610ae63383610fbc565b1515610af157600080fd5b600160a060020a03331660009081526001602052604090205482901015610b1757600080fd5b600160a060020a033381166000818152600160205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60075481565b60065460009033600160a060020a03908116911614610ba957600080fd5b60075415610bb657600080fd5b600160a060020a03841615801590610bcd57508215155b1515610bd857600080fd5b600160a060020a0384166000908152600360205260409020541580610c145750600160a060020a03841660009081526003602052604090205482145b1515610c1f57600080fd5b600160a060020a0384166000908152600360208190526040909120839055821415610d6d57610c5883690cb49b44ba602d8000006111ad565b600160a060020a038516600090815260016020526040902054909150610c7e90826111df565b600160a060020a03808616600090815260016020526040808220939093553390911681522054610cae90826111ee565b600160a060020a033381166000908152600160205260408082209390935590861681522054610ce2906107b590603c6111ad565b600160a060020a038516600090815260046020908152604080832093909355600190522054610d16906107b590601e6111ad565b600160a060020a0385166000818152600460205260408082206001810194909455600290930155906000805160206112188339815191529083906003905191825260208201526040908101905180910390a2610f72565b8160041415610ea257610d8a8369043c33c19375648000006111ad565b600160a060020a038516600090815260016020526040902054909150610db090826111df565b600160a060020a03808616600090815260016020526040808220939093553390911681522054610de090826111ee565b600160a060020a033381166000908152600160205260408082209390935590861681522054610e14906107b590603c6111ad565b600160a060020a038516600090815260046020908152604080832093909355600190522054610e48906107b590601e6111ad565b600160a060020a0385166000818152600460208190526040808320600181019590955560029094019190915590916000805160206112188339815191529184915191825260208201526040908101905180910390a2610f72565b816005141561011c57610ebf8369028a857425466f8000006111ad565b600160a060020a038516600090815260016020526040902054909150610ee590826111df565b600160a060020a03808616600090815260016020526040808220939093553390911681522054610f1590826111ee565b6001600033600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031660008051602061121883398151915282600560405191825260208201526040908101905180910390a25b50505050565b6004602052600082815260409020816003811061065157fe5b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60075460009081901515610fcf57600080fd5b600160a060020a038416600090815260036020526040902054158061100c5750600160a060020a0384166000908152600360205260409020546005145b1561101a57600191506111a6565b600160a060020a038416600090815260036020819052604090912054148061105a5750600160a060020a0384166000908152600360205260409020546004145b156110df57624f1a0061106f426007546111ee565b81151561107857fe5b04905060028110611087575060025b600160a060020a038416600090815260046020526040902081600381106110aa57fe5b0154600160a060020a0385166000908152600160205260409020546110cf90856111ee565b10156110da57600080fd5b6111a1565b600160a060020a0384166000908152600360205260409020546001148061111e5750600160a060020a0384166000908152600360205260409020546002145b156111a15762ed4e00611133426007546111ee565b81151561113c57fe5b0490506004811061114b575060045b600160a060020a0384166000908152600560208190526040909120908290811061117157fe5b0154600160a060020a03851660009081526001602052604090205461119690856111ee565b10156111a157600080fd5b600191505b5092915050565b6000808315156111c057600091506111a6565b508282028284828115156111d057fe5b04146111d857fe5b9392505050565b6000828201838110156111d857fe5b6000828211156111fa57fe5b50900390565b600080828481151561120e57fe5b04949350505050560019bb5c1c92902fad2fe46ff67b8be1838722fbaea86ddb08d8ac64073190de65a165627a7a72305820714196b6041bac21dbdfe18bf6c7cfcdc9e06929c02b6f4fb784219de1f489680029
Verified Source Code Partial Match
Compiler: v0.4.18+commit.9cf6e910
Optimization: Yes (200 runs)
BFDToken.sol 241 lines
pragma solidity ^0.4.18;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256) {
assert(b <= a);
return a - b;
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) {
uint256 c = a / b;
return c;
}
}
contract EIP20Interface {
/* 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) public view 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) public 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) public 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) public 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) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract BFDToken is EIP20Interface, SafeMath {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string constant public name = "BFDToken";
uint8 constant public decimals = 18; //How many decimals to show.
string constant public symbol = "BFDT";
mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others
mapping (address => uint256[3]) public releaseForSeed;
mapping (address => uint256[5]) public releaseForTeamAndAdvisor;
event AllocateToken(address indexed _to, uint256 _value, uint256 _type);
address public owner;
uint256 public finaliseTime;
function BFDToken() public {
totalSupply = 20*10**26; // Update total supply
balances[msg.sender] = totalSupply; // Give the creator all initial tokens
owner = msg.sender;
}
modifier isOwner() {
require(msg.sender == owner);
_;
}
modifier notFinalised() {
require(finaliseTime == 0);
_;
}
//
function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public {
require(_to != address(0x0) && _eth != 0);
require(addressType[_to] == 0 || addressType[_to] == _type);
addressType[_to] = _type;
uint256 temp;
if (_type == 3) {
temp = safeMul(_eth, 60000 * 10**18);
balances[_to] = safeAdd(balances[_to], temp);
balances[msg.sender] = safeSub(balances[msg.sender], temp);
releaseForSeed[_to][0] = safeDiv(safeMul(balances[_to], 60), 100);
releaseForSeed[_to][1] = safeDiv(safeMul(balances[_to], 30), 100);
releaseForSeed[_to][2] = 0;
AllocateToken(_to, temp, 3);
} else if (_type == 4) {
temp = safeMul(_eth, 20000 * 10**18);
balances[_to] = safeAdd(balances[_to], temp);
balances[msg.sender] = safeSub(balances[msg.sender], temp);
releaseForSeed[_to][0] = safeDiv(safeMul(balances[_to], 60), 100);
releaseForSeed[_to][1] = safeDiv(safeMul(balances[_to], 30), 100);
releaseForSeed[_to][2] = 0;
AllocateToken(_to, temp, 4);
} else if (_type == 5) {
temp = safeMul(_eth, 12000 * 10**18);
balances[_to] = safeAdd(balances[_to], temp);
balances[msg.sender] = safeSub(balances[msg.sender], temp);
AllocateToken(_to, temp, 5);
} else {
revert();
}
}
function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public {
require(addressType[_to] == 0 || addressType[_to] == 1);
addressType[_to] = 1;
balances[_to] = safeAdd(balances[_to], safeMul(_value, 10**18));
balances[msg.sender] = safeSub(balances[msg.sender], safeMul(_value, 10**18));
for (uint256 i = 0; i <= 4; ++i) {
releaseForTeamAndAdvisor[_to][i] = safeDiv(safeMul(balances[_to], (4 - i) * 25), 100);
}
AllocateToken(_to, safeMul(_value, 10**18), 1);
}
function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public {
require(addressType[_to] == 0 || addressType[_to] == 2);
addressType[_to] = 2;
balances[_to] = safeAdd(balances[_to], safeMul(_value, 10**18));
balances[msg.sender] = safeSub(balances[msg.sender], safeMul(_value, 10**18));
for (uint256 i = 0; i <= 4; ++i) {
releaseForTeamAndAdvisor[_to][i] = safeDiv(safeMul(balances[_to], (4 - i) * 25), 100);
}
AllocateToken(_to, safeMul(_value, 10**18), 2);
}
function changeOwner(address _owner) isOwner public {
owner = _owner;
}
function setFinaliseTime() isOwner public {
require(finaliseTime == 0);
finaliseTime = now;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(canTransfer(msg.sender, _value));
require(balances[msg.sender] >= _value);
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
require(finaliseTime != 0);
uint256 index;
if (addressType[_from] == 0 || addressType[_from] == 5) {
return true;
}
// for seed and angel investors
if (addressType[_from] == 3 || addressType[_from] == 4) {
index = safeSub(now, finaliseTime) / 60 days;
if ( index >= 2) {
index = 2;
}
require(safeSub(balances[_from], _value) >= releaseForSeed[_from][index]);
} else if (addressType[_from] == 1 || addressType[_from] == 2) {
index = safeSub(now, finaliseTime) / 180 days;
if (index >= 4) {
index = 4;
}
require(safeSub(balances[_from], _value) >= releaseForTeamAndAdvisor[_from][index]);
}
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(canTransfer(_from, _value));
uint256 allowance = allowed[_from][msg.sender];
require(balances[_from] >= _value && allowance >= _value);
balances[_to] += _value;
balances[_from] -= _value;
if (allowance < MAX_UINT256) {
allowed[_from][msg.sender] -= _value;
}
Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
Read Contract
addressType 0x99ddb29b → uint256
allowance 0xdd62ed3e → uint256
allowed 0x5c658165 → uint256
balanceOf 0x70a08231 → uint256
balances 0x27e235e3 → uint256
decimals 0x313ce567 → uint8
finaliseTime 0xb556188e → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
releaseForSeed 0xcf424b16 → uint256
releaseForTeamAndAdvisor 0x3eb51dc4 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
allocateToken 0xcb4360d9
address _to
uint256 _eth
uint256 _type
allocateTokenForAdvisor 0x651398e6
address _to
uint256 _value
allocateTokenForTeam 0x678f4467
address _to
uint256 _value
approve 0x095ea7b3
address _spender
uint256 _value
returns: bool
changeOwner 0xa6f9dae1
address _owner
setFinaliseTime 0xa7638346
No parameters
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
Recent Transactions
No transactions found for this address