contract_name
stringlengths
1
61
file_path
stringlengths
5
50.4k
contract_address
stringlengths
42
42
language
stringclasses
1 value
class_name
stringlengths
1
61
class_code
stringlengths
4
330k
class_documentation
stringlengths
0
29.1k
class_documentation_type
stringclasses
6 values
func_name
stringlengths
0
62
func_code
stringlengths
1
303k
func_documentation
stringlengths
2
14.9k
func_documentation_type
stringclasses
4 values
compiler_version
stringlengths
15
42
license_type
stringclasses
14 values
swarm_source
stringlengths
0
71
meta
dict
__index_level_0__
int64
0
60.4k
FutureCoinConnect
FutureCoinConnect.sol
0x5a16a5dc186d602c6a2ef13370517e014df54b4b
Solidity
FutureCoinConnect
contract FutureCoinConnect { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; //小数位 // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } }
/** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to s...
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
None
bzzr://c22d2561ab473844aaca4212ef8b414f9453a5ade9aebaff29d175833d30f1cf
{ "func_code_index": [ 4061, 4413 ] }
7,207
FutureCoinConnect
FutureCoinConnect.sol
0x5a16a5dc186d602c6a2ef13370517e014df54b4b
Solidity
FutureCoinConnect
contract FutureCoinConnect { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; //小数位 // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
burn
function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _val...
/** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
None
bzzr://c22d2561ab473844aaca4212ef8b414f9453a5ade9aebaff29d175833d30f1cf
{ "func_code_index": [ 4583, 4957 ] }
7,208
FutureCoinConnect
FutureCoinConnect.sol
0x5a16a5dc186d602c6a2ef13370517e014df54b4b
Solidity
FutureCoinConnect
contract FutureCoinConnect { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; //小数位 // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances ...
burnFrom
function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Sub...
/** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
None
bzzr://c22d2561ab473844aaca4212ef8b414f9453a5ade9aebaff29d175833d30f1cf
{ "func_code_index": [ 5215, 5826 ] }
7,209
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath ...
/*********************************************************** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires w...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath mul failed"); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 93, 360 ] }
7,210
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath ...
/*********************************************************** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires w...
NatSpecMultiLine
div
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; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 450, 743 ] }
7,211
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath ...
/*********************************************************** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires w...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath sub failed"); return a - b; }
/** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 867, 1052 ] }
7,212
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath ...
/*********************************************************** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires w...
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 1122, 1325 ] }
7,213
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath ...
/*********************************************************** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires w...
NatSpecMultiLine
sqrt
function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = ((add(x,1)) / 2); y = x; while (z < y) { y = z; z = ((add((x / z),z)) / 2); } }
/** * @dev gives square root of given x. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 1393, 1660 ] }
7,214
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath ...
/*********************************************************** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires w...
NatSpecMultiLine
sq
function sq(uint256 x) internal pure returns (uint256) { return (mul(x,x)); }
/** * @dev gives square. multiplies x by x */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 1730, 1858 ] }
7,215
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath ...
/*********************************************************** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires w...
NatSpecMultiLine
pwr
function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i=1; i < y; i++) z = mul(z,x); return (z); } }
/** * @dev x to the power of y */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 1917, 2288 ] }
7,216
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
NameFilter
library NameFilter { /** * @dev filters name strings * -converts uppercase to lower case. * -makes sure it does not start/end with a space * -makes sure it does not contain multiple spaces in a row * -cannot be only numbers * -cannot start with 0x * -restricts character...
/*********************************************************** * NameFilter library ***********************************************************/
NatSpecMultiLine
nameFilter
function nameFilter(string _input) internal pure returns(bytes32) { bytes memory _temp = bytes(_input); uint256 _length = _temp.length; //sorry limited to 32 characters require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters"); // make sure i...
/** * @dev filters name strings * -converts uppercase to lower case. * -makes sure it does not start/end with a space * -makes sure it does not contain multiple spaces in a row * -cannot be only numbers * -cannot start with 0x * -restricts characters to A-Z, a-z, 0-9, and space. * @return reprocessed...
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 414, 2813 ] }
7,217
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
Rich3DKeysCalc
library Rich3DKeysCalc { using SafeMath for *; /** * @dev calculates number of keys received given X eth * @param _curEth current amount of eth in contract * @param _newEth eth being spent * @return amount of ticket purchased */ function keysRec(uint256 _curEth, uint256 _n...
/*********************************************************** * Rich3DKeysCalc library ***********************************************************/
NatSpecMultiLine
keysRec
function keysRec(uint256 _curEth, uint256 _newEth) internal pure returns (uint256) { return(keys((_curEth).add(_newEth)).sub(keys(_curEth))); }
/** * @dev calculates number of keys received given X eth * @param _curEth current amount of eth in contract * @param _newEth eth being spent * @return amount of ticket purchased */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 272, 466 ] }
7,218
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
Rich3DKeysCalc
library Rich3DKeysCalc { using SafeMath for *; /** * @dev calculates number of keys received given X eth * @param _curEth current amount of eth in contract * @param _newEth eth being spent * @return amount of ticket purchased */ function keysRec(uint256 _curEth, uint256 _n...
/*********************************************************** * Rich3DKeysCalc library ***********************************************************/
NatSpecMultiLine
ethRec
function ethRec(uint256 _curKeys, uint256 _sellKeys) internal pure returns (uint256) { return((eth(_curKeys)).sub(eth(_curKeys.sub(_sellKeys)))); }
/** * @dev calculates amount of eth received if you sold X keys * @param _curKeys current amount of keys that exist * @param _sellKeys amount of keys you wish to sell * @return amount of eth received */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 713, 911 ] }
7,219
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
Rich3DKeysCalc
library Rich3DKeysCalc { using SafeMath for *; /** * @dev calculates number of keys received given X eth * @param _curEth current amount of eth in contract * @param _newEth eth being spent * @return amount of ticket purchased */ function keysRec(uint256 _curEth, uint256 _n...
/*********************************************************** * Rich3DKeysCalc library ***********************************************************/
NatSpecMultiLine
keys
function keys(uint256 _eth) internal pure returns(uint256) { return ((((((_eth).mul(1000000000000000000)).mul(312500000000000000000000000)).add(5624988281256103515625000000000000000000000000000000000000000000)).sqrt()).sub(74999921875000000000000000000000)) / (156250000); }
/** * @dev calculates how many keys would exist with given an amount of eth * @param _eth eth "in contract" * @return number of keys that would exist */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 1096, 1422 ] }
7,220
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
Rich3DKeysCalc
library Rich3DKeysCalc { using SafeMath for *; /** * @dev calculates number of keys received given X eth * @param _curEth current amount of eth in contract * @param _newEth eth being spent * @return amount of ticket purchased */ function keysRec(uint256 _curEth, uint256 _n...
/*********************************************************** * Rich3DKeysCalc library ***********************************************************/
NatSpecMultiLine
eth
function eth(uint256 _keys) internal pure returns(uint256) { return ((78125000).mul(_keys.sq()).add(((149999843750000).mul(_keys.mul(1000000000000000000))) / (2))) / ((1000000000000000000).sq()); }
/** * @dev calculates how much eth would be in contract given a number of keys * @param _keys number of keys "in contract" * @return eth that would exists */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 1617, 1868 ] }
7,221
Rich3D
Rich3D.sol
0x58232003b3d18021acfc9213d27d6f8b72f4f029
Solidity
Rich3D
contract Rich3D { using SafeMath for *; using NameFilter for string; using Rich3DKeysCalc for uint256; event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, ...
/*********************************************************** * Rich3D contract ***********************************************************/
NatSpecMultiLine
receivePlayerInfo
function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external { require (msg.sender == address(PlayerBook), "Called from PlayerBook only"); if (pIDxAddr_[_addr] != _pID) pIDxAddr_[_addr] = _pID; if (pIDxName_[_name] != _pID) pIDxName_[_name] = _pID; ...
/** interface : PlayerBookReceiverInterface */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://40422d399b0227a5218f4fd9fc5b55341072235293201478de00116e655cb1fa
{ "func_code_index": [ 23489, 24165 ] }
7,222
MIP
MIP.sol
0x5c2c871e560cf6bcaccc04ca9b78e6520372bd8d
Solidity
MIP
contract MIP is StandardToken{ string public constant name = "Movie Intellectual Property"; string public constant symbol = "MIP"; uint public constant decimals = 18; string public constant version = "1.0"; address public owner; modifier onlyOwner{ if(msg.sender != owner) thro...
function () payable{ throw; }
//refuse transactions by eth
LineComment
v0.4.11+commit.68ef5810
bzzr://7607aa501c85884d9bbfdedab7f849e4979182fb7198dfbb79f9745962b22a6d
{ "func_code_index": [ 620, 668 ] }
7,223
Metaversity
contracts/Metaversity.sol
0x4515aade4455de6fab65999efc4552e656f9d2f5
Solidity
OpenSeaGasFreeListing
library OpenSeaGasFreeListing { /** @notice Returns whether the operator is an OpenSea proxy for the owner, thus allowing it to list without the token owner paying gas. @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if this function returns true. */ function isApprove...
isApprovedForAll
function isApprovedForAll(address owner, address operator) internal view returns (bool) { ProxyRegistry registry; assembly { switch chainid() case 1 { // mainnet registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1 } case 4 { // rinkeby ...
/** @notice Returns whether the operator is an OpenSea proxy for the owner, thus allowing it to list without the token owner paying gas. @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if this function returns true. */
NatSpecMultiLine
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 298, 850 ] }
7,224
Metaversity
contracts/Metaversity.sol
0x4515aade4455de6fab65999efc4552e656f9d2f5
Solidity
Metaversity
contract Metaversity is ERC721A, Ownable { uint256 basePrice = 0.065 ether; uint256 public constant maxSupply = 5555; string private _baseTokenURI; string public provenance; // states 0: closed, 1: benefactors & presale, 3: public uint256 public saleState = 0; bytes32 public benefa...
setPrice
function setPrice(uint256 _price) public onlyOwner { basePrice = _price; }
// Setting & Getting Base Price
LineComment
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 751, 841 ] }
7,225
Metaversity
contracts/Metaversity.sol
0x4515aade4455de6fab65999efc4552e656f9d2f5
Solidity
Metaversity
contract Metaversity is ERC721A, Ownable { uint256 basePrice = 0.065 ether; uint256 public constant maxSupply = 5555; string private _baseTokenURI; string public provenance; // states 0: closed, 1: benefactors & presale, 3: public uint256 public saleState = 0; bytes32 public benefa...
setBaseURI
function setBaseURI(string memory baseURI) public onlyOwner { _baseTokenURI = baseURI; }
// Metadata
LineComment
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 954, 1058 ] }
7,226
Metaversity
contracts/Metaversity.sol
0x4515aade4455de6fab65999efc4552e656f9d2f5
Solidity
Metaversity
contract Metaversity is ERC721A, Ownable { uint256 basePrice = 0.065 ether; uint256 public constant maxSupply = 5555; string private _baseTokenURI; string public provenance; // states 0: closed, 1: benefactors & presale, 3: public uint256 public saleState = 0; bytes32 public benefa...
getSaleState
function getSaleState() external view returns (uint256) { return saleState; }
// Setting & Getting Sale State
LineComment
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 1329, 1422 ] }
7,227
Metaversity
contracts/Metaversity.sol
0x4515aade4455de6fab65999efc4552e656f9d2f5
Solidity
Metaversity
contract Metaversity is ERC721A, Ownable { uint256 basePrice = 0.065 ether; uint256 public constant maxSupply = 5555; string private _baseTokenURI; string public provenance; // states 0: closed, 1: benefactors & presale, 3: public uint256 public saleState = 0; bytes32 public benefa...
getPresaleNumMinted
function getPresaleNumMinted(address addr) external view returns (uint) { return presaleNumMinted[addr]; }
// Presale Verification Functions
LineComment
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 1661, 1784 ] }
7,228
Metaversity
contracts/Metaversity.sol
0x4515aade4455de6fab65999efc4552e656f9d2f5
Solidity
Metaversity
contract Metaversity is ERC721A, Ownable { uint256 basePrice = 0.065 ether; uint256 public constant maxSupply = 5555; string private _baseTokenURI; string public provenance; // states 0: closed, 1: benefactors & presale, 3: public uint256 public saleState = 0; bytes32 public benefa...
reserve
function reserve(uint256 numberOfTokens) public onlyOwner { uint256 ts = totalSupply(); require(ts + numberOfTokens <= maxSupply, "Purchase would exceed max tokens"); _safeMint(msg.sender, numberOfTokens); }
// Minting Functions
LineComment
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 2774, 3015 ] }
7,229
Metaversity
contracts/Metaversity.sol
0x4515aade4455de6fab65999efc4552e656f9d2f5
Solidity
Metaversity
contract Metaversity is ERC721A, Ownable { uint256 basePrice = 0.065 ether; uint256 public constant maxSupply = 5555; string private _baseTokenURI; string public provenance; // states 0: closed, 1: benefactors & presale, 3: public uint256 public saleState = 0; bytes32 public benefa...
withdraw
function withdraw() public onlyOwner { uint256 balance = address(this).balance; payable(teamAddress).transfer(balance); }
// Withdraw Balance
LineComment
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 4905, 5050 ] }
7,230
Metaversity
contracts/Metaversity.sol
0x4515aade4455de6fab65999efc4552e656f9d2f5
Solidity
Metaversity
contract Metaversity is ERC721A, Ownable { uint256 basePrice = 0.065 ether; uint256 public constant maxSupply = 5555; string private _baseTokenURI; string public provenance; // states 0: closed, 1: benefactors & presale, 3: public uint256 public saleState = 0; bytes32 public benefa...
isApprovedForAll
function isApprovedForAll(address owner, address operator) public view override returns (bool) { return OpenSeaGasFreeListing.isApprovedForAll(owner, operator) || super.isApprovedForAll(owner, operator); }
// Open Sea Free Gas
LineComment
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 5077, 5298 ] }
7,231
HitexExchangeToken
HitexExchangeToken.sol
0x8b94010808f615cf379b36d02bbfbbf454759fe3
Solidity
SafeMath
library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * Integ...
/** * @title SafeMath */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; }
/** * Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://022ff79c4a6d7e3f5490460ec27884dde8ceab5a7d7c59ea38213dbad0f715b5
{ "func_code_index": [ 90, 297 ] }
7,232
HitexExchangeToken
HitexExchangeToken.sol
0x8b94010808f615cf379b36d02bbfbbf454759fe3
Solidity
SafeMath
library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * Integ...
/** * @title SafeMath */
NatSpecMultiLine
div
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 a / b; }
/** * Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://022ff79c4a6d7e3f5490460ec27884dde8ceab5a7d7c59ea38213dbad0f715b5
{ "func_code_index": [ 382, 682 ] }
7,233
HitexExchangeToken
HitexExchangeToken.sol
0x8b94010808f615cf379b36d02bbfbbf454759fe3
Solidity
SafeMath
library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * Integ...
/** * @title SafeMath */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://022ff79c4a6d7e3f5490460ec27884dde8ceab5a7d7c59ea38213dbad0f715b5
{ "func_code_index": [ 797, 925 ] }
7,234
HitexExchangeToken
HitexExchangeToken.sol
0x8b94010808f615cf379b36d02bbfbbf454759fe3
Solidity
SafeMath
library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * Integ...
/** * @title SafeMath */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; }
/** * Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://022ff79c4a6d7e3f5490460ec27884dde8ceab5a7d7c59ea38213dbad0f715b5
{ "func_code_index": [ 990, 1136 ] }
7,235
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
_mintColonist
function _mintColonist(address recipient, uint256 seed) external override { require(admins[msg.sender], "Only Admins"); require(minted + 1 <= MAX_TOKENS, "All colonists deployed"); minted++; totalCir++; generateColonist(minted, seed); if (tx.origin != recipient && recipient != address(pyth...
/** * Mint a token - any payment / game logic should be handled in the game contract. * This will just generate random traits and mint a token to a designated address. */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 5602, 6077 ] }
7,236
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
burn
function burn(uint256 tokenId) external override whenNotPaused { require(admins[msg.sender]); require( ownerOf[tokenId] == tx.origin || msg.sender == address(pytheas) || msg.sender == address(pirateGames), "Colonist: Not Owner" ); totalCir--; _burn(to...
/** * Burn a token - any game logic should be handled before this function. */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 6950, 7364 ] }
7,237
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
selectTrait
function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { uint8 trait = uint8(seed) % uint8(rarities[traitType].length); // If a selected random trait probability is selected (biased coin) return that trait if (seed >> 8 < rarities[traitType][trait]) return trait;...
/** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to se...
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 9528, 9931 ] }
7,238
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
selectColTraits
function selectColTraits(uint256 tokenId, uint256 seed) internal view returns (Colonist memory t) { t.isColonist = true; seed >>= 16; t.background = selectTrait(uint16(seed & 0xFFFF), 0); seed >>= 16; t.body = selectTrait(uint16(seed & 0xFFFF), 1); seed >>= 16; t.shirt...
/** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 10645, 11521 ] }
7,239
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
toggleReserveName
function toggleReserveName(string memory str, bool isReserve) internal { _nameReserved[toLower(str)] = isReserve; }
/** * @dev Reserves the name if isReserve is set to true, de-reserves if set to false */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 13440, 13574 ] }
7,240
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
validateName
function validateName(string memory str) public pure returns (bool) { bytes memory b = bytes(str); if (b.length < 1) return false; if (b.length > 25) return false; // Cannot be longer than 25 characters if (b[0] == 0x20) return false; // Leading space if (b[b.length - 1] == 0x20) return false; ...
/** * @dev Check if the name string is valid (Alphanumeric and spaces without leading or trailing space) */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 13819, 14737 ] }
7,241
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
toLower
function toLower(string memory str) public pure returns (string memory) { bytes memory bStr = bytes(str); bytes memory bLower = new bytes(bStr.length); for (uint256 i = 0; i < bStr.length; i++) { // Uppercase character if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) { ...
/** * @dev Converts the string to lowercase */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 14804, 15319 ] }
7,242
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
setPaused
function setPaused(bool _paused) external onlyOwner { if (_paused) _pause(); else _unpause(); }
/** * enables owner to pause / unpause minting */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 15609, 15732 ] }
7,243
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
addAdmin
function addAdmin(address addr) external onlyOwner { admins[addr] = true; }
/** * enables an address to mint / burn * @param addr the address to enable */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 15837, 15931 ] }
7,244
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
removeAdmin
function removeAdmin(address addr) external onlyOwner { admins[addr] = false; }
/** * disables an address from minting / burning * @param addr the address to disbale */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 16046, 16144 ] }
7,245
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
getTokenTraitsColonist
function getTokenTraitsColonist(uint256 tokenId) external view override(IColonist) returns (Colonist memory) { return tokenTraitsColonist[tokenId]; }
/** Traits */
NatSpecMultiLine
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 16562, 16771 ] }
7,246
Colonist
contracts/Colonist.sol
0xc799f57355677a19b91c722734743215513dece5
Solidity
Colonist
contract Colonist is IColonist, ERC721, Pausable { /*/////////////////////////////////////////////////////// Global STATE ///////////////////////////////////////////////////////*/ event ColonistMinted(uint256 indexed tokenId); event ColonistBurned(uint256 indexed tokenId); ...
owner
function owner() public view virtual returns (address) { return auth; }
// For OpenSeas
LineComment
v0.8.11+commit.d7f03943
MIT
{ "func_code_index": [ 18533, 18623 ] }
7,247
IntelliShare
IntelliShare.sol
0x50e7495d1ca652fd8812d7e20facf67c09574d0e
Solidity
IntelliShare
contract IntelliShare{ /* Public variables of the token */ string public standard = 'IntelliShare 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances . */ mapping (address => uint256) publ...
IntelliShare
function IntelliShare() { balanceOf[msg.sender] = 1000000000 * 1000000000000000000; // Give the creator all initial tokens totalSupply = 1000000000 * 1000000000000000000; // Update total supply name = "IntelliShare"; // Set the name ...
/* Initializes contract with initial supply tokens to the creator of the contract */
Comment
v0.4.19+commit.c4cbbb05
bzzr://5091027a4e2b5ee16636afecc2be9c54363f3ef65e6b7e7e93cf562d56b909b3
{ "func_code_index": [ 776, 1328 ] }
7,248
IntelliShare
IntelliShare.sol
0x50e7495d1ca652fd8812d7e20facf67c09574d0e
Solidity
IntelliShare
contract IntelliShare{ /* Public variables of the token */ string public standard = 'IntelliShare 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances . */ mapping (address => uint256) publ...
transfer
function transfer(address _to, uint256 _value) { if (_to == 0x0) throw; // Prevent transfer to 0x0 address. Use burn() instead if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check...
/* Send coins */
Comment
v0.4.19+commit.c4cbbb05
bzzr://5091027a4e2b5ee16636afecc2be9c54363f3ef65e6b7e7e93cf562d56b909b3
{ "func_code_index": [ 1353, 2015 ] }
7,249
IntelliShare
IntelliShare.sol
0x50e7495d1ca652fd8812d7e20facf67c09574d0e
Solidity
IntelliShare
contract IntelliShare{ /* Public variables of the token */ string public standard = 'IntelliShare 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances . */ mapping (address => uint256) publ...
approve
function approve(address _spender, uint256 _value) returns (bool success) { allowance[msg.sender][_spender] = _value; return true; }
/* Allow another contract to spend some tokens in your behalf */
Comment
v0.4.19+commit.c4cbbb05
bzzr://5091027a4e2b5ee16636afecc2be9c54363f3ef65e6b7e7e93cf562d56b909b3
{ "func_code_index": [ 2088, 2257 ] }
7,250
IntelliShare
IntelliShare.sol
0x50e7495d1ca652fd8812d7e20facf67c09574d0e
Solidity
IntelliShare
contract IntelliShare{ /* Public variables of the token */ string public standard = 'IntelliShare 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances . */ mapping (address => uint256) publ...
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } }
/* Approve and then communicate the approved contract in a single tx */
Comment
v0.4.19+commit.c4cbbb05
bzzr://5091027a4e2b5ee16636afecc2be9c54363f3ef65e6b7e7e93cf562d56b909b3
{ "func_code_index": [ 2337, 2673 ] }
7,251
IntelliShare
IntelliShare.sol
0x50e7495d1ca652fd8812d7e20facf67c09574d0e
Solidity
IntelliShare
contract IntelliShare{ /* Public variables of the token */ string public standard = 'IntelliShare 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances . */ mapping (address => uint256) publ...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { if (_to == 0x0) throw; // Prevent transfer to 0x0 address. Use burn() instead if (balanceOf[_from] < _value) throw; // Check if the sender has enough if (balanceOf[_to...
/* A contract attempts to get the coins */
Comment
v0.4.19+commit.c4cbbb05
bzzr://5091027a4e2b5ee16636afecc2be9c54363f3ef65e6b7e7e93cf562d56b909b3
{ "func_code_index": [ 2724, 3506 ] }
7,252
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
OAR
function OAR() public view returns (OraclizeAddrResolverI) { return oraclize_setNetwork(); }
//OraclizeAddrResolverI constant public OAR = oraclize_setNetwork();
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 752, 878 ] }
7,253
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
oraclize
function oraclize() public view returns (OraclizeI) { return OraclizeI(OAR().getAddress()); }
//OraclizeI constant public oraclize = OraclizeI(OAR.getAddress());
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 956, 1083 ] }
7,254
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
oraclize_query
function oraclize_query(string datasource, string[] argN) internal returns (bytes32 id){ return oraclize_query(0, datasource, argN); }
// internalize w/o experimental
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 5241, 5404 ] }
7,255
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
oraclize_query
function oraclize_query(uint timestamp, string datasource, string[] argN) internal returns (bytes32 id){ OraclizeI oracle = oraclize(); uint price = oracle.getPrice(datasource); if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price bytes memory args = stra2cbor(argN); ...
// internalize w/o experimental
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 5444, 5868 ] }
7,256
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
oraclize_query
function oraclize_query(string datasource, string[] argN, uint gaslimit) internal returns (bytes32 id){ return oraclize_query(0, datasource, argN, gaslimit); }
// internalize w/o experimental
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 5908, 6096 ] }
7,257
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
oraclize_query
function oraclize_query(uint timestamp, string datasource, string[] argN, uint gaslimit) internal returns (bytes32 id){ OraclizeI oracle = oraclize(); uint price = oracle.getPrice(datasource, gaslimit); if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price bytes memory a...
// internalize w/o experimental
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 6136, 6610 ] }
7,258
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
getCodeSize
function getCodeSize(address _addr) public view returns(uint _size) { assembly { _size := extcodesize(_addr) } }
// setting to internal doesn't cause major increase in deployment and saves gas // per use, for this tiny function
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 7120, 7288 ] }
7,259
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
parseAddr
function parseAddr(string _a) public pure returns (address){ bytes memory tmp = bytes(_a); uint160 iaddr = 0; uint160 b1; uint160 b2; for (uint i=2; i<2+2*20; i+=2){ iaddr *= 256; b1 = uint160(tmp[i]); b2 = uint160(tmp[i+1]); if ((b1 >= 97)&&(b1 <= 102)) b...
// expects 0x prefix
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 7317, 8058 ] }
7,260
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
parseInt
function parseInt(string _a) public pure returns (uint) { return parseInt(_a, 0); }
// parseInt
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 10922, 11039 ] }
7,261
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
oraclizeLib
library oraclizeLib { function proofType_NONE() public pure returns (byte) { return 0x00; } function proofType_TLSNotary() public pure returns (byte) { return 0x10; } function proofType_Android() public pure returns (byte) { ...
parseInt
function parseInt(string _a, uint _b) public pure returns (uint) { bytes memory bresult = bytes(_a); uint mint = 0; bool decimals = false; for (uint i=0; i<bresult.length; i++){ if ((bresult[i] >= 48)&&(bresult[i] <= 57)){ if (decimals){ if (_b == 0) break; ...
// parseInt(parseFloat*10^_b)
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 11077, 11704 ] }
7,262
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
toSlice
function toSlice(string self) internal pure returns (slice) { uint ptr; assembly { ptr := add(self, 0x20) } return slice(bytes(self).length, ptr); }
/* * @dev Returns a slice containing the entire string. * @param self The string to make a slice from. * @return A newly allocated slice containing the entire string. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 860, 1067 ] }
7,263
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
len
function len(bytes32 self) internal pure returns (uint) { uint ret; if (self == 0) return 0; if (self & 0xffffffffffffffffffffffffffffffff == 0) { ret += 16; self = bytes32(uint(self) / 0x100000000000000000000000000000000); } if (self & 0xffffffffffffffff == 0) { ...
/* * @dev Returns the length of a null-terminated bytes32 string. * @param self The value to find the length of. * @return The length of the string, from 0 to 32. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 1265, 2062 ] }
7,264
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
toSliceB32
function toSliceB32(bytes32 self) internal pure returns (slice ret) { // Allocate space for `self` in memory, copy it there, and point ret at it assembly { let ptr := mload(0x40) mstore(0x40, add(ptr, 0x20)) mstore(ptr, self) mstore(add(ret, 0x20), ptr) } ret._len...
/* * @dev Returns a slice containing the entire bytes32, interpreted as a * null-terminated utf-8 string. * @param self The bytes32 value to convert to a slice. * @return A new slice containing the value of the input argument up to the * first null. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 2372, 2749 ] }
7,265
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
copy
function copy(slice self) internal pure returns (slice) { return slice(self._len, self._ptr); }
/* * @dev Returns a new slice containing the same data as the current slice. * @param self The slice to copy. * @return A new slice containing the same data as `self`. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 2952, 3066 ] }
7,266
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
toString
function toString(slice self) internal pure returns (string) { string memory ret = new string(self._len); uint retptr; assembly { retptr := add(ret, 32) } memcpy(retptr, self._ptr, self._len); return ret; }
/* * @dev Copies a slice to a new string. * @param self The slice to copy. * @return A newly allocated string containing the slice's text. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 3240, 3503 ] }
7,267
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
len
function len(slice self) internal pure returns (uint l) { // Starting at ptr-31 means the LSB will be the byte we care about uint ptr = self._ptr - 31; uint end = ptr + self._len; for (l = 0; ptr < end; l++) { uint8 b; assembly { b := and(mload(ptr), 0xFF) } if (b < 0x80) ...
/* * @dev Returns the length in runes of the slice. Note that this operation * takes time proportional to the length of the slice; avoid using it * in loops, and call `slice.empty()` if you only need to know whether * the slice is empty or not. * @param self The slice to operate on. * @return...
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 3899, 4610 ] }
7,268
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
empty
function empty(slice self) internal pure returns (bool) { return self._len == 0; }
/* * @dev Returns true if the slice is empty (has a length of 0). * @param self The slice to operate on. * @return True if the slice is empty, False otherwise. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 4805, 4906 ] }
7,269
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
compare
function compare(slice self, slice other) internal pure returns (int) { uint shortest = self._len; if (other._len < self._len) shortest = other._len; uint selfptr = self._ptr; uint otherptr = other._ptr; for (uint idx = 0; idx < shortest; idx += 32) { uint a; uint b...
/* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two slices are equal. Comparison is done per-rune, * on unicode codepoints. * @param self The first slice to compare. * @param other Th...
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 5340, 6350 ] }
7,270
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
equals
function equals(slice self, slice other) internal pure returns (bool) { return compare(self, other) == 0; }
/* * @dev Returns true if the two slices contain the same text. * @param self The first slice to compare. * @param self The second slice to compare. * @return True if the slices are equal, false otherwise. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 6597, 6723 ] }
7,271
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
nextRune
function nextRune(slice self, slice rune) internal pure returns (slice) { rune._ptr = self._ptr; if (self._len == 0) { rune._len = 0; return rune; } uint l; uint b; // Load the first byte of the rune into the LSBs of b assembly { b := and(mload(sub(mload(add(self...
/* * @dev Extracts the first rune in the slice into `rune`, advancing the * slice to point to the next rune and returning `self`. * @param self The slice to operate on. * @param rune The slice that will contain the first rune. * @return `rune`. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 7020, 7916 ] }
7,272
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
nextRune
function nextRune(slice self) internal pure returns (slice ret) { nextRune(self, ret); }
/* * @dev Returns the first rune in the slice, advancing the slice to point * to the next rune. * @param self The slice to operate on. * @return A slice containing only the first rune from `self`. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 8159, 8266 ] }
7,273
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
ord
function ord(slice self) internal pure returns (uint ret) { if (self._len == 0) { return 0; } uint word; uint length; uint divisor = 2 ** 248; // Load the rune into the MSBs of b assembly { word:= mload(mload(add(self, 32))) } uint b = word / divisor; if (b < 0x...
/* * @dev Returns the number of the first codepoint in the slice. * @param self The slice to operate on. * @return The number of the first codepoint in the slice. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 8464, 9582 ] }
7,274
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
keccak
function keccak(slice self) internal pure returns (bytes32 ret) { assembly { ret := keccak256(mload(add(self, 32)), mload(self)) } }
/* * @dev Returns the keccak-256 hash of the slice. * @param self The slice to hash. * @return The hash of the slice. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 9735, 9908 ] }
7,275
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
startsWith
function startsWith(slice self, slice needle) internal pure returns (bool) { if (self._len < needle._len) { return false; } if (self._ptr == needle._ptr) { return true; } bool equal; assembly { let length := mload(needle) let selfptr := mload(add(sel...
/* * @dev Returns true if `self` starts with `needle`. * @param self The slice to operate on. * @param needle The slice to search for. * @return True if the slice starts with the provided text, false otherwise. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 10160, 10713 ] }
7,276
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
beyond
function beyond(slice self, slice needle) internal pure returns (slice) { if (self._len < needle._len) { return self; } bool equal = true; if (self._ptr != needle._ptr) { assembly { let length := mload(needle) let selfptr := mload(add(self, 0x20)) ...
/* * @dev If `self` starts with `needle`, `needle` is removed from the * beginning of `self`. Otherwise, `self` is unmodified. * @param self The slice to operate on. * @param needle The slice to search for. * @return `self` */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 10989, 11645 ] }
7,277
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
endsWith
function endsWith(slice self, slice needle) internal pure returns (bool) { if (self._len < needle._len) { return false; } uint selfptr = self._ptr + self._len - needle._len; if (selfptr == needle._ptr) { return true; } bool equal; assembly { let length...
/* * @dev Returns true if the slice ends with `needle`. * @param self The slice to operate on. * @param needle The slice to search for. * @return True if the slice starts with the provided text, false otherwise. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 11898, 12461 ] }
7,278
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
until
function until(slice self, slice needle) internal pure returns (slice) { if (self._len < needle._len) { return self; } uint selfptr = self._ptr + self._len - needle._len; bool equal = true; if (selfptr != needle._ptr) { assembly { let length := mload(needle) ...
/* * @dev If `self` ends with `needle`, `needle` is removed from the * end of `self`. Otherwise, `self` is unmodified. * @param self The slice to operate on. * @param needle The slice to search for. * @return `self` */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 12729, 13359 ] }
7,279
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
findPtr
function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) { uint ptr = selfptr; uint idx; if (needlelen <= selflen) { if (needlelen <= 32) { bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1)); bytes32 needledata...
// Returns the memory address of the first byte of the first occurrence of // `needle` in `self`, or the first byte after `self` if not found.
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 13556, 14960 ] }
7,280
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
rfindPtr
function rfindPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) { uint ptr; if (needlelen <= selflen) { if (needlelen <= 32) { bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1)); bytes32 needledata; assembly ...
// Returns the memory address of the first byte after the last occurrence of // `needle` in `self`, or the address of `self` if not found.
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 15112, 16519 ] }
7,281
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
find
function find(slice self, slice needle) internal pure returns (slice) { uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr); self._len -= ptr - self._ptr; self._ptr = ptr; return self; }
/* * @dev Modifies `self` to contain everything from the first occurrence of * `needle` to the end of the slice. `self` is set to the empty slice * if `needle` is not found. * @param self The slice to search and modify. * @param needle The text to search for. * @return `self`. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 16860, 17107 ] }
7,282
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
rfind
function rfind(slice self, slice needle) internal pure returns (slice) { uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr); self._len = ptr - self._ptr; return self; }
/* * @dev Modifies `self` to contain the part of the string from the start of * `self` to the end of the first occurrence of `needle`. If `needle` * is not found, `self` is set to the empty slice. * @param self The slice to search and modify. * @param needle The text to search for. * @return `self...
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 17471, 17693 ] }
7,283
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
split
function split(slice self, slice needle, slice token) internal pure returns (slice) { uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr); token._ptr = self._ptr; token._len = ptr - self._ptr; if (ptr == self._ptr + self._len) { // Not found self._len = 0; } els...
/* * @dev Splits the slice, setting `self` to everything after the first * occurrence of `needle`, and `token` to everything before it. If * `needle` does not occur in `self`, `self` is set to the empty slice, * and `token` is set to the entirety of `self`. * @param self The slice to split. *...
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 18206, 18699 ] }
7,284
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
split
function split(slice self, slice needle) internal pure returns (slice token) { split(self, needle, token); }
/* * @dev Splits the slice, setting `self` to everything after the first * occurrence of `needle`, and returning everything before it. If * `needle` does not occur in `self`, `self` is set to the empty slice, * and the entirety of `self` is returned. * @param self The slice to split. * @param...
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 19176, 19303 ] }
7,285
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
rsplit
function rsplit(slice self, slice needle, slice token) internal pure returns (slice) { uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr); token._ptr = ptr; token._len = self._len - (ptr - self._ptr); if (ptr == self._ptr) { // Not found self._len = 0; } else ...
/* * @dev Splits the slice, setting `self` to everything before the last * occurrence of `needle`, and `token` to everything after it. If * `needle` does not occur in `self`, `self` is set to the empty slice, * and `token` is set to the entirety of `self`. * @param self The slice to split. * ...
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 19815, 20262 ] }
7,286
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
rsplit
function rsplit(slice self, slice needle) internal pure returns (slice token) { rsplit(self, needle, token); }
/* * @dev Splits the slice, setting `self` to everything before the last * occurrence of `needle`, and returning everything after it. If * `needle` does not occur in `self`, `self` is set to the empty slice, * and the entirety of `self` is returned. * @param self The slice to split. * @param ...
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 20737, 20866 ] }
7,287
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
count
function count(slice self, slice needle) internal pure returns (uint cnt) { uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len; while (ptr <= self._ptr + self._len) { cnt++; ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr) + needle._le...
/* * @dev Counts the number of nonoverlapping occurrences of `needle` in `self`. * @param self The slice to search. * @param needle The text to search for in `self`. * @return The number of occurrences of `needle` found in `self`. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 21138, 21499 ] }
7,288
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
contains
function contains(slice self, slice needle) internal pure returns (bool) { return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr; }
/* * @dev Returns True if `self` contains `needle`. * @param self The slice to search. * @param needle The text to search for in `self`. * @return True if `needle` is found in `self`, false otherwise. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 21741, 21914 ] }
7,289
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
concat
function concat(slice self, slice other) internal pure returns (string) { string memory ret = new string(self._len + other._len); uint retptr; assembly { retptr := add(ret, 32) } memcpy(retptr, self._ptr, self._len); memcpy(retptr + self._len, other._ptr, other._len); return ret; }
/* * @dev Returns a newly allocated string containing the concatenation of * `self` and `other`. * @param self The first slice to concatenate. * @param other The second slice to concatenate. * @return The concatenation of the two strings. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 22205, 22551 ] }
7,290
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
join
function join(slice self, slice[] parts) internal pure returns (string) { if (parts.length == 0) return ""; uint length = self._len * (parts.length - 1); for(uint i = 0; i < parts.length; i++) length += parts[i]._len; string memory ret = new string(length); uint retptr; ...
/* * @dev Joins an array of slices, using `self` as a delimiter, returning a * newly allocated string. * @param self The delimiter to use. * @param parts A list of slices to join. * @return A newly allocated string containing all the slices in `parts`, * joined with `self`. */
Comment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 22892, 23621 ] }
7,291
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 89, 272 ] }
7,292
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
div
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; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 356, 629 ] }
7,293
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 744, 860 ] }
7,294
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 924, 1060 ] }
7,295
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
Ownable
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public{ owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifi...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
Ownable
function Ownable() public{ owner = msg.sender; }
/** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 169, 228 ] }
7,296
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
Ownable
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public{ owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifi...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) onlyOwner public{ if (newOwner != address(0)) { owner = newOwner; } }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 551, 688 ] }
7,297
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
Pausable
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the cont...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
pause
function pause() onlyOwner whenNotPaused public returns (bool) { paused = true; emit Pause(); return true; }
/** * @dev called by the owner to pause, triggers stopped state */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 487, 616 ] }
7,298
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
Pausable
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the cont...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
unpause
function unpause() onlyOwner whenPaused public returns (bool) { paused = false; emit Unpause(); return true; }
/** * @dev called by the owner to unpause, returns to normal state */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 700, 831 ] }
7,299
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
RoomManager
contract RoomManager { uint constant roomFree = 0; uint constant roomPending = 1; uint constant roomEnded = 2; struct RoomInfo{ uint roomid; address owner; uint setCount; // 0 if not a tripple room uint256 balance; uint status; uint currentS...
/** * The contractName contract does this and that... */
NatSpecMultiLine
tryRollRoom
function tryRollRoom(address user,uint256 value,uint roomid) internal returns(bool) { if(value <= 0){ return false; } if(roomMapping[roomid].roomid == 0){ return false; } RoomInfo storage room = roomMapping[roomid]; if(room.status != roomFree || room.balance == 0){...
// just check if can be rolled and update balance,not calculate here
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 3760, 4653 ] }
7,300
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
RoomManager
contract RoomManager { uint constant roomFree = 0; uint constant roomPending = 1; uint constant roomEnded = 2; struct RoomInfo{ uint roomid; address owner; uint setCount; // 0 if not a tripple room uint256 balance; uint status; uint currentS...
/** * The contractName contract does this and that... */
NatSpecMultiLine
calculateRoom
function calculateRoom(uint roomid,uint num123,uint taxrate,bytes32 myid) internal returns(bool success, bool isend,address winer,uint256 tax) { success = false; tax = 0; if(roomMapping[roomid].roomid == 0){ return; } RoomInfo memory room = roomMapping[roomid]; if(r...
// do the calculation // returns : success,isend,winer,tax
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 4725, 5503 ] }
7,301
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
DiceOffline
contract DiceOffline is Config,RoomManager,UserManager { // 事件 event withdraw_failed(); event withdraw_succeeded(address toUser,uint256 value); event bet_failed(address indexed player,uint256 value,uint result,uint roomid,uint errorcode); event bet_succeeded(address indexed player,uint256 v...
destroy
function destroy() onlyOwner public{ returnAllRoomsBalance(); selfdestruct(owner); }
// 销毁合约
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 1011, 1128 ] }
7,302
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
DiceOffline
contract DiceOffline is Config,RoomManager,UserManager { // 事件 event withdraw_failed(); event withdraw_succeeded(address toUser,uint256 value); event bet_failed(address indexed player,uint256 value,uint result,uint roomid,uint errorcode); event bet_succeeded(address indexed player,uint256 v...
function () public payable { }
// 充值
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 1142, 1190 ] }
7,303
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
DiceOffline
contract DiceOffline is Config,RoomManager,UserManager { // 事件 event withdraw_failed(); event withdraw_succeeded(address toUser,uint256 value); event bet_failed(address indexed player,uint256 value,uint result,uint roomid,uint errorcode); event bet_succeeded(address indexed player,uint256 v...
withdraw
function withdraw(uint256 value) public onlyOwner{ if(getAvailableBalance() < value){ emit withdraw_failed(); return; } owner.transfer(value); emit withdraw_succeeded(owner,value); }
// 提现
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 1204, 1460 ] }
7,304
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
DiceOffline
contract DiceOffline is Config,RoomManager,UserManager { // 事件 event withdraw_failed(); event withdraw_succeeded(address toUser,uint256 value); event bet_failed(address indexed player,uint256 value,uint result,uint roomid,uint errorcode); event bet_succeeded(address indexed player,uint256 v...
getAvailableBalance
function getAvailableBalance() public view returns (uint256){ return SafeMath.sub(getBalance(),getAllBalance()); }
// 获取可提现额度
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 1479, 1612 ] }
7,305
DiceOnline
DiceOnline.sol
0xd3b5e17e96fda663da9438f8e1f11185d3433d08
Solidity
DiceOffline
contract DiceOffline is Config,RoomManager,UserManager { // 事件 event withdraw_failed(); event withdraw_succeeded(address toUser,uint256 value); event bet_failed(address indexed player,uint256 value,uint result,uint roomid,uint errorcode); event bet_succeeded(address indexed player,uint256 v...
openRoom
function openRoom(uint setCount,uint roomData,address referral) public payable returns(bool) { if(setCount > 0 && (setCount > maxSet || setCount < minSet)){ emit evt_createRoomFailed(msg.sender); msg.sender.transfer(msg.value); return false; } uint256 minValue = normalRoomMin; ...
// 如果setCount为0,表示大小
LineComment
v0.4.24+commit.e67f0147
bzzr://2f0065c395341e4968bc0667cbeafd2985e8db277889539c2b69d29b7f21f5c5
{ "func_code_index": [ 2708, 3675 ] }
7,306