source_idx
stringlengths
1
5
contract_name
stringlengths
1
48
func_name
stringlengths
0
52
masked_contract
stringlengths
105
184k
func_body
stringlengths
0
324k
func_requirement
stringlengths
1
28.3k
85392
BBFarm
sponsor
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
BBLib.DB storage db = getDb(ballotId); db.logSponsorship(msg.value); doSafeSend(db.index.getPayTo(), msg.value); emit Sponsorship(ballotId, msg.value);
Sponsorship
85392
BBFarm
submitVote
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
getDb(ballotId).submitVote(vote, extra); emit Vote(ballotId, vote, msg.sender, extra);
Voting
85392
BBFarm
getDetails
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
BBLib.DB storage db = getDb(ballotId); uint packed = db.packed; return ( db.getSequenceNumber(voter) > 0, db.nVotesCast, db.ballotEncryptionSeckey, BPackedUtils.packedToSubmissionBits(packed), BPackedUtils.packedToStartTime(pac...
Getters note - this is the maxmimum number of vars we can return with one function call (taking 2 args)
85392
BBFarm
revealSeckey
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
BBLib.DB storage db = getDb(ballotId); db.requireBallotOwner(); db.requireBallotClosed(); db.revealSeckey(sk);
ADMIN Allow the owner to reveal the secret key after ballot conclusion
85392
BBFarm
setEndTime
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
BBLib.DB storage db = getDb(ballotId); db.requireBallotOwner(); db.requireTesting(); db.setEndTime(newEndTime);
note: testing only.
85392
SVIndex
null
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
backend = _b; payments = _pay; ensOwnerPx = _ensOwnerPx; _addBBFarm(0x0, _bbFarm0); commAuction = _commAuction;
FUNCTIONS constructor
85392
SVIndex
_getPayTo
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
return payments.getPayTo();
payoutAllC
85392
SVIndex
doUpgrade
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
doUpgradeInternal(nextSC); backend.upgradeMe(nextSC); payments.upgradeMe(nextSC); ensOwnerPx.setAddr(nextSC); ensOwnerPx.upgradeMeAdmin(nextSC); commAuction.upgradeMe(nextSC); for (uint i = 0; i < bbFarms.length; i++) { bbFarms[i].upgradeMe(...
UPGRADE STUFF
85392
SVIndex
addBBFarm
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
bytes4 bbNamespace = bbFarm.getNamespace(); require(bbNamespace != bytes4(0), "bb-farm-namespace"); require(bbFarmIdLookup[bbNamespace] == 0 && bbNamespace != bbFarms[0].getNamespace(), "bb-namespace-used"); bbFarmId = _addBBFarm(bbNamespace, bbFarm);
adding a new BBFarm
85392
SVIndex
getPayments
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
return payments;
Getters for backends
85392
SVIndex
getVersion
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
return VERSION;
* GLOBAL INFO */
85392
SVIndex
dInit
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
require(msg.value >= payments.getMinWeiForDInit()); bytes32 democHash = backend.dInit(defaultErc20, msg.sender, disableErc20OwnerClaim); payments.payForDemocracy.value(msg.value)(democHash); return democHash;
* DEMOCRACY FUNCTIONS - INDIVIDUAL */
85392
SVIndex
setDEditor
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
backend.setDEditor(democHash, editor, canEdit);
admin methods
85392
SVIndex
dDisableErc20OwnerClaim
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
backend.dDisableErc20OwnerClaim(democHash);
this is one way only!
85392
SVIndex
dAddBallot
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
_addBallot(democHash, ballotId, packed, false); emit ManuallyAddedBallot(democHash, ballotId, packed);
Democ Getters - deprecated NOTE: the getters that used to live here just proxied to the backend. this has been removed to reduce gas costs + size of Ix contract For SCs you should use IxLib for convenience. For Offchain use you should query the backend directly (via ix.getBackend()) Add and Deploy Ballots manually add ...
85392
SVIndex
dDeployBallot
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
_deployBallot(democHash, specHash, extraData, packed, true, false);
only way a democ admin can deploy a ballot
85392
SVIndex
_addBallot
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
// backend handles events backend.dAddBallot(democHash, ballotId, packed, countTowardsLimit);
internal logic around adding a ballot
85392
SVIndex
_accountOkayChecks
contract SVIndex is IxIface { uint256 constant VERSION = 2; // generated from: `address public owner;` bytes4 constant OWNER_SIG = 0x8da5cb5b; // generated from: `address public controller;` bytes4 constant CONTROLLER_SIG = 0xf77c4791; /* backend & other SC storage */ IxBackendI...
// if the ballot is marked as official require the democracy is paid up to // some relative amount - exclude NFP accounts from this check uint secsLeft = payments.getSecondsRemaining(democHash); // must be positive due to ending in future check uint256 secsToEndTime = endTi...
check an account has paid up enough for this ballot
85392
SVIndexBackend
null
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
// do nothing
constructor
85392
SVIndexBackend
_getPayTo
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
return owner;
base contract overloads
85392
SVIndexBackend
getGDemocsN
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
return democList.length;
GLOBAL INFO
85392
SVIndexBackend
_addDemoc
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
democList.push(democHash); Democ storage d = democs[democHash]; d.erc20 = erc20; if (disableErc20OwnerClaim) { d.erc20OwnerClaimDisabled = true; } // this should never trigger if we have a good security model - entropy for 13 bytes ~ 2^(8*13) ~ 10^31 ...
DEMOCRACY ADMIN FUNCTIONS
85392
SVIndexBackend
dAdd
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
_addDemoc(democHash, erc20, msg.sender, disableErc20OwnerClaim); emit ManuallyAddedDemoc(democHash, erc20);
owner democ admin functions
85392
SVIndexBackend
emergencySetDOwner
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
_setDOwner(democHash, newOwner); emit EmergencyDemocOwner(democHash, newOwner);
Preferably for emergencies only
85392
SVIndexBackend
dInit
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
// generating the democHash in this way guarentees it'll be unique/hard-to-brute-force // (particularly because prevBlockHash and now are part of the hash) democHash = keccak256(abi.encodePacked(democList.length, blockhash(block.number-1), defaultErc20, now)); _addDemoc(democHash, d...
user democ admin functions
85392
SVIndexBackend
_commitBallot
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
uint16 subBits; subBits = BPackedUtils.packedToSubmissionBits(packed); uint localBallotId = democs[democHash].allBallots.length; democs[democHash].allBallots.push(ballotId); // do this for anything that doesn't qualify as a community ballot if (countTowardsLimi...
* ADD BALLOT TO RECORD */
85392
SVIndexBackend
dAddBallot
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
_commitBallot(democHash, ballotId, packed, countTowardsLimit);
what SVIndex uses to add a ballot
85392
SVIndexBackend
getDOwner
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
return democs[democHash].owner;
democ getters
85392
SVIndexBackend
_calcEditorKey
contract SVIndexBackend is IxBackendIface { uint constant VERSION = 2; struct Democ { address erc20; address owner; bool communityBallotsDisabled; bool erc20OwnerClaimDisabled; uint editorEpoch; mapping (uint => mapping (address => bool)) editors; ...
return abi.encodePacked("editor.", key);
util for calculating editor key
85392
SVPayments
null
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
emergencyAdmin = _emergencyAdmin; assert(_emergencyAdmin != address(0));
END BREAK GLASS
85392
SVPayments
getVersion
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
return VERSION;
base SCs
85392
SVPayments
weiBuysHowManySeconds
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
uint centsPaid = weiToCents(amount); // multiply by 10**18 to ensure we make rounding errors insignificant uint monthsOffsetPaid = ((10 ** 18) * centsPaid) / basicCentsPricePer30Days; uint secondsOffsetPaid = monthsOffsetPaid * (30 days); uint additionalSeconds = secondsOff...
Financial Calculations
85392
SVPayments
payForDemocracy
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
require(msg.value > 0, "need to send some ether to make payment"); uint additionalSeconds = weiBuysHowManySeconds(msg.value); if (accounts[democHash].isPremium) { additionalSeconds /= premiumMultiplier; } if (additionalSeconds >= 1) { _modAcc...
account management
85392
SVPayments
accountInGoodStanding
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
return accounts[democHash].paidUpTill >= now;
account status - getters
85392
SVPayments
giveTimeToDemoc
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
_modAccountBalance(democHash, additionalSeconds); payments.push(PaymentLog(true, democHash, additionalSeconds, 0)); emit GrantedAccountTime(democHash, additionalSeconds, ref);
admin utils for accounts
85392
SVPayments
setPayTo
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
_setPayTo(newPayTo); emit SetPayTo(newPayTo);
admin setters global
85392
SVPayments
getBasicCentsPricePer30Days
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
return basicCentsPricePer30Days;
global getters
85392
SVPayments
getPaymentLogN
contract SVPayments is IxPaymentsIface { uint constant VERSION = 2; struct Account { bool isPremium; uint lastPaymentTs; uint paidUpTill; uint lastUpgradeTs; // timestamp of the last time it was upgraded to premium } struct PaymentLog { bool _externa...
return payments.length;
payments stuff
85392
PublicResolver
null
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
ens = ensAddr;
* * Constructor. * @param ensAddr The ENS registrar contract.
85392
PublicResolver
setAddr
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
records[node].addr = addr; emit AddrChanged(node, addr);
* * Sets the address associated with an ENS node. * May only be called by the owner of that node in the ENS registry. * @param node The node to update. * @param addr The address to set.
85392
PublicResolver
setContent
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
records[node].content = hash; emit ContentChanged(node, hash);
* * Sets the content hash associated with an ENS node. * May only be called by the owner of that node in the ENS registry. * Note that this resource type is not standardized, and will likely change * in future to a resource type based on multihash. * @param node The node to update. *...
85392
PublicResolver
setName
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
records[node].name = name; emit NameChanged(node, name);
* * Sets the name associated with an ENS node, for reverse records. * May only be called by the owner of that node in the ENS registry. * @param node The node to update. * @param name The name to set.
85392
PublicResolver
setABI
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
// Content types must be powers of 2 require(((contentType - 1) & contentType) == 0); records[node].abis[contentType] = data; emit ABIChanged(node, contentType);
* * Sets the ABI associated with an ENS node. * Nodes may have one ABI of each content type. To remove an ABI, set it to * the empty string. * @param node The node to update. * @param contentType The content type of the ABI * @param data The ABI data.
85392
PublicResolver
setPubkey
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
records[node].pubkey = PublicKey(x, y); emit PubkeyChanged(node, x, y);
* * Sets the SECP256k1 public key associated with an ENS node. * @param node The ENS node to query * @param x the X coordinate of the curve point for the public key. * @param y the Y coordinate of the curve point for the public key.
85392
PublicResolver
setText
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
records[node].text[key] = value; emit TextChanged(node, key, key);
* * Sets the text data associated with an ENS node and key. * May only be called by the owner of that node in the ENS registry. * @param node The node to update. * @param key The key to set. * @param value The text data value to set.
85392
PublicResolver
text
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
return records[node].text[key];
* * Returns the text data associated with an ENS node and key. * @param node The ENS node to query. * @param key The text data key to query. * @return The associated text data.
85392
PublicResolver
pubkey
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
return (records[node].pubkey.x, records[node].pubkey.y);
* * Returns the SECP256k1 public key associated with an ENS node. * Defined in EIP 619. * @param node The ENS node to query * @return x, y the X and Y coordinates of the curve point for the public key.
85392
PublicResolver
ABI
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
Record storage record = records[node]; for (contentType = 1; contentType <= contentTypes; contentType <<= 1) { if ((contentType & contentTypes) != 0 && record.abis[contentType].length > 0) { data = record.abis[contentType]; return; } ...
* * Returns the ABI associated with an ENS node. * Defined in EIP205. * @param node The ENS node to query * @param contentTypes A bitwise OR of the ABI formats accepted by the caller. * @return contentType The content type of the return value * @return data The ABI data
85392
PublicResolver
name
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
return records[node].name;
* * Returns the name associated with an ENS node, for reverse records. * Defined in EIP181. * @param node The ENS node to query. * @return The associated name.
85392
PublicResolver
content
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
return records[node].content;
* * Returns the content hash associated with an ENS node. * Note that this resource type is not standardized, and will likely change * in future to a resource type based on multihash. * @param node The ENS node to query. * @return The associated content hash.
85392
PublicResolver
addr
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
return records[node].addr;
* * Returns the address associated with an ENS node. * @param node The ENS node to query. * @return The associated address.
85392
PublicResolver
supportsInterface
contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBK...
return interfaceID == ADDR_INTERFACE_ID || interfaceID == CONTENT_INTERFACE_ID || interfaceID == NAME_INTERFACE_ID || interfaceID == ABI_INTERFACE_ID || interfaceID == PUBKEY_INTERFACE_ID || interfaceID == TEXT_INTERFACE_ID || interfaceID == INTERFACE_META...
* * Returns true if the resolver implements the interface specified by the provided hash. * @param interfaceID The ID of the interface to check for. * @return True if the contract implements the requested interface.
85393
preToken
preToken
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
balances[msg.sender] = initialSupply; totalSupply = initialSupply; owner = msg.sender; crowdsaleAddress = msg.sender;
Sends the initial supply of 250,000,000 tokens to the creator, sets the totalSupply, sets the owner and crowdsaleAddress to the deployer
85393
preToken
balanceOf
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
return balances[_owner];
balances
85393
preToken
transfer
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
ERC-20 transfer with SafeMath
85393
preToken
transferFrom
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
require(_from != address(0) && _to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true...
ERC-20 transferFrom with SafeMath
85393
preToken
approve
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
require(_spender != address(0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true;
ERC-20 approve spender
85393
preToken
allowance
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
return allowed[_owner][_spender];
ERC-20 allowance
85393
preToken
transferOwnership
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner;
Allows only the contract owner to transfer ownership to someone else
85393
preToken
mint
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
if (totalSupply.add(_amount) <= maxSupply){ balances[msg.sender] = balances[msg.sender].add(_amount); totalSupply = totalSupply.add(_amount); }else{ revert(); }
Allows only the owner to create new tokens as long as the number of tokens attempting to be minted plus the current totalSupply is less than or equal to 1,000,000,000 increases the totalSupply by the amount of tokens minted
85393
preToken
burn
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
require(balances[msg.sender] >= _amount); balances[msg.sender] = balances[msg.sender].sub(_amount); totalSupply = totalSupply.sub(_amount);
Allows the contract owner to burn (destroy) their own tokens Decreases the totalSupply so that tokens could be minted again at later date
85393
preToken
setCrowdsaleAddress
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
require(newCrowdsaleAddress != address(0)); crowdsaleAddress = newCrowdsaleAddress;
Allows the owner to set the crowdsaleAddress
85393
preToken
updateUnlockDate
contract preToken { using SafeMath for uint256; //Vanity settings string public constant name = "Presearch"; string public constant symbol = "PRE"; uint8 public constant decimals = 18; uint public totalSupply = 0; //Maximum supply of tokens that can ever be created 1,000,000,000 uint256 publ...
require (_newDate <= 1512018000); unlockDate=_newDate;
Allow the owner to update the unlockDate to allow trading sooner, but not later than the original unlockDate
85394
BasicToken
transfer
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _valu...
balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
85394
BasicToken
balanceOf
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _valu...
return balances[_owner];
* * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address.
85394
StandardToken
transferFrom
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to *...
var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_fro...
* * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered
85394
StandardToken
approve
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to *...
// To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0...
* * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent.
85394
StandardToken
allowance
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to *...
return allowed[_owner][_spender];
* * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender.
85394
Ownable
Ownable
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() {<FILL_FUNCTION_BODY>} /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner(...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
85394
Ownable
transferOwnership
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier o...
require(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.
85394
MintableToken
mint
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The addre...
totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); return true;
* * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful.
85394
MintableToken
finishMinting
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The addre...
mintingFinished = true; MintFinished(); return true;
* * @dev Function to stop minting new tokens. * @return True if the operation was successful.
85394
TokenMigration
migrate
contract TokenMigration is MintableToken { address public migrationAgent; // Migrate tokens to the new token contract function migrate() external {<FILL_FUNCTION_BODY>} function setMigrationAgent(address _agent) onlyOwner external { require(migrationAgent == 0); migrationAgent ...
require(migrationAgent != 0); uint value = balances[msg.sender]; balances[msg.sender] -= value; totalSupply -= value; MigrationAgent(migrationAgent).migrateFrom(msg.sender, value);
Migrate tokens to the new token contract
85395
Ownable
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public {<FILL_FUNCTION_BODY>} /...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
85395
Ownable
transferOwnership
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; }...
require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner;
* * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to.
85395
BasicToken
transfer
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
85395
BasicToken
balanceOf
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
return balances[_owner];
* * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address.
85395
Basic23Token
transfer
contract Basic23Token is Utils, ERC23Basic, BasicToken { /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred * @param _data is arbitrary data sent with the token transferFrom. Simulates ether tx.data * ...
require(_to != address(0)); require(_value <= balances[msg.sender]); // Ensure Sender has enough balance to send amount and ensure the sent _value is greater than 0 require(balances[_to].add(_value) > balances[_to]); // Detect balance overflow assert(super.transfer...
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred * @param _data is arbitrary data sent with the token transferFrom. Simulates ether tx.data * @return bool successful or not
85395
Basic23Token
transfer
contract Basic23Token is Utils, ERC23Basic, BasicToken { /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred * @param _data is arbitrary data sent with the token transferFrom. Simulates ether tx.data * ...
return transfer(_to, _value, new bytes(0));
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
85395
Basic23Token
balanceOf
contract Basic23Token is Utils, ERC23Basic, BasicToken { /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred * @param _data is arbitrary data sent with the token transferFrom. Simulates ether tx.data * ...
return super.balanceOf(_owner);
* * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address.
85395
Basic23Token
contractFallback
contract Basic23Token is Utils, ERC23Basic, BasicToken { /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred * @param _data is arbitrary data sent with the token transferFrom. Simulates ether tx.data * ...
ERC23Receiver reciever = ERC23Receiver(_to); return reciever.tokenFallback(msg.sender, _origin, _value, _data);
function that is called when transaction target is a contract
85395
Basic23Token
isContract
contract Basic23Token is Utils, ERC23Basic, BasicToken { /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred * @param _data is arbitrary data sent with the token transferFrom. Simulates ether tx.data * ...
// retrieve the size of the code on target address, this needs assembly uint length; assembly { length := extcodesize(_addr) } return length > 0;
assemble the given address bytecode. If bytecode exists then the _addr is a contract.
85395
StandardToken
transferFrom
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_fr...
* * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred
85395
StandardToken
approve
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true;
* * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate thi...
85395
StandardToken
allowance
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
return allowed[_owner][_spender];
* * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender.
85395
StandardToken
increaseApproval
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true;
* * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol
85395
Standard23Token
transferFrom
contract Standard23Token is Utils, ERC23, Basic23Token, StandardToken { /** * @dev Transfer tokens from one address to another * @dev Full compliance to ERC-20 and predictable behavior * https://docs.google.com/presentation/d/1sOuulAU1QirYtwHJxEbCsM_5LvuQs0YTbtLau8rRxpk/edit#slide=id.p24 ...
uint256 allowance = allowed[_from][msg.sender]; require(_to != address(0)); require(_value <= balances[_from]); require(balances[_to].add(_value) > balances[_to]); // Detect balance overflow require(_value <= allowance); // ensure allowed[_from][msg....
* * @dev Transfer tokens from one address to another * @dev Full compliance to ERC-20 and predictable behavior * https://docs.google.com/presentation/d/1sOuulAU1QirYtwHJxEbCsM_5LvuQs0YTbtLau8rRxpk/edit#slide=id.p24 * * @param _from address The address which you want to send tokens from ...
85395
Standard23Token
transferFrom
contract Standard23Token is Utils, ERC23, Basic23Token, StandardToken { /** * @dev Transfer tokens from one address to another * @dev Full compliance to ERC-20 and predictable behavior * https://docs.google.com/presentation/d/1sOuulAU1QirYtwHJxEbCsM_5LvuQs0YTbtLau8rRxpk/edit#slide=id.p24 ...
return transferFrom(_from, _to, _value, new bytes(0));
* * @dev Transfer tokens from one address to another * @dev Full compliance to ERC-20 and predictable behavior * https://docs.google.com/presentation/d/1sOuulAU1QirYtwHJxEbCsM_5LvuQs0YTbtLau8rRxpk/edit#slide=id.p24 * * @param _from address The address which you want to send tokens from ...
85395
Standard23Token
transferFromInternal
contract Standard23Token is Utils, ERC23, Basic23Token, StandardToken { /** * @dev Transfer tokens from one address to another * @dev Full compliance to ERC-20 and predictable behavior * https://docs.google.com/presentation/d/1sOuulAU1QirYtwHJxEbCsM_5LvuQs0YTbtLau8rRxpk/edit#slide=id.p24 ...
uint256 _allowance = allowed[_from][msg.sender]; allowed[_from][msg.sender] = _allowance.sub(_value); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); return true;
* * @dev Transfer tokens from one address to another * @dev Full compliance to ERC-20 and predictable behavior * https://docs.google.com/presentation/d/1sOuulAU1QirYtwHJxEbCsM_5LvuQs0YTbtLau8rRxpk/edit#slide=id.p24 * * @param _from address The address which you want to send tokens from ...
85395
Mintable23Token
mint
contract Mintable23Token is Standard23Token, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @p...
totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(0x0, _to, _amount); return true;
* * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful.
85395
Mintable23Token
finishMinting
contract Mintable23Token is Standard23Token, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @p...
mintingFinished = true; MintFinished(); return true;
* * @dev Function to stop minting new tokens. * @return True if the operation was successful.
85396
Ownable
null
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);
* * @dev Initializes the contract setting the deployer as the initial owner.
85396
Ownable
owner
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
return _owner;
* * @dev Returns the address of the current owner.
85396
Ownable
renounceOwnership
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
emit OwnershipTransferred(_owner, address(0)); _owner = address(0);
* * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only av...
85396
Ownable
transferOwnership
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner;
* * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner.
85396
Ownable
lock
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
_previousOwner = _owner; _owner = address(0); _lockTime = now + time; emit OwnershipTransferred(_owner, address(0));
Locks the contract for owner for the amount of time provided
85396
Ownable
unlock
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
require(_previousOwner == msg.sender, "You don't have permission to unlock"); require(now > _lockTime , "Contract is locked until 7 days"); emit OwnershipTransferred(_owner, _previousOwner); _owner = _previousOwner;
Unlocks the contract for owner when _lockTime is exceeds
85396
SplishSplash
manualSwap
contract SplishSplash is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; ...
uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance);
We are exposing these functions to be able to manual swap and send in case the token is highly valued and 5M becomes too much
85396
SplishSplash
null
contract SplishSplash is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; ...
to recieve ETH from uniswapV2Router when swaping
85397
BasicToken
transfer
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.