Unnamed: 0 int64 0 7.36k | comments stringlengths 3 35.2k | code_string stringlengths 1 527k | code stringlengths 1 527k | __index_level_0__ int64 0 88.6k |
|---|---|---|---|---|
15 | // Returns number of promotional LOT earnt as calculatedbased on number of entries, current ICO exchange rate and the current Etheraffle ticket price./ | function getPromoLOTEarnt(uint _entries) public view returns (uint) {
return (_entries * getRate() * getTktPrice()) / (1 * 10 ** 18);
}
| function getPromoLOTEarnt(uint _entries) public view returns (uint) {
return (_entries * getRate() * getTktPrice()) / (1 * 10 ** 18);
}
| 34,136 |
150 | // Mint & setup on gated only drop |
function mintBatchEditionGatedOnly(
uint16 _editionSize,
uint256 _merkleIndex,
bytes32[] calldata _merkleProof,
address _deployedRoyaltiesHandler,
string calldata _uri
|
function mintBatchEditionGatedOnly(
uint16 _editionSize,
uint256 _merkleIndex,
bytes32[] calldata _merkleProof,
address _deployedRoyaltiesHandler,
string calldata _uri
| 47,831 |
86 | // changefee Collector wallet address | * Emit {FeeCollectorChanged} evt
*
* Requirements:
* only Is InOwners require
*/
function setFeeCollector(address newOp)
external
onlyOwner
returns (bool)
{
address old = _feeCollector;
_feeCollector = newOp;
emit FeeCollectorChanged(... | * Emit {FeeCollectorChanged} evt
*
* Requirements:
* only Is InOwners require
*/
function setFeeCollector(address newOp)
external
onlyOwner
returns (bool)
{
address old = _feeCollector;
_feeCollector = newOp;
emit FeeCollectorChanged(... | 42,528 |
96 | // Set the local router pointer | uniswapV2Router = _uniswapV2Router;
| uniswapV2Router = _uniswapV2Router;
| 18,141 |
6 | // Function to be called by top level contract after initialization to enable the contract at a future block number rather than immediately. / | function initializedAt(uint256 _blockNumber) internal onlyInit {
INITIALIZATION_BLOCK_POSITION.setStorageUint256(_blockNumber);
}
| function initializedAt(uint256 _blockNumber) internal onlyInit {
INITIALIZATION_BLOCK_POSITION.setStorageUint256(_blockNumber);
}
| 1,719 |
54 | // return cost of TokenId. | function getTokenCost(uint256 tokenId_) external view returns (uint256) {
return tokenIdtoCost[tokenId_];
}
| function getTokenCost(uint256 tokenId_) external view returns (uint256) {
return tokenIdtoCost[tokenId_];
}
| 1,780 |
13 | // Last Token Id Generated. | uint256 public LAST_TOKEN_ID;
| uint256 public LAST_TOKEN_ID;
| 71,927 |
68 | // Returns the current address of the Unikura Mothership contract. A view function that does not mutate the state of the contract.return An address type that holds the address of the Unikura Mothership contract. / | function unikuraMothership() public view returns (address) {
return
address(
UnikuraPhygitalCollectionStorage.layout()._unikuraMothership
);
}
| function unikuraMothership() public view returns (address) {
return
address(
UnikuraPhygitalCollectionStorage.layout()._unikuraMothership
);
}
| 42,293 |
93 | // If this is the first bid, ensure it's >= the reserve price | require(auction.amount <= msg.value, "NFTMarketReserveAuction: Bid must be at least the reserve price");
| require(auction.amount <= msg.value, "NFTMarketReserveAuction: Bid must be at least the reserve price");
| 16,122 |
64 | // See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is notrequired by the EIP. See the note at the beginning of {ERC20}. Requirements: - `source` and `recipient` cannot be the zero address.- `source` must have a balance of at least `amount`.- the caller must have allowance for... |
function transferFrom(address source, address recipient, uint256 amount) public virtual override returns (bool) {
require(source != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
|
function transferFrom(address source, address recipient, uint256 amount) public virtual override returns (bool) {
require(source != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
| 5,879 |
58 | // Whether or not a domain specific by an id is available. | function isAvailable(uint256 id) external view returns (bool);
| function isAvailable(uint256 id) external view returns (bool);
| 36,508 |
23 | // add an address to the list of owners _ownerToRemove the address of the new owner / | function removeOwner(address _ownerToRemove) public onlyTroveOwner {
require(owner() != _ownerToRemove, "604e3 do not remove main owner");
_revokeRole(OWNER_ROLE, _ownerToRemove);
}
| function removeOwner(address _ownerToRemove) public onlyTroveOwner {
require(owner() != _ownerToRemove, "604e3 do not remove main owner");
_revokeRole(OWNER_ROLE, _ownerToRemove);
}
| 22,063 |
4 | // Creates an SKU and associates the specified ERC20 F1DTCrateKey token contract with it. Reverts if called by any other than the contract owner. Reverts if `totalSupply` is zero. Reverts if `sku` already exists. Reverts if the update results in too many SKUs. Reverts if the `totalSupply` is SUPPLY_UNLIMITED. Reverts i... | function createCrateKeySku(
bytes32 sku,
uint256 totalSupply,
uint256 maxQuantityPerPurchase,
IF1DTCrateKeyFull crateKey
| function createCrateKeySku(
bytes32 sku,
uint256 totalSupply,
uint256 maxQuantityPerPurchase,
IF1DTCrateKeyFull crateKey
| 15,096 |
36 | // Contract module which provides a basic access control mechanism, wherethere is an account (an owner) that can be granted exclusive access tospecific functions. This module is used through inheritance. It will make available the modifier`onlyOwner`, which can be aplied to your functions to restrict their use tothe ow... | contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTrans... | contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTrans... | 19,179 |
30 | // We can't just read the balance of token, because we need to know the full pair in order to compute the pair hash and access the balance mapping. We therefore rely on `_getTwoTokenPoolBalances`. | (, IERC20 tokenA, bytes32 balanceA, IERC20 tokenB, bytes32 balanceB) = _getTwoTokenPoolBalances(poolId);
if (token == tokenA) {
return balanceA;
} else if (token == tokenB) {
| (, IERC20 tokenA, bytes32 balanceA, IERC20 tokenB, bytes32 balanceB) = _getTwoTokenPoolBalances(poolId);
if (token == tokenA) {
return balanceA;
} else if (token == tokenB) {
| 26,434 |
71 | // Destroys `tokenId`. | function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_owners[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
| function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_owners[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
| 32,128 |
0 | // IRealitioArbitrator / | interface IRealitioArbitrator {
/** @dev Returns Realitio implementation instance.
*/
function realitio() external view returns (IRealitio);
/** @dev Provides a string of json-encoded metadata. The following properties are scheduled for implementation in the Reality.eth dapp:
tos: A URI repres... | interface IRealitioArbitrator {
/** @dev Returns Realitio implementation instance.
*/
function realitio() external view returns (IRealitio);
/** @dev Provides a string of json-encoded metadata. The following properties are scheduled for implementation in the Reality.eth dapp:
tos: A URI repres... | 14,664 |
21 | // ERC725 X (Core) executor Implementation of a contract module which provides the ability to call arbitrary functions at any other smart contract and itself,including using `delegatecall`, `staticcall`, as well creating contracts using `create` and `create2`.This is the basis for a smart contract based account system,... | abstract contract ERC725XCore is OwnableUnset, ERC165Storage, IERC725X {
bytes4 internal constant _INTERFACE_ID_ERC725X = type(IERC725X).interfaceId;
/* Public functions */
/**
* @notice Executes any other smart contract. Is only callable by the owner.
*
*
* @param _operation the opera... | abstract contract ERC725XCore is OwnableUnset, ERC165Storage, IERC725X {
bytes4 internal constant _INTERFACE_ID_ERC725X = type(IERC725X).interfaceId;
/* Public functions */
/**
* @notice Executes any other smart contract. Is only callable by the owner.
*
*
* @param _operation the opera... | 48,749 |
37 | // withdraw all funds instantly | function withdraw() public onlyOwner {
uint256 balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
| function withdraw() public onlyOwner {
uint256 balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
| 4,490 |
2 | // Burns a specific amount of tokens from the target address and decrements allowance from address The address which you want to send tokens from value uint256 The amount of token to be burned // | function burnFrom(address from, uint256 value) public {
_burnFrom(from, value);
//Only the owner's address can be burned. @ejkang
}
| function burnFrom(address from, uint256 value) public {
_burnFrom(from, value);
//Only the owner's address can be burned. @ejkang
}
| 23,235 |
200 | // Domino (DOMI) ERC20 tokenDomino is a core ERC20 token powering the game. It serves as an in-game currency, is tradable on exchanges, it powers up the governance protocol (Domino DAO) and participates in Yield Farming.Token Summary: - Symbol: DOMI - Name: Domino - Decimals: 18 - Initial token supply: 70,000,000 DOMI ... | contract DominoERC20 is AccessControl {
/**
* @dev Smart contract unique identifier, a random number
* @dev Should be regenerated each time smart contact source code is changed
* and changes smart contract itself is to be redeployed
* @dev Generated using https://www.random.org/bytes/
*/
uint256... | contract DominoERC20 is AccessControl {
/**
* @dev Smart contract unique identifier, a random number
* @dev Should be regenerated each time smart contact source code is changed
* and changes smart contract itself is to be redeployed
* @dev Generated using https://www.random.org/bytes/
*/
uint256... | 69,480 |
41 | // Fallback function.Implemented entirely in `_fallback`. / | fallback () payable external {
_fallback();
}
| fallback () payable external {
_fallback();
}
| 14,326 |
45 | // Only transfer unlocked balance | if(isBonusLocked) {
require(balances[msg.sender].sub(lockedBalances[msg.sender]) >= _value);
}
| if(isBonusLocked) {
require(balances[msg.sender].sub(lockedBalances[msg.sender]) >= _value);
}
| 12,552 |
19 | // Math operations with safety checks | library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
require(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// require(b > 0); // Solidity automatically throws when... | library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
require(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// require(b > 0); // Solidity automatically throws when... | 53,790 |
8 | // Changes the percentage of appeal fees that must be added to appeal cost for the winning party._winnerMultiplier The new winner mulitplier value. / | function changeWinnerMultiplier(uint _winnerMultiplier) public onlyByGovernor {
winnerMultiplier = _winnerMultiplier;
}
| function changeWinnerMultiplier(uint _winnerMultiplier) public onlyByGovernor {
winnerMultiplier = _winnerMultiplier;
}
| 13,483 |
28 | // Get the terminal for this contract's project. | ITerminal _terminal = terminalDirectory.terminalOf(projectId);
| ITerminal _terminal = terminalDirectory.terminalOf(projectId);
| 43,286 |
73 | // count num of digits number uint256 of the nuumber to be checkedreturn uint8 num of digits / | function numDigits(uint256 number) public pure returns (uint8) {
uint8 digits = 0;
while(number != 0) {
number = number.div(10);
digits++;
}
return digits;
}
| function numDigits(uint256 number) public pure returns (uint8) {
uint8 digits = 0;
while(number != 0) {
number = number.div(10);
digits++;
}
return digits;
}
| 18,144 |
45 | // The owner of this address is the Mobilink team | address public mobilinkTeamAddress;
| address public mobilinkTeamAddress;
| 20,390 |
13 | // _icoSupply is the avalable unit. Initially, it is _totalSupply | uint public _icoSupply = _totalSupply * _icoPercent / 100;
| uint public _icoSupply = _totalSupply * _icoPercent / 100;
| 35,013 |
156 | // The interim registrar | HashRegistrar public previousRegistrar;
| HashRegistrar public previousRegistrar;
| 39,084 |
50 | // Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],but also transferring `value` wei to `target`. Requirements: - the calling contract must have an ETH balance of at least `value`.- the called Solidity function must be `payable`. _Available since v3.1._ / | function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
| function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
| 359 |
63 | // The normal state flag of the call address. 0 | uint8 normalFlag;
| uint8 normalFlag;
| 74,779 |
18 | // The max fee (15%) cannot be changedThis is so the community doesn't have to trust the fee tweaker that muchMalicious behaviour is thus limited | require((new_liquidity_fee + new_reflection_fee + new_burn_fee) <= 15);
liquidity_fee = new_liquidity_fee;
reflection_fee = new_reflection_fee;
burn_fee = new_burn_fee;
emit FeesTweaked(new_liquidity_fee, new_reflection_fee, new_burn_fee);
| require((new_liquidity_fee + new_reflection_fee + new_burn_fee) <= 15);
liquidity_fee = new_liquidity_fee;
reflection_fee = new_reflection_fee;
burn_fee = new_burn_fee;
emit FeesTweaked(new_liquidity_fee, new_reflection_fee, new_burn_fee);
| 56,876 |
7 | // Get the tokens owned by _owner / | function tokensOfOwner(address _owner) external view returns(uint256[] memory ) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
// Return an empty array
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 index;
for ... | function tokensOfOwner(address _owner) external view returns(uint256[] memory ) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
// Return an empty array
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 index;
for ... | 54,499 |
17 | // Mint the token | created[tokenId] = true;
super._safeMint(to, tokenId);
emit LogGetWawa(msg.sender, to, tokenId, faction, petId, trait, _tokenURI, gene, block.timestamp);
| created[tokenId] = true;
super._safeMint(to, tokenId);
emit LogGetWawa(msg.sender, to, tokenId, faction, petId, trait, _tokenURI, gene, block.timestamp);
| 7,438 |
296 | // fire a minted event | emit Minted(msg.sender, _to, _value);
| emit Minted(msg.sender, _to, _value);
| 49,875 |
115 | // |/INTERFACE_SIGNATURE_ERC165 = bytes4(keccak256("supportsInterface(bytes4)")); / | bytes4 constant private INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7;
| bytes4 constant private INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7;
| 14,792 |
5 | // SafeMath Library safeSub Import/ | function safeSub(uint256 a, uint256 b) internal pure returns (uint256 z) {
assert((z = a - b) <= a);
}
| function safeSub(uint256 a, uint256 b) internal pure returns (uint256 z) {
assert((z = a - b) <= a);
}
| 7,918 |
181 | // Creates a pool for the given two tokens and fee/tokenA One of the two tokens in the desired pool/tokenB The other of the two tokens in the desired pool/swapFeeUnits Desired swap fee for the pool, in fee units/Token order does not matter. tickDistance is determined from the fee./ Call will revert under any of these c... | function createPool(
address tokenA,
address tokenB,
uint24 swapFeeUnits
) external returns (address pool);
| function createPool(
address tokenA,
address tokenB,
uint24 swapFeeUnits
) external returns (address pool);
| 30,099 |
19 | // Check royalty info for collection collection collection addressreturn (whether there is a setter (address(0 if not)),Position0: Royalty setter is set in the registry1: ERC2981 and no setter2: setter can be set using owner()3: setter can be set using admin()4: setter cannot be set, nor support for ERC2981 / | function checkForCollectionSetter(address collection) external view returns (address, uint8) {
(address currentSetter, , ) = IRoyaltyFeeRegistry(royaltyFeeRegistry).royaltyFeeInfoCollection(collection);
if (currentSetter != address(0)) {
return (currentSetter, 0);
}
try... | function checkForCollectionSetter(address collection) external view returns (address, uint8) {
(address currentSetter, , ) = IRoyaltyFeeRegistry(royaltyFeeRegistry).royaltyFeeInfoCollection(collection);
if (currentSetter != address(0)) {
return (currentSetter, 0);
}
try... | 59,677 |
47 | // Constructor Function for the issuance of an {Set} token _components address[] A list of component address which you want to include _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components) / | constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
| constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
| 58,553 |
3 | // records blocks at which investments/payments were made | mapping (address => uint) public atBlock;
| mapping (address => uint) public atBlock;
| 24,702 |
418 | // Determine what the account liquidity would be if the given amounts were redeemed/borrowed account The account to determine liquidity for pTokenModify The market to hypothetically redeem/borrow in redeemTokens The number of tokens to hypothetically redeem borrowAmount The amount of underlying to hypothetically borrow... | function getHypotheticalAccountLiquidityInternal(
address account,
PToken pTokenModify,
uint redeemTokens,
| function getHypotheticalAccountLiquidityInternal(
address account,
PToken pTokenModify,
uint redeemTokens,
| 79,816 |
4 | // @inheritdoc IERC20Mintable/Reverts if the sender is not a minter. | function mint(address to, uint256 value) public virtual override {
_requireMinter(_msgSender());
_mint(to, value);
}
| function mint(address to, uint256 value) public virtual override {
_requireMinter(_msgSender());
_mint(to, value);
}
| 20,076 |
0 | // call chainlink contract here |
currentRequestId++;
|
currentRequestId++;
| 53,271 |
2 | // Stores the sent _amount as funds to be withdrawn._amount The amount funds to deposit./ | function deposit(uint256 _amount) public {
address msgSender = msg.sender;
token.transferFrom(msgSender, address(this), _amount);
_deposits[msgSender] = _deposits[msgSender].add(_amount);
emit Deposited(msgSender, _amount);
}
| function deposit(uint256 _amount) public {
address msgSender = msg.sender;
token.transferFrom(msgSender, address(this), _amount);
_deposits[msgSender] = _deposits[msgSender].add(_amount);
emit Deposited(msgSender, _amount);
}
| 75,776 |
60 | // increase the long oToken balance in a vault when an oToken is deposited _vault vault to add a long position to _longOtoken address of the _longOtoken being added to the user's vault _amount number of _longOtoken the protocol is adding to the user's vault _index index of _longOtoken in the user's vault.longOtokens ar... | function addLong(
Vault storage _vault,
address _longOtoken,
uint256 _amount,
uint256 _index
| function addLong(
Vault storage _vault,
address _longOtoken,
uint256 _amount,
uint256 _index
| 63,431 |
143 | // ============================================== Helper Internal Functions ============================================== |
function _mintFungible(
address to,
uint256 id,
uint256 value
|
function _mintFungible(
address to,
uint256 id,
uint256 value
| 34,261 |
29 | // Constructor using Escapable and Hardcoded values | function MultiSend() Escapable(CALLER, DESTINATION) public {}
/// @notice Send to multiple addresses using a byte32 array which
/// includes the address and the amount.
/// Addresses and amounts are stored in a packed bytes32 array
/// Address is stored in the 20 most significant bytes
/// ... | function MultiSend() Escapable(CALLER, DESTINATION) public {}
/// @notice Send to multiple addresses using a byte32 array which
/// includes the address and the amount.
/// Addresses and amounts are stored in a packed bytes32 array
/// Address is stored in the 20 most significant bytes
/// ... | 17,907 |
69 | // Genomes | mapping(uint256 => uint256) public genome;
event ActiveHeroChanged(address indexed _from, uint256 _tokenId);
| mapping(uint256 => uint256) public genome;
event ActiveHeroChanged(address indexed _from, uint256 _tokenId);
| 55,690 |
35 | // Ensures that the calling function only continues execution if thecurrent block time is after or equal to the voting deadline. / | modifier isAfterVotingDeadline() {
require(now >= calcVotingDeadline(), "MACI: the voting period is not over");
_;
}
| modifier isAfterVotingDeadline() {
require(now >= calcVotingDeadline(), "MACI: the voting period is not over");
_;
}
| 17,580 |
64 | // uint contractBalance = Token(trustedRewardTokenAddress).balanceOf(address(this)); |
if (contractBalance < amount) {
amount = contractBalance;
}
|
if (contractBalance < amount) {
amount = contractBalance;
}
| 26,738 |
5 | // PIGGY-MODIFY: Per-account mapping of "assets you are in", capped by maxAssets / | mapping(address => IPToken[]) public accountAssets;
| mapping(address => IPToken[]) public accountAssets;
| 2,952 |
11 | // Mapping from owner to its margin account | mapping (address => LibTypes.MarginAccount) internal marginAccounts;
| mapping (address => LibTypes.MarginAccount) internal marginAccounts;
| 16,510 |
29 | // This function verifies the caller and maker parametersRequirements:- should be called by owner or anboto approved- should be called before deadline- should be called within specified gas price limit- should be called within specified fee limit- should be called with input and output tokens that differ- should be sig... | function _verify(
Order calldata order,
address maker,
bytes memory sig
| function _verify(
Order calldata order,
address maker,
bytes memory sig
| 2,965 |
175 | // Returns the state of an authorization, more specifically if the specified nonce was already used by the address specifiedNonces are expected to be client-side randomly generated 32-byte data unique to the authorizer's addressauthorizer_ Authorizer's address nonce_ Nonce of the authorizationreturn true if the nonce i... | function authorizationState(
address authorizer_,
bytes32 nonce_
| function authorizationState(
address authorizer_,
bytes32 nonce_
| 40,300 |
392 | // This is an existing owner trying to extend their key | newTimeStamp = toKey.expirationTimestamp + expirationDuration;
toKey.expirationTimestamp = newTimeStamp;
emit RenewKeyPurchase(_recipient, newTimeStamp);
| newTimeStamp = toKey.expirationTimestamp + expirationDuration;
toKey.expirationTimestamp = newTimeStamp;
emit RenewKeyPurchase(_recipient, newTimeStamp);
| 14,655 |
120 | // Temporaritly set the transfer flag to allow a transfer to occur | _allowTransferWhileFlying = true;
safeTransferFrom(from, to, tokenId);
| _allowTransferWhileFlying = true;
safeTransferFrom(from, to, tokenId);
| 14,546 |
139 | // Returns the minimum bond that can answer the question/question_id The ID of the question | function getMinBond(bytes32 question_id)
| function getMinBond(bytes32 question_id)
| 51,764 |
108 | // The total amount of ERC20 that's paid out as reward. | uint256 public paidOut = 0;
| uint256 public paidOut = 0;
| 7,680 |
0 | // Hardcoded constant to save gas/ | bytes32 constant internal AGENT_APP_ID = 0x9ac98dc5f995bf0211ed589ef022719d1487e5cb2bab505676f0d084c07cf89a;
bytes32 constant internal VAULT_APP_ID = 0x7e852e0fcfce6551c13800f1e7476f982525c2b5277ba14b24339c68416336d1;
bytes32 constant internal VOTING_APP_ID = 0x9fa3927f639745e587912d4b0fea7ef9013bf93fb907d2... | bytes32 constant internal AGENT_APP_ID = 0x9ac98dc5f995bf0211ed589ef022719d1487e5cb2bab505676f0d084c07cf89a;
bytes32 constant internal VAULT_APP_ID = 0x7e852e0fcfce6551c13800f1e7476f982525c2b5277ba14b24339c68416336d1;
bytes32 constant internal VOTING_APP_ID = 0x9fa3927f639745e587912d4b0fea7ef9013bf93fb907d2... | 10,039 |
27 | // Fetch static information about an array of assets. This method can be used for off-chain pagination. / | function assetsStatic(address[] memory _assetsAddresses)
public
view
returns (AssetStatic[] memory)
| function assetsStatic(address[] memory _assetsAddresses)
public
view
returns (AssetStatic[] memory)
| 85,393 |
12 | // Verify the permission of a address (Ethereum address)return whether the operation success / | function verifyPermission(address verifiedAddr, string calldata tableName)
external
view
returns (uint8)
| function verifyPermission(address verifiedAddr, string calldata tableName)
external
view
returns (uint8)
| 45,145 |
36 | // Check is user in group//_groupName user array/_user user array// return status | function isUserInGroup(bytes32 _groupName, address _user) public view returns (bool) {
return isRegisteredUser(_user) && address2member[_user].groupName2index[_groupName] != 0;
}
| function isUserInGroup(bytes32 _groupName, address _user) public view returns (bool) {
return isRegisteredUser(_user) && address2member[_user].groupName2index[_groupName] != 0;
}
| 82,180 |
18 | // Check if document has a read rule defined | bytes8 readRoleIndex = super._requireReadRole(
signingRoot_,
properties[READ_ROLE_IDX],
values[READ_ROLE_IDX],
salts[READ_ROLE_IDX],
proofs[READ_ROLE_IDX]
);
| bytes8 readRoleIndex = super._requireReadRole(
signingRoot_,
properties[READ_ROLE_IDX],
values[READ_ROLE_IDX],
salts[READ_ROLE_IDX],
proofs[READ_ROLE_IDX]
);
| 50,128 |
3 | // Allows owner to pause the contract / | function pause() public onlyOwner returns (bool) {
_pause();
return true;
}
| function pause() public onlyOwner returns (bool) {
_pause();
return true;
}
| 29,732 |
41 | // Corruption percent rate per second | uint128 public constant CORRUPTION_BURN_PERCENT_RATE = 1157407407407; // 10% burned per day
| uint128 public constant CORRUPTION_BURN_PERCENT_RATE = 1157407407407; // 10% burned per day
| 23,366 |
113 | // freeze address | mapping (address => bool) freezed;
constructor () public
ERC20Detailed(NAME, SYMBOL, DECIMALS)
| mapping (address => bool) freezed;
constructor () public
ERC20Detailed(NAME, SYMBOL, DECIMALS)
| 35,554 |
3 | // Accept any incoming amount | function () external payable {
emit Deposit (msg.sender, msg.value);
}
| function () external payable {
emit Deposit (msg.sender, msg.value);
}
| 43,638 |
34 | // No risk of wrapping around on casting to uint256 since deposit end always > deposit start and types are 64 bits | uint256 shareAmount = userDeposit.amount * getMultiplier(uint256(userDeposit.end - userDeposit.start)) / 1e18;
| uint256 shareAmount = userDeposit.amount * getMultiplier(uint256(userDeposit.end - userDeposit.start)) / 1e18;
| 24,060 |
14 | // cancel buy if strings are too long | if (bytes(href).length > 100 || bytes(anchor).length > 50) throw;
| if (bytes(href).length > 100 || bytes(anchor).length > 50) throw;
| 20,349 |
185 | // Check if there's a bid fee and transfer the amount to marketplace owner | if (bidFeePerMillion > 0) {
| if (bidFeePerMillion > 0) {
| 3,812 |
175 | // m = avgPrice i = m (1-quote/(mbase)) if quote = mbase i = 1 if quote > mbase reverse | uint256 avgPrice = unUsedBase == 0 ? _I_ : DecimalMath.divCeil(poolQuote, unUsedBase);
uint256 baseDepth = DecimalMath.mulFloor(avgPrice, poolBase);
if (poolQuote == 0) {
| uint256 avgPrice = unUsedBase == 0 ? _I_ : DecimalMath.divCeil(poolQuote, unUsedBase);
uint256 baseDepth = DecimalMath.mulFloor(avgPrice, poolBase);
if (poolQuote == 0) {
| 38,516 |
4 | // Determine the amount of shares gained from depositing | uint256 sharesGained = vaultToken.balanceOf(address(this));
_transferAndSetChainedReference(vaultToken, recipient, sharesGained, outputReference);
| uint256 sharesGained = vaultToken.balanceOf(address(this));
_transferAndSetChainedReference(vaultToken, recipient, sharesGained, outputReference);
| 27,837 |
8 | // Functions: |
function burn(
address _to,
uint256 _amount,
uint256 _nonce,
bytes calldata _signature
|
function burn(
address _to,
uint256 _amount,
uint256 _nonce,
bytes calldata _signature
| 32,063 |
12 | // Reference percentage | mapping(address => ReferRecord[]) public referRecords;
Refer public refer;
mapping (address => uint256) public pendingReferPower; // unsettle refer power
uint256 constant LEVEL_3 = 3;
uint256 constant LEVEL_4 = 4;
uint256 constant LEVEL_5 = 5;
uint256 constant UPGRADE_REFER_COUNT = 3;
| mapping(address => ReferRecord[]) public referRecords;
Refer public refer;
mapping (address => uint256) public pendingReferPower; // unsettle refer power
uint256 constant LEVEL_3 = 3;
uint256 constant LEVEL_4 = 4;
uint256 constant LEVEL_5 = 5;
uint256 constant UPGRADE_REFER_COUNT = 3;
| 23,606 |
128 | // OVERRIDEtransfer token for a specified address_to The address to transfer to._value The amount to be transferred. return bool/ | function transfer(address _to, uint256 _value) public returns (bool) {
if (checkWhitelistEnabled()) {
checkIfWhitelisted(msg.sender);
checkIfWhitelisted(_to);
}
return super.transfer(_to, _value);
}
| function transfer(address _to, uint256 _value) public returns (bool) {
if (checkWhitelistEnabled()) {
checkIfWhitelisted(msg.sender);
checkIfWhitelisted(_to);
}
return super.transfer(_to, _value);
}
| 4,109 |
0 | // state of the orders | mapping(bytes32 => uint) public fills;
| mapping(bytes32 => uint) public fills;
| 8,270 |
314 | // Revokes permission if allowed. This requires `msg.sender` to be the the permission managerRevoke from `_entity` the ability to perform actions requiring `_role` on `_app`_entity Address of the whitelisted entity to revoke access from_app Address of the app in which the role will be revoked_role Identifier for the gr... | function revokePermission(address _entity, address _app, bytes32 _role)
external
onlyPermissionManager(_app, _role)
| function revokePermission(address _entity, address _app, bytes32 _role)
external
onlyPermissionManager(_app, _role)
| 47,134 |
22 | // Network - Returns data of active pools and network value./Gabriele Rigo - <gab@rigoblock.com> | contract Network {
address public DRAGOREGISTRYADDRESS;
constructor(
address dragoRegistryAddress)
public
{
DRAGOREGISTRYADDRESS = dragoRegistryAddress;
}
/*
* CONSTANT PUBLIC FUNCTIONS
*/
/// @dev Returns two arrays of prices and total supply
/// @return... | contract Network {
address public DRAGOREGISTRYADDRESS;
constructor(
address dragoRegistryAddress)
public
{
DRAGOREGISTRYADDRESS = dragoRegistryAddress;
}
/*
* CONSTANT PUBLIC FUNCTIONS
*/
/// @dev Returns two arrays of prices and total supply
/// @return... | 43,176 |
525 | // Checks all cash group settings for invalid values and sets them into storage | function setCashGroupStorage(uint256 currencyId, CashGroupSettings calldata cashGroup)
internal
| function setCashGroupStorage(uint256 currencyId, CashGroupSettings calldata cashGroup)
internal
| 10,987 |
94 | // Burn transferBurnRate% from amount | super._burn(sender, _burntAmount);
| super._burn(sender, _burntAmount);
| 12,725 |
178 | // ctx[mmHalfFriInvGroup + idx] = lastValInv; |
mstore(add(friHalfInvGroupPtr, mul(idx, 0x20)), lastValInv)
|
mstore(add(friHalfInvGroupPtr, mul(idx, 0x20)), lastValInv)
| 2,286 |
105 | // The number of checkpoints for each account | mapping (address => uint32) public numCheckpoints;
| mapping (address => uint32) public numCheckpoints;
| 18,196 |
4 | // Errors allow you to provide information about why an operation failed. They are returned to the caller of the function. | error InsufficientBalance(uint requested, uint available);
| error InsufficientBalance(uint requested, uint available);
| 27,202 |
52 | // Emits {Transfer} event to reflect WETH10 token burn of `value` to zero address from caller account. / Requirements:/ - caller account must have at least `value` balance of WETH10 token. | function withdraw(uint256 value) external override {
| function withdraw(uint256 value) external override {
| 28,283 |
48 | // not check if old ad if end or not | delete adTable[uint64(id)];
| delete adTable[uint64(id)];
| 29,029 |
39 | // Returns the landIds you won so you know which landIds you can redeem | function checkWonLands() public view returns(uint256[] memory) {
uint256[] memory result;
uint256 counter = 0;
for(uint256 i = 0; i < activeLands.length; i++) {
uint256 landId = activeLands[i];
if (lands[landId].state == AuctionState.ENDED && lands[landId].owner == ms... | function checkWonLands() public view returns(uint256[] memory) {
uint256[] memory result;
uint256 counter = 0;
for(uint256 i = 0; i < activeLands.length; i++) {
uint256 landId = activeLands[i];
if (lands[landId].state == AuctionState.ENDED && lands[landId].owner == ms... | 2,184 |
33 | // one winner (one bid) | winner = highestBid.owner;
cost = highestBid.value;
| winner = highestBid.owner;
cost = highestBid.value;
| 23,582 |
60 | // Returns number of canvases owned by the given address./ | function balanceOf(address _owner) external view returns (uint) {
return addressToCount[_owner];
}
| function balanceOf(address _owner) external view returns (uint) {
return addressToCount[_owner];
}
| 4,640 |
2 | // |/ Creates a NiftySwap Exchange for given token contract _tokenThe address of the ERC-1155 token contract _currency The address of the ERC-20 token contract _lpFeeFee that will go to LPs. Number between 0 and 1000, where 10 is 1.0% and 100 is 10%. _instance Instancethat allows to deploy new instances of an exchange.... | function createExchange(address _token, address _currency, uint256 _lpFee, uint256 _instance) public override {
require(tokensToExchange[_token][_currency][_instance] == address(0x0), "NF20#1"); // NiftyswapFactory20#createExchange: EXCHANGE_ALREADY_CREATED
| function createExchange(address _token, address _currency, uint256 _lpFee, uint256 _instance) public override {
require(tokensToExchange[_token][_currency][_instance] == address(0x0), "NF20#1"); // NiftyswapFactory20#createExchange: EXCHANGE_ALREADY_CREATED
| 34,884 |
5 | // Keep a list of all the redeemers ordered by time. It will be used at some point... | address[] public redeemers;
| address[] public redeemers;
| 2,707 |
32 | // Calculate points. Less than 1 minute is no payout | uint timeElapsedInSeconds = _laterTime.sub(_earlierTime);
| uint timeElapsedInSeconds = _laterTime.sub(_earlierTime);
| 45,928 |
967 | // Helper function to deploy a configured ComptrollerProxy | function __deployComptrollerProxy(
address _denominationAsset,
uint256 _sharesActionTimelock,
bytes memory _feeManagerConfigData,
bytes memory _policyManagerConfigData,
bool _forMigration
) private returns (address comptrollerProxy_) {
require(
_denomi... | function __deployComptrollerProxy(
address _denominationAsset,
uint256 _sharesActionTimelock,
bytes memory _feeManagerConfigData,
bytes memory _policyManagerConfigData,
bool _forMigration
) private returns (address comptrollerProxy_) {
require(
_denomi... | 44,426 |
10 | // Accumulated amount of tokens reserved for liquidity | uint256 private accLiquidityAmount;
| uint256 private accLiquidityAmount;
| 36,502 |
12 | // Construct the factory/_swapX2YModule swap module to support swapX2Y(DesireY)/_swapY2XModule swap module to support swapY2X(DesireX)/_liquidityModule liquidity module to support mint/burn/collect/_limitOrderModule module for user to manage limit orders/_flashModule module for user to flash/_defaultFeeChargePercent de... | constructor(
address _chargeReceiver,
address _swapX2YModule,
address _swapY2XModule,
address _liquidityModule,
address _limitOrderModule,
address _flashModule,
uint24 _defaultFeeChargePercent
| constructor(
address _chargeReceiver,
address _swapX2YModule,
address _swapY2XModule,
address _liquidityModule,
address _limitOrderModule,
address _flashModule,
uint24 _defaultFeeChargePercent
| 27,051 |
8 | // setter for protocol fees/newProtocolFeePrimary fee for primary market/newProtocolFeeSecondary fee for secondary market | function setProtocolFee(uint256 newProtocolFeePrimary, uint256 newProtocolFeeSecondary) external onlyOwner {
require(newProtocolFeePrimary < 5000, "invalid primary fee");
require(newProtocolFeeSecondary < 5000, "invalid secodary fee");
protocolFeePrimary = newProtocolFeePrimary;
prot... | function setProtocolFee(uint256 newProtocolFeePrimary, uint256 newProtocolFeeSecondary) external onlyOwner {
require(newProtocolFeePrimary < 5000, "invalid primary fee");
require(newProtocolFeeSecondary < 5000, "invalid secodary fee");
protocolFeePrimary = newProtocolFeePrimary;
prot... | 16,474 |
38 | // check whether a given user is registered as owning a given wallet | function userOwnsWallet(address _user, address _wallet) external view returns (bool) {
return _ownerToWallets[_user].contains(_wallet);
}
| function userOwnsWallet(address _user, address _wallet) external view returns (bool) {
return _ownerToWallets[_user].contains(_wallet);
}
| 35,373 |
22 | // ======== END CONTRACT VARIABLES =============== |
uint public lastClaimedTime;
uint public deployTime;
|
uint public lastClaimedTime;
uint public deployTime;
| 12,408 |
55 | // if the applicant is already a member, add to their existing shares & loot | if (members[proposal.applicant].exists) {
members[proposal.applicant].shares = members[proposal.applicant].shares.add(proposal.sharesRequested);
members[proposal.applicant].loot = members[proposal.applicant].loot.add(proposal.lootRequested);
| if (members[proposal.applicant].exists) {
members[proposal.applicant].shares = members[proposal.applicant].shares.add(proposal.sharesRequested);
members[proposal.applicant].loot = members[proposal.applicant].loot.add(proposal.lootRequested);
| 19,807 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.