Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Overview
Max Total Supply
501,268,000.955135 SGG
Holders
686
Market
Onchain Market Cap
$0.00
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:
SggCoin
Compiler Version
v0.4.13+commit.fb4cb1a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-08-10 */ pragma solidity ^0.4.11; library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } function assert(bool assertion) internal { if (!assertion) { throw; } } } contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } contract Pausable is Ownable { bool public stopped; modifier stopInEmergency { if (stopped) { throw; } _; } modifier onlyInEmergency { if (!stopped) { throw; } _; } // called by the owner on emergency, triggers stopped state function emergencyStop() external onlyOwner { stopped = true; } // called by the owner on end of emergency, returns to normal state function release() external onlyOwner onlyInEmergency { stopped = false; } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint); function transferFrom(address from, address to, uint value); function approve(address spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract PullPayment { using SafeMath for uint; mapping(address => uint) public payments; event LogRefundETH(address to, uint value); /** * Store sent amount as credit to be pulled, called by payer **/ function asyncSend(address dest, uint amount) internal { payments[dest] = payments[dest].add(amount); } // withdraw accumulated balance, called by payee function withdrawPayments() { address payee = msg.sender; uint payment = payments[payee]; if (payment == 0) { throw; } if (this.balance < payment) { throw; } payments[payee] = 0; if (!payee.send(payment)) { throw; } LogRefundETH(payee,payment); } } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /* * Fix for the ERC20 short address attack */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size + 4) { throw; } _; } function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); } function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } function approve(address _spender, uint _value) { // 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 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } } contract SggCoin is StandardToken, Ownable { string public constant name = "SggCoin"; string public constant symbol = "SGG"; uint public constant decimals = 6; // Constructor function SggCoin() { totalSupply = 1000000000000000; // one billion balances[msg.sender] = totalSupply; // Send all tokens to owner } /** * Burn away the specified amount of SggCoin tokens */ function burn(uint _value) onlyOwner returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Transfer(msg.sender, 0x0, _value); return true; } } /* Crowdsale Smart Contract for the StuffGoGo Project Created and deployed by DAAPPS company This smart contract collects ETH, and in return emits SggCoin tokens to the backers */ contract Crowdsale is Pausable, PullPayment { using SafeMath for uint; struct Backer { uint weiReceived; // Amount of Ether given uint coinSent; } /* * Constants */ uint public constant MIN_CAP = 5000000000; // min: 5,000 SggCoins = 1 eth uint public constant MAX_CAP = 500000000000000; // max: 500,000,000 SggCoins = 100000 eth uint public constant MIN_INVEST_ETHER = 100 finney; // 0.1 eth uint private constant CROWDSALE_PERIOD = 28 days; // 4 weeks uint public constant COIN_PER_ETHER = 5000000000; // 5,000 SggCoins/ETH /* * Variables */ /* SggCoin contract reference */ SggCoin public coin; /* Multisig contract that will receive the Ether */ address public multisigEther; /* Number of Ether received */ uint public etherReceived; /* Number of SggCoins sent to Ether contributors */ uint public coinSentToEther; /* Crowdsale start time */ uint public startTime; /* Crowdsale end time */ uint public endTime; /* Is crowdsale still on going */ bool public crowdsaleClosed; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public backers; /* * Modifiers */ modifier minCapNotReached() { if ((now < endTime) || coinSentToEther >= MIN_CAP ) throw; _; } modifier respectTimeFrame() { if ((now < startTime) || (now > endTime )) throw; _; } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale(address _SggCoinAddress, address _to) { coin = SggCoin(_SggCoinAddress); multisigEther = _to; } /* * The fallback function corresponds to a donation in ETH */ function() stopInEmergency respectTimeFrame payable { receiveETH(msg.sender); } /* * To call to start the crowdsale */ function start() onlyOwner { if (startTime != 0) throw; // Crowdsale was already started startTime = now ; endTime = now + CROWDSALE_PERIOD; } /* * Receives a donation in Ether */ function receiveETH(address beneficiary) internal { if (msg.value < MIN_INVEST_ETHER) throw; // Don't accept funding under a predefined threshold uint coinToSend = bonus(msg.value.mul(COIN_PER_ETHER).div(1 ether)); // Compute the number of SggCoin to send if (coinToSend.add(coinSentToEther) > MAX_CAP) throw; Backer backer = backers[beneficiary]; coin.transfer(beneficiary, coinToSend); // Transfer SggCoins right now backer.coinSent = backer.coinSent.add(coinToSend); backer.weiReceived = backer.weiReceived.add(msg.value); // Update the total wei collected during the crowdfunding for this backer etherReceived = etherReceived.add(msg.value); // Update the total wei collected during the crowdfunding coinSentToEther = coinSentToEther.add(coinToSend); // Send events LogCoinsEmited(msg.sender ,coinToSend); LogReceivedETH(beneficiary, etherReceived); } /* *Compute the SggCoin bonus according to the investment period */ function bonus(uint amount) internal constant returns (uint) { if (now < startTime.add(2 days)) return amount.add(amount.div(5)); // bonus 20% return amount; } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { if (now < endTime) { // Cannot finalise before CROWDSALE_PERIOD or before selling all coins if (coinSentToEther == MAX_CAP) { } else { throw; } } if (coinSentToEther < MIN_CAP && now < endTime + 15 days) throw; // If MIN_CAP is not reached donors have 15days to get refund before we can finalise if (!multisigEther.send(this.balance)) throw; // Move the remaining Ether to the multisig address uint remains = coin.balanceOf(this); if (remains > 0) { // Burn the rest of SggCoins if (!coin.burn(remains)) throw ; } crowdsaleClosed = true; } /* * Failsafe drain */ function drain() onlyOwner { if (!owner.send(this.balance)) throw; } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisig(address addr) onlyOwner public { if (addr == address(0)) throw; multisigEther = addr; } /** * Manually back SggCoin owner address. */ function backSggCoinOwner() onlyOwner public { coin.transferOwnership(owner); } /** * Transfer remains to owner in case if impossible to do min invest */ function getRemainCoins() onlyOwner public { var remains = MAX_CAP - coinSentToEther; uint minCoinsToSell = bonus(MIN_INVEST_ETHER.mul(COIN_PER_ETHER) / (1 ether)); if(remains > minCoinsToSell) throw; Backer backer = backers[owner]; coin.transfer(owner, remains); // Transfer SggCoins right now backer.coinSent = backer.coinSent.add(remains); coinSentToEther = coinSentToEther.add(remains); // Send events LogCoinsEmited(this ,remains); LogReceivedETH(owner, etherReceived); } /* * When MIN_CAP is not reach: * 1) backer call the "approve" function of the SggCoin token contract with the amount of all SggCoins they got in order to be refund * 2) backer call the "refund" function of the Crowdsale contract with the same amount of SggCoins * 3) backer call the "withdrawPayments" function of the Crowdsale contract to get a refund in ETH */ function refund(uint _value) minCapNotReached public { if (_value != backers[msg.sender].coinSent) throw; // compare value from backer balance coin.transferFrom(msg.sender, address(this), _value); // get the token back to the crowdsale contract if (!coin.burn(_value)) throw ; // token sent for refund are burnt uint ETHToSend = backers[msg.sender].weiReceived; backers[msg.sender].weiReceived=0; if (ETHToSend > 0) { asyncSend(msg.sender, ETHToSend); // pull payment to get refund in ETH } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"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"},{"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"}]
Contract Creation Code
6060604052341561000f57600080fd5b5b5b60038054600160a060020a03191633600160a060020a03161790555b66038d7ea4c680006000818155600160a060020a0333168152600160205260409020555b5b61085f806100616000396000f300606060405236156100b75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100bc578063095ea7b31461014757806318160ddd1461016b57806323b872dd14610190578063313ce567146101ba57806342966c68146101df57806370a08231146102095780638da5cb5b1461023a57806395d89b4114610269578063a9059cbb146102f4578063dd62ed3e14610318578063f2fde38b1461034f575b600080fd5b34156100c757600080fd5b6100cf610370565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015257600080fd5b610169600160a060020a03600435166024356103a7565b005b341561017657600080fd5b61017e610449565b60405190815260200160405180910390f35b341561019b57600080fd5b610169600160a060020a036004358116906024351660443561044f565b005b34156101c557600080fd5b61017e610572565b60405190815260200160405180910390f35b34156101ea57600080fd5b6101f5600435610577565b604051901515815260200160405180910390f35b341561021457600080fd5b61017e600160a060020a0360043516610637565b60405190815260200160405180910390f35b341561024557600080fd5b61024d610656565b604051600160a060020a03909116815260200160405180910390f35b341561027457600080fd5b6100cf610665565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102ff57600080fd5b610169600160a060020a036004351660243561069c565b005b341561032357600080fd5b61017e600160a060020a0360043581169060243516610769565b60405190815260200160405180910390f35b341561035a57600080fd5b610169600160a060020a0360043516610796565b005b60408051908101604052600781527f536767436f696e00000000000000000000000000000000000000000000000000602082015281565b80158015906103da5750600160a060020a0333811660009081526002602090815260408083209386168352929052205415155b156103e457600080fd5b600160a060020a03338116600081815260026020908152604080832094871680845294909152908190208490557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b5050565b60005481565b60006060606436101561046157600080fd5b600160a060020a0380861660009081526002602090815260408083203385168452825280832054938816835260019091529020549092506104a8908463ffffffff6107ee16565b600160a060020a0380861660009081526001602052604080822093909355908716815220546104dd908463ffffffff61080a16565b600160a060020a038616600090815260016020526040902055610506828463ffffffff61080a16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a35b5b5050505050565b600681565b60035460009033600160a060020a0390811691161461059557600080fd5b600160a060020a0333166000908152600160205260409020546105be908363ffffffff61080a16565b600160a060020a033316600090815260016020526040812091909155546105eb908363ffffffff61080a16565b6000908155600160a060020a0333167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060015b5b919050565b600160a060020a0381166000908152600160205260409020545b919050565b600354600160a060020a031681565b60408051908101604052600381527f5347470000000000000000000000000000000000000000000000000000000000602082015281565b604060443610156106ac57600080fd5b600160a060020a0333166000908152600160205260409020546106d5908363ffffffff61080a16565b600160a060020a03338116600090815260016020526040808220939093559085168152205461070a908363ffffffff6107ee16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35b5b505050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a039081169116146107b157600080fd5b600160a060020a038116156107e9576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60008282016107ff84821015610823565b8091505b5092915050565b600061081883831115610823565b508082035b92915050565b8015156107e957600080fd5b5b505600a165627a7a7230582038c8c3d7c70ff23f8cc842b742ab6061fd2f63f6f8af375c2d06076a3dab86680029
Deployed Bytecode
0x606060405236156100b75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100bc578063095ea7b31461014757806318160ddd1461016b57806323b872dd14610190578063313ce567146101ba57806342966c68146101df57806370a08231146102095780638da5cb5b1461023a57806395d89b4114610269578063a9059cbb146102f4578063dd62ed3e14610318578063f2fde38b1461034f575b600080fd5b34156100c757600080fd5b6100cf610370565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015257600080fd5b610169600160a060020a03600435166024356103a7565b005b341561017657600080fd5b61017e610449565b60405190815260200160405180910390f35b341561019b57600080fd5b610169600160a060020a036004358116906024351660443561044f565b005b34156101c557600080fd5b61017e610572565b60405190815260200160405180910390f35b34156101ea57600080fd5b6101f5600435610577565b604051901515815260200160405180910390f35b341561021457600080fd5b61017e600160a060020a0360043516610637565b60405190815260200160405180910390f35b341561024557600080fd5b61024d610656565b604051600160a060020a03909116815260200160405180910390f35b341561027457600080fd5b6100cf610665565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102ff57600080fd5b610169600160a060020a036004351660243561069c565b005b341561032357600080fd5b61017e600160a060020a0360043581169060243516610769565b60405190815260200160405180910390f35b341561035a57600080fd5b610169600160a060020a0360043516610796565b005b60408051908101604052600781527f536767436f696e00000000000000000000000000000000000000000000000000602082015281565b80158015906103da5750600160a060020a0333811660009081526002602090815260408083209386168352929052205415155b156103e457600080fd5b600160a060020a03338116600081815260026020908152604080832094871680845294909152908190208490557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b5050565b60005481565b60006060606436101561046157600080fd5b600160a060020a0380861660009081526002602090815260408083203385168452825280832054938816835260019091529020549092506104a8908463ffffffff6107ee16565b600160a060020a0380861660009081526001602052604080822093909355908716815220546104dd908463ffffffff61080a16565b600160a060020a038616600090815260016020526040902055610506828463ffffffff61080a16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a35b5b5050505050565b600681565b60035460009033600160a060020a0390811691161461059557600080fd5b600160a060020a0333166000908152600160205260409020546105be908363ffffffff61080a16565b600160a060020a033316600090815260016020526040812091909155546105eb908363ffffffff61080a16565b6000908155600160a060020a0333167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060015b5b919050565b600160a060020a0381166000908152600160205260409020545b919050565b600354600160a060020a031681565b60408051908101604052600381527f5347470000000000000000000000000000000000000000000000000000000000602082015281565b604060443610156106ac57600080fd5b600160a060020a0333166000908152600160205260409020546106d5908363ffffffff61080a16565b600160a060020a03338116600090815260016020526040808220939093559085168152205461070a908363ffffffff6107ee16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35b5b505050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a039081169116146107b157600080fd5b600160a060020a038116156107e9576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60008282016107ff84821015610823565b8091505b5092915050565b600061081883831115610823565b508082035b92915050565b8015156107e957600080fd5b5b505600a165627a7a7230582038c8c3d7c70ff23f8cc842b742ab6061fd2f63f6f8af375c2d06076a3dab86680029
Swarm Source
bzzr://38c8c3d7c70ff23f8cc842b742ab6061fd2f63f6f8af375c2d06076a3dab8668
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.