ERC-20
Source Code
Overview
Max Total Supply
9,999,998,413.25 GBPp
Holders
10
Transfers
-
0
Market
Onchain Market Cap
-
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 6 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
| # | Exchange | Pair | Price | 24H Volume | % Volume |
|---|
Contract Name:
GBPp
Compiler Version
v0.4.17+commit.bdeb9e52
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2018-11-05
*/
pragma solidity ^0.4.17;
/// @title CurrencyToken contract
contract GBPp {
address public server; // Address, which the platform website uses.
address public populous; // Address of the Populous bank contract.
uint256 public totalSupply;
bytes32 public name;// token name, e.g, pounds for fiat UK pounds.
uint8 public decimals;// How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like comparing 1 wei to 1 ether.
bytes32 public symbol;// An identifier: eg SBX.
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
//EVENTS
// An event triggered when a transfer of tokens is made from a _from address to a _to address.
event Transfer(
address indexed _from,
address indexed _to,
uint256 _value
);
// An event triggered when an owner of tokens successfully approves another address to spend a specified amount of tokens.
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _value
);
// event EventMintTokens(bytes32 currency, uint amount);
// MODIFIERS
modifier onlyServer {
require(isServer(msg.sender) == true);
_;
}
modifier onlyServerOrOnlyPopulous {
require(isServer(msg.sender) == true || isPopulous(msg.sender) == true);
_;
}
modifier onlyPopulous {
require(isPopulous(msg.sender) == true);
_;
}
// NON-CONSTANT METHODS
/** @dev Creates a new currency/token.
* param _decimalUnits The decimal units/places the token can have.
* param _tokenSymbol The token's symbol, e.g., GBP.
* param _decimalUnits The tokens decimal unites/precision
* param _amount The amount of tokens to create upon deployment
* param _owner The owner of the tokens created upon deployment
* param _server The server/admin address
*/
function GBPp ()
public
{
populous = server = 0x63d509F7152769Ddf162eD048B83719fE1e31080;
symbol = name = 0x47425070; // Set the name for display purposes
decimals = 6; // Amount of decimals for display purposes
balances[server] = safeAdd(balances[server], 10000000000000000);
totalSupply = safeAdd(totalSupply, 10000000000000000);
}
// ERC20
//Note.. Need to emit event, Pokens destroyed... from system
/** @dev Destroys a specified amount of tokens
* @dev The method uses a modifier from withAccessManager contract to only permit populous to use it.
* @dev The method uses SafeMath to carry out safe token deductions/subtraction.
* @param amount The amount of tokens to create.
*/
function destroyTokens(uint amount) public onlyPopulous returns (bool success) {
if (balances[populous] < amount) {
return false;
} else {
balances[populous] = safeSub(balances[populous], amount);
totalSupply = safeSub(totalSupply, amount);
return true;
}
}
/** @dev Destroys a specified amount of tokens, from a user.
* @dev The method uses a modifier from withAccessManager contract to only permit populous to use it.
* @dev The method uses SafeMath to carry out safe token deductions/subtraction.
* @param amount The amount of tokens to create.
*/
function destroyTokensFrom(uint amount, address from) public onlyPopulous returns (bool success) {
if (balances[from] < amount) {
return false;
} else {
balances[from] = safeSub(balances[from], amount);
totalSupply = safeSub(totalSupply, amount);
return true;
}
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value);
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
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];
}
// ACCESS MANAGER
/** @dev Checks a given address to determine whether it is populous address.
* @param sender The address to be checked.
* @return bool returns true or false is the address corresponds to populous or not.
*/
function isPopulous(address sender) public view returns (bool) {
return sender == populous;
}
/** @dev Changes the populous contract address.
* @dev The method requires the message sender to be the set server.
* @param _populous The address to be set as populous.
*/
function changePopulous(address _populous) public {
require(isServer(msg.sender) == true);
populous = _populous;
}
// CONSTANT METHODS
/** @dev Checks a given address to determine whether it is the server.
* @param sender The address to be checked.
* @return bool returns true or false is the address corresponds to the server or not.
*/
function isServer(address sender) public view returns (bool) {
return sender == server;
}
/** @dev Changes the server address that is set by the constructor.
* @dev The method requires the message sender to be the set server.
* @param _server The new address to be set as the server.
*/
function changeServer(address _server) public {
require(isServer(msg.sender) == true);
server = _server;
}
// SAFE MATH
/** @dev Safely multiplies two unsigned/non-negative integers.
* @dev Ensures that one of both numbers can be derived from dividing the product by the other.
* @param a The first number.
* @param b The second number.
* @return uint The expected result.
*/
function safeMul(uint a, uint b) internal pure returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
/** @dev Safely subtracts one number from another
* @dev Ensures that the number to subtract is lower.
* @param a The first number.
* @param b The second number.
* @return uint The expected result.
*/
function safeSub(uint a, uint b) internal pure returns (uint) {
assert(b <= a);
return a - b;
}
/** @dev Safely adds two unsigned/non-negative integers.
* @dev Ensures that the sum of both numbers is greater or equal to one of both.
* @param a The first number.
* @param b The second number.
* @return uint The expected result.
*/
function safeAdd(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[{"name":"amount","type":"uint256"},{"name":"from","type":"address"}],"name":"destroyTokensFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"sender","type":"address"}],"name":"isPopulous","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_server","type":"address"}],"name":"changeServer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"destroyTokens","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"populous","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_populous","type":"address"}],"name":"changePopulous","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"server","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"sender","type":"address"}],"name":"isServer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}]Contract Creation Code
6060604052341561000f57600080fd5b600080547363d509f7152769ddf162ed048b83719fe1e31080600160a060020a03199182168117808455600180549093169091179091556347425070600381905560055560048054600660ff199091168117909155600160a060020a039091168252602052604090205461009790662386f26fc100006401000000006100d9810261082e1704565b60008054600160a060020a03168152600660205260409020556002546100d190662386f26fc1000064010000000061082e6100d982021704565b6002556100fd565b60008282018381108015906100ee5750828110155b15156100f657fe5b9392505050565b61087e8061010c6000396000f300606060405236156101045763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630156b323811461010957806305fd22d01461013f57806306fdde031461015e57806308fb8a8814610183578063095ea7b3146101a457806318160ddd146101c657806323b872dd146101d957806327e235e314610201578063313ce567146102205780635c6581651461024957806367fbd2891461026e57806370a082311461028457806394a3760f146102a357806395d89b41146102d2578063a9059cbb146102e5578063da37415714610307578063dd62ed3e14610326578063fd922a421461034b578063fda089581461035e575b600080fd5b341561011457600080fd5b61012b600435600160a060020a036024351661037d565b604051901515815260200160405180910390f35b341561014a57600080fd5b61012b600160a060020a0360043516610415565b341561016957600080fd5b61017161042c565b60405190815260200160405180910390f35b341561018e57600080fd5b6101a2600160a060020a0360043516610432565b005b34156101af57600080fd5b61012b600160a060020a0360043516602435610478565b34156101d157600080fd5b6101716104e4565b34156101e457600080fd5b61012b600160a060020a03600435811690602435166044356104ea565b341561020c57600080fd5b610171600160a060020a03600435166105f0565b341561022b57600080fd5b610233610602565b60405160ff909116815260200160405180910390f35b341561025457600080fd5b610171600160a060020a036004358116906024351661060b565b341561027957600080fd5b61012b600435610628565b341561028f57600080fd5b610171600160a060020a03600435166106c4565b34156102ae57600080fd5b6102b66106df565b604051600160a060020a03909116815260200160405180910390f35b34156102dd57600080fd5b6101716106ee565b34156102f057600080fd5b61012b600160a060020a03600435166024356106f4565b341561031257600080fd5b6101a2600160a060020a0360043516610788565b341561033157600080fd5b610171600160a060020a03600435811690602435166107ce565b341561035657600080fd5b6102b66107f9565b341561036957600080fd5b61012b600160a060020a0360043516610808565b600061038833610415565b151560011461039657600080fd5b600160a060020a038216600090815260066020526040902054839010156103bf5750600061040f565b600160a060020a0382166000908152600660205260409020546103e2908461081c565b600160a060020a038316600090815260066020526040902055600254610408908461081c565b6002555060015b92915050565b600154600160a060020a038281169116145b919050565b60035481565b61043b33610808565b151560011461044957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260076020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025481565b600160a060020a03808416600081815260076020908152604080832033909516835293815283822054928252600690529182205483901080159061052e5750828110155b151561053957600080fd5b600160a060020a038085166000908152600660205260408082208054870190559187168152208054849003905560001981101561059e57600160a060020a03808616600090815260076020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405190815260200160405180910390a3506001949350505050565b60066020526000908152604090205481565b60045460ff1681565b600760209081526000928352604080842090915290825290205481565b600061063333610415565b151560011461064157600080fd5b600154600160a060020a03166000908152600660205260409020548290101561066c57506000610427565b600154600160a060020a0316600090815260066020526040902054610691908361081c565b600154600160a060020a03166000908152600660205260409020556002546106b9908361081c565b600255506001610427565b600160a060020a031660009081526006602052604090205490565b600154600160a060020a031681565b60055481565b600160a060020a0333166000908152600660205260408120548290101561071a57600080fd5b600160a060020a033381166000818152600660205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b61079133610808565b151560011461079f57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b600054600160a060020a031681565b600054600160a060020a0390811691161490565b60008282111561082857fe5b50900390565b60008282018381108015906108435750828110155b151561084b57fe5b93925050505600a165627a7a72305820e21e1ce4b86783645be76f25d7e059286c66488455931b95f266914bef64d5ba0029
Deployed Bytecode
0x606060405236156101045763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630156b323811461010957806305fd22d01461013f57806306fdde031461015e57806308fb8a8814610183578063095ea7b3146101a457806318160ddd146101c657806323b872dd146101d957806327e235e314610201578063313ce567146102205780635c6581651461024957806367fbd2891461026e57806370a082311461028457806394a3760f146102a357806395d89b41146102d2578063a9059cbb146102e5578063da37415714610307578063dd62ed3e14610326578063fd922a421461034b578063fda089581461035e575b600080fd5b341561011457600080fd5b61012b600435600160a060020a036024351661037d565b604051901515815260200160405180910390f35b341561014a57600080fd5b61012b600160a060020a0360043516610415565b341561016957600080fd5b61017161042c565b60405190815260200160405180910390f35b341561018e57600080fd5b6101a2600160a060020a0360043516610432565b005b34156101af57600080fd5b61012b600160a060020a0360043516602435610478565b34156101d157600080fd5b6101716104e4565b34156101e457600080fd5b61012b600160a060020a03600435811690602435166044356104ea565b341561020c57600080fd5b610171600160a060020a03600435166105f0565b341561022b57600080fd5b610233610602565b60405160ff909116815260200160405180910390f35b341561025457600080fd5b610171600160a060020a036004358116906024351661060b565b341561027957600080fd5b61012b600435610628565b341561028f57600080fd5b610171600160a060020a03600435166106c4565b34156102ae57600080fd5b6102b66106df565b604051600160a060020a03909116815260200160405180910390f35b34156102dd57600080fd5b6101716106ee565b34156102f057600080fd5b61012b600160a060020a03600435166024356106f4565b341561031257600080fd5b6101a2600160a060020a0360043516610788565b341561033157600080fd5b610171600160a060020a03600435811690602435166107ce565b341561035657600080fd5b6102b66107f9565b341561036957600080fd5b61012b600160a060020a0360043516610808565b600061038833610415565b151560011461039657600080fd5b600160a060020a038216600090815260066020526040902054839010156103bf5750600061040f565b600160a060020a0382166000908152600660205260409020546103e2908461081c565b600160a060020a038316600090815260066020526040902055600254610408908461081c565b6002555060015b92915050565b600154600160a060020a038281169116145b919050565b60035481565b61043b33610808565b151560011461044957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260076020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025481565b600160a060020a03808416600081815260076020908152604080832033909516835293815283822054928252600690529182205483901080159061052e5750828110155b151561053957600080fd5b600160a060020a038085166000908152600660205260408082208054870190559187168152208054849003905560001981101561059e57600160a060020a03808616600090815260076020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405190815260200160405180910390a3506001949350505050565b60066020526000908152604090205481565b60045460ff1681565b600760209081526000928352604080842090915290825290205481565b600061063333610415565b151560011461064157600080fd5b600154600160a060020a03166000908152600660205260409020548290101561066c57506000610427565b600154600160a060020a0316600090815260066020526040902054610691908361081c565b600154600160a060020a03166000908152600660205260409020556002546106b9908361081c565b600255506001610427565b600160a060020a031660009081526006602052604090205490565b600154600160a060020a031681565b60055481565b600160a060020a0333166000908152600660205260408120548290101561071a57600080fd5b600160a060020a033381166000818152600660205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b61079133610808565b151560011461079f57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b600054600160a060020a031681565b600054600160a060020a0390811691161490565b60008282111561082857fe5b50900390565b60008282018381108015906108435750828110155b151561084b57fe5b93925050505600a165627a7a72305820e21e1ce4b86783645be76f25d7e059286c66488455931b95f266914bef64d5ba0029
Swarm Source
bzzr://e21e1ce4b86783645be76f25d7e059286c66488455931b95f266914bef64d5ba
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.
Add Token to MetaMask (Web3)