ERC-20
Energy Sector
Overview
Max Total Supply
1,177,767.8985 SDAO
Holders
628 (0.00%)
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 4 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
SolarDaoToken
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-07-26 */ pragma solidity ^0.4.13; /// @title Ownable contract - base contract with an owner /// @author [email protected] contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /// @title Haltable contract - abstract contract that allows children to implement an emergency stop mechanism. /// @author [email protected] /// Originally envisioned in FirstBlood ICO contract. contract Haltable is Ownable { bool public halted; modifier stopInEmergency { require(!halted); _; } modifier onlyInEmergency { require(halted); _; } /// called by the owner on emergency, triggers stopped state function halt() external onlyOwner { halted = true; } /// called by the owner on end of emergency, returns to normal state function unhalt() external onlyOwner onlyInEmergency { halted = false; } } /// @title ERC20 interface see https://github.com/ethereum/EIPs/issues/20 /// @author [email protected] contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function mint(address receiver, uint amount); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /// @title SafeMath contract - math operations with safety checks /// @author [email protected] contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); 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 { require(assertion); } } /// @title SolarDaoToken contract - standard ERC20 token with Short Hand Attack and approve() race condition mitigation. /// @author [email protected] contract SolarDaoToken is SafeMath, ERC20, Ownable { string public name = "Solar DAO Token"; string public symbol = "SDAO"; uint public decimals = 4; /// contract that is allowed to create new tokens and allows unlift the transfer limits on this token address public crowdsaleAgent; /// A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period. bool public released = false; /// approve() allowances mapping (address => mapping (address => uint)) allowed; /// holder balances mapping(address => uint) balances; /// @dev Limit token transfer until the crowdsale is over. modifier canTransfer() { if(!released) { require(msg.sender == crowdsaleAgent); } _; } /// @dev The function can be called only before or after the tokens have been releasesd /// @param _released token transfer and mint state modifier inReleaseState(bool _released) { require(_released == released); _; } /// @dev The function can be called only by release agent. modifier onlyCrowdsaleAgent() { require(msg.sender == crowdsaleAgent); _; } /// @dev Fix for the ERC20 short address attack http://vessenes.com/the-erc20-short-address-attack-explained/ /// @param size payload size modifier onlyPayloadSize(uint size) { require(msg.data.length >= size + 4); _; } /// @dev Make sure we are not done yet. modifier canMint() { require(!released); _; } /// @dev Constructor function SolarDaoToken() { owner = msg.sender; } /// Fallback method will buyout tokens function() payable { revert(); } /// @dev Create new tokens and allocate them to an address. Only callably by a crowdsale contract /// @param receiver Address of receiver /// @param amount Number of tokens to issue. function mint(address receiver, uint amount) onlyCrowdsaleAgent canMint public { totalSupply = safeAdd(totalSupply, amount); balances[receiver] = safeAdd(balances[receiver], amount); Transfer(0, receiver, amount); } /// @dev Set the contract that can call release and make the token transferable. /// @param _crowdsaleAgent crowdsale contract address function setCrowdsaleAgent(address _crowdsaleAgent) onlyOwner inReleaseState(false) public { crowdsaleAgent = _crowdsaleAgent; } /// @dev One way function to release the tokens to the wild. Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). function releaseTokenTransfer() public onlyCrowdsaleAgent { released = true; } /// @dev Tranfer tokens to address /// @param _to dest address /// @param _value tokens amount /// @return transfer result function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) canTransfer returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); Transfer(msg.sender, _to, _value); return true; } /// @dev Tranfer tokens from one address to other /// @param _from source address /// @param _to dest address /// @param _value tokens amount /// @return transfer result function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(2 * 32) canTransfer returns (bool success) { var _allowance = allowed[_from][msg.sender]; balances[_to] = safeAdd(balances[_to], _value); balances[_from] = safeSub(balances[_from], _value); allowed[_from][msg.sender] = safeSub(_allowance, _value); Transfer(_from, _to, _value); return true; } /// @dev Tokens balance /// @param _owner holder address /// @return balance amount function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } /// @dev Approve transfer /// @param _spender holder address /// @param _value tokens amount /// @return result function approve(address _spender, uint _value) returns (bool success) { // 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 require ((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /// @dev Token allowance /// @param _owner holder address /// @param _spender spender address /// @return remain amount function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } }
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":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"crowdsaleAgent","outputs":[{"name":"","type":"address"}],"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":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_crowdsaleAgent","type":"address"}],"name":"setCrowdsaleAgent","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"receiver","type":"address"},{"name":"amount","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"releaseTokenTransfer","outputs":[],"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":true,"inputs":[],"name":"released","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"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"},{"payable":true,"type":"fallback"},{"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
606060405260408051908101604052600f81527f536f6c61722044414f20546f6b656e00000000000000000000000000000000006020820152600290805161004b9291602001906100f2565b5060408051908101604052600481527f5344414f00000000000000000000000000000000000000000000000000000000602082015260039080516100939291602001906100f2565b50600480556005805460a060020a60ff021916905534156100b357600080fd5b5b5b60018054600160a060020a03191633600160a060020a03161790555b60018054600160a060020a03191633600160a060020a03161790555b610192565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061013357805160ff1916838001178555610160565b82800160010185558215610160579182015b82811115610160578251825591602001919060010190610145565b5b5061016d929150610171565b5090565b61018f91905b8082111561016d5760008155600101610177565b5090565b90565b610b42806101a16000396000f300606060405236156100e35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f0578063095ea7b31461017b5780630b7d6320146101b157806318160ddd146101e057806323b872dd14610205578063313ce5671461024157806334103ee41461026657806340c10f19146102875780635f412d4f146102ab57806370a08231146102c05780638da5cb5b146102f157806395d89b411461032057806396132521146103ab578063a9059cbb146103d2578063dd62ed3e14610408578063f2fde38b1461043f575b6100ee5b600080fd5b565b005b34156100fb57600080fd5b610103610460565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101405780820151818401525b602001610127565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018657600080fd5b61019d600160a060020a03600435166024356104fe565b604051901515815260200160405180910390f35b34156101bc57600080fd5b6101c46105a5565b604051600160a060020a03909116815260200160405180910390f35b34156101eb57600080fd5b6101f36105b4565b60405190815260200160405180910390f35b341561021057600080fd5b61019d600160a060020a03600435811690602435166044356105ba565b604051901515815260200160405180910390f35b341561024c57600080fd5b6101f3610702565b60405190815260200160405180910390f35b341561027157600080fd5b6100ee600160a060020a0360043516610708565b005b341561029257600080fd5b6100ee600160a060020a036004351660243561076c565b005b34156102b657600080fd5b6100ee610828565b005b34156102cb57600080fd5b6101f3600160a060020a036004351661086b565b60405190815260200160405180910390f35b34156102fc57600080fd5b6101c461088a565b604051600160a060020a03909116815260200160405180910390f35b341561032b57600080fd5b610103610899565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101405780820151818401525b602001610127565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103b657600080fd5b61019d610937565b604051901515815260200160405180910390f35b34156103dd57600080fd5b61019d600160a060020a0360043516602435610947565b604051901515815260200160405180910390f35b341561041357600080fd5b6101f3600160a060020a0360043581169060243516610a40565b60405190815260200160405180910390f35b341561044a57600080fd5b6100ee600160a060020a0360043516610a6d565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104f65780601f106104cb576101008083540402835291602001916104f6565b820191906000526020600020905b8154815290600101906020018083116104d957829003601f168201915b505050505081565b60008115806105305750600160a060020a03338116600090815260066020908152604080832093871683529290522054155b151561053b57600080fd5b600160a060020a03338116600081815260066020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600554600160a060020a031681565b60005481565b600080604060443610156105cd57600080fd5b60055460a060020a900460ff1615156105fb5760055433600160a060020a039081169116146105fb57600080fd5b5b600160a060020a03808716600090815260066020908152604080832033851684528252808320549389168352600790915290205490925061063d9085610ac5565b600160a060020a03808716600090815260076020526040808220939093559088168152205461066c9085610aed565b600160a060020a03871660009081526007602052604090205561068f8285610aed565b600160a060020a03808816600081815260066020908152604080832033861684529091529081902093909355908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9087905190815260200160405180910390a3600192505b5b5b50509392505050565b60045481565b60015433600160a060020a0390811691161461072357600080fd5b60055460009060a060020a900460ff161561073d57600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b505b50565b60055433600160a060020a0390811691161461078757600080fd5b60055460a060020a900460ff161561079e57600080fd5b6107aa60005482610ac5565b6000908155600160a060020a0383168152600760205260409020546107cf9082610ac5565b600160a060020a0383166000818152600760205260408082209390935590917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35b5b5b5050565b60055433600160a060020a0390811691161461084357600080fd5b6005805474ff0000000000000000000000000000000000000000191660a060020a1790555b5b565b600160a060020a0381166000908152600760205260409020545b919050565b600154600160a060020a031681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104f65780601f106104cb576101008083540402835291602001916104f6565b820191906000526020600020905b8154815290600101906020018083116104d957829003601f168201915b505050505081565b60055460a060020a900460ff1681565b60006040604436101561095957600080fd5b60055460a060020a900460ff1615156109875760055433600160a060020a0390811691161461098757600080fd5b5b600160a060020a0333166000908152600760205260409020546109ab9084610aed565b600160a060020a0333811660009081526007602052604080822093909355908616815220546109da9084610ac5565b600160a060020a0380861660008181526007602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b5b5b5092915050565b600160a060020a038083166000908152600660209081526040808320938516835292905220545b92915050565b60015433600160a060020a03908116911614610a8857600080fd5b600160a060020a03811615610769576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b6000828201610ae2848210801590610add5750838210155b610b06565b8091505b5092915050565b6000610afb83831115610b06565b508082035b92915050565b80151561076957600080fd5b5b505600a165627a7a723058202b729e5a0a38853899d23bd569b31a3a0f654a02ab6056fe94b1b3ad48c73f360029
Deployed Bytecode
0x606060405236156100e35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f0578063095ea7b31461017b5780630b7d6320146101b157806318160ddd146101e057806323b872dd14610205578063313ce5671461024157806334103ee41461026657806340c10f19146102875780635f412d4f146102ab57806370a08231146102c05780638da5cb5b146102f157806395d89b411461032057806396132521146103ab578063a9059cbb146103d2578063dd62ed3e14610408578063f2fde38b1461043f575b6100ee5b600080fd5b565b005b34156100fb57600080fd5b610103610460565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101405780820151818401525b602001610127565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018657600080fd5b61019d600160a060020a03600435166024356104fe565b604051901515815260200160405180910390f35b34156101bc57600080fd5b6101c46105a5565b604051600160a060020a03909116815260200160405180910390f35b34156101eb57600080fd5b6101f36105b4565b60405190815260200160405180910390f35b341561021057600080fd5b61019d600160a060020a03600435811690602435166044356105ba565b604051901515815260200160405180910390f35b341561024c57600080fd5b6101f3610702565b60405190815260200160405180910390f35b341561027157600080fd5b6100ee600160a060020a0360043516610708565b005b341561029257600080fd5b6100ee600160a060020a036004351660243561076c565b005b34156102b657600080fd5b6100ee610828565b005b34156102cb57600080fd5b6101f3600160a060020a036004351661086b565b60405190815260200160405180910390f35b34156102fc57600080fd5b6101c461088a565b604051600160a060020a03909116815260200160405180910390f35b341561032b57600080fd5b610103610899565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101405780820151818401525b602001610127565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103b657600080fd5b61019d610937565b604051901515815260200160405180910390f35b34156103dd57600080fd5b61019d600160a060020a0360043516602435610947565b604051901515815260200160405180910390f35b341561041357600080fd5b6101f3600160a060020a0360043581169060243516610a40565b60405190815260200160405180910390f35b341561044a57600080fd5b6100ee600160a060020a0360043516610a6d565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104f65780601f106104cb576101008083540402835291602001916104f6565b820191906000526020600020905b8154815290600101906020018083116104d957829003601f168201915b505050505081565b60008115806105305750600160a060020a03338116600090815260066020908152604080832093871683529290522054155b151561053b57600080fd5b600160a060020a03338116600081815260066020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600554600160a060020a031681565b60005481565b600080604060443610156105cd57600080fd5b60055460a060020a900460ff1615156105fb5760055433600160a060020a039081169116146105fb57600080fd5b5b600160a060020a03808716600090815260066020908152604080832033851684528252808320549389168352600790915290205490925061063d9085610ac5565b600160a060020a03808716600090815260076020526040808220939093559088168152205461066c9085610aed565b600160a060020a03871660009081526007602052604090205561068f8285610aed565b600160a060020a03808816600081815260066020908152604080832033861684529091529081902093909355908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9087905190815260200160405180910390a3600192505b5b5b50509392505050565b60045481565b60015433600160a060020a0390811691161461072357600080fd5b60055460009060a060020a900460ff161561073d57600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b505b50565b60055433600160a060020a0390811691161461078757600080fd5b60055460a060020a900460ff161561079e57600080fd5b6107aa60005482610ac5565b6000908155600160a060020a0383168152600760205260409020546107cf9082610ac5565b600160a060020a0383166000818152600760205260408082209390935590917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35b5b5b5050565b60055433600160a060020a0390811691161461084357600080fd5b6005805474ff0000000000000000000000000000000000000000191660a060020a1790555b5b565b600160a060020a0381166000908152600760205260409020545b919050565b600154600160a060020a031681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104f65780601f106104cb576101008083540402835291602001916104f6565b820191906000526020600020905b8154815290600101906020018083116104d957829003601f168201915b505050505081565b60055460a060020a900460ff1681565b60006040604436101561095957600080fd5b60055460a060020a900460ff1615156109875760055433600160a060020a0390811691161461098757600080fd5b5b600160a060020a0333166000908152600760205260409020546109ab9084610aed565b600160a060020a0333811660009081526007602052604080822093909355908616815220546109da9084610ac5565b600160a060020a0380861660008181526007602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b5b5b5092915050565b600160a060020a038083166000908152600660209081526040808320938516835292905220545b92915050565b60015433600160a060020a03908116911614610a8857600080fd5b600160a060020a03811615610769576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b6000828201610ae2848210801590610add5750838210155b610b06565b8091505b5092915050565b6000610afb83831115610b06565b508082035b92915050565b80151561076957600080fd5b5b505600a165627a7a723058202b729e5a0a38853899d23bd569b31a3a0f654a02ab6056fe94b1b3ad48c73f360029
Swarm Source
bzzr://2b729e5a0a38853899d23bd569b31a3a0f654a02ab6056fe94b1b3ad48c73f36
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.