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 |
|---|---|---|---|---|
13 | // mStable ======= keccak256("OracleHub"); | bytes32 internal constant KEY_ORACLE_HUB =
0x8ae3a082c61a7379e2280f3356a5131507d9829d222d853bfa7c9fe1200dd040;
| bytes32 internal constant KEY_ORACLE_HUB =
0x8ae3a082c61a7379e2280f3356a5131507d9829d222d853bfa7c9fe1200dd040;
| 15,914 |
19 | // Addition with safety check/ | function Add(uint a, uint b) internal returns (uint) {
uint c = a + b;
//result must be greater as a or b can not be negative
assert(c>=a && c>=b);
return c;
}
| function Add(uint a, uint b) internal returns (uint) {
uint c = a + b;
//result must be greater as a or b can not be negative
assert(c>=a && c>=b);
return c;
}
| 28,208 |
23 | // Approve the owner for Uniswap, timesaver. | _approve(_msgSender(), _routerAddress, _tTotal);
| _approve(_msgSender(), _routerAddress, _tTotal);
| 4,993 |
335 | // totalVoters: amount of active galaxies | uint16 public totalVoters;
| uint16 public totalVoters;
| 51,967 |
7 | // Modifier throws if called by any account other than the pendingOwner. / | modifier onlyPendingOwner() {
require(msg.sender == pendingOwner, "only pending owner");
_;
}
| modifier onlyPendingOwner() {
require(msg.sender == pendingOwner, "only pending owner");
_;
}
| 25,246 |
112 | // reverts if oracle type is disabled | require(vaultParameters.isOracleTypeEnabled(oracleType[asset][positionOwner], asset), "Unit Protocol: WRONG_ORACLE_TYPE");
| require(vaultParameters.isOracleTypeEnabled(oracleType[asset][positionOwner], asset), "Unit Protocol: WRONG_ORACLE_TYPE");
| 84,099 |
82 | // check volume | uint256 currentVolume = volume[from][
block.timestamp /
volumePeriod /* loss of precision is required here */
];
require(
currentVolume + amount <= maxVolumePerPeriod,
"exceeds max tx amount per period"
)... | uint256 currentVolume = volume[from][
block.timestamp /
volumePeriod /* loss of precision is required here */
];
require(
currentVolume + amount <= maxVolumePerPeriod,
"exceeds max tx amount per period"
)... | 19,366 |
18 | // calc remaining amount of tokens to be minted sent to LP, mint them | uint256 toLP_ = initialMint - toDeployer;
_mint(address(this), toLP_);
| uint256 toLP_ = initialMint - toDeployer;
_mint(address(this), toLP_);
| 30,827 |
64 | // Set remove max wallet/per txn limits | function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize=_tTotal;
emit MaxTxAmountUpdated(_tTotal);
}
| function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize=_tTotal;
emit MaxTxAmountUpdated(_tTotal);
}
| 46,373 |
219 | // the maximum amount of reserved mints allowed for creator and giveaways | uint private maxReservedMints = 1000;
| uint private maxReservedMints = 1000;
| 28,034 |
11 | // We load and store the underlying decimals | uint8 localUnderlyingDecimals = localUnderlying.decimals();
_underlyingDecimals = localUnderlyingDecimals;
| uint8 localUnderlyingDecimals = localUnderlying.decimals();
_underlyingDecimals = localUnderlyingDecimals;
| 5,060 |
16 | // allows staking vesting KKO tokens in the kko single staking pool | function stakeSingle(uint256 scheduleNumber, uint256 _amountToStake) public onlyConfigured {
Schedule storage schedule = schedules[msg.sender][scheduleNumber];
require(
// ensure that the total amount of staked kko including the amount we are staking and lp'ing
// is less tha... | function stakeSingle(uint256 scheduleNumber, uint256 _amountToStake) public onlyConfigured {
Schedule storage schedule = schedules[msg.sender][scheduleNumber];
require(
// ensure that the total amount of staked kko including the amount we are staking and lp'ing
// is less tha... | 13,922 |
15 | // require approved minter |
_mintBatch(_to, _tokenIds, _values, _data);
|
_mintBatch(_to, _tokenIds, _values, _data);
| 70,228 |
132 | // ErrorLog( "claim seed is 0", 0 ); | VerifyClaim( msg.sender, 0x84000001, 0 );
return;
| VerifyClaim( msg.sender, 0x84000001, 0 );
return;
| 34,854 |
6 | // Last time of last claim | uint256 timeOfLastClaim;
| uint256 timeOfLastClaim;
| 26,135 |
72 | // Initialization function for upgradable proxy contracts _nexus Nexus contract address / | function _initialize(address _nexus) internal {
require(_nexus != address(0), "Nexus address is zero");
nexus = INexus(_nexus);
InitializableModuleKeys._initialize();
}
| function _initialize(address _nexus) internal {
require(_nexus != address(0), "Nexus address is zero");
nexus = INexus(_nexus);
InitializableModuleKeys._initialize();
}
| 31,467 |
7 | // Whether the contract is active or not | bool private active;
| bool private active;
| 8,963 |
237 | // Contract of the RariFundPriceConsumer. / | RariFundPriceConsumer public rariFundPriceConsumer;
| RariFundPriceConsumer public rariFundPriceConsumer;
| 35,750 |
63 | // @des Function to change address that is manage platform holding newAddress Address of new issuance contract./ | function changePlatform(address newAddress)
onlyCofounders
| function changePlatform(address newAddress)
onlyCofounders
| 42,281 |
796 | // Migrate LP token to another LP contract through the `migrator` contract./_pid The index of the pool. See `poolInfo`. | function migrate(uint256 _pid) public {
require(address(migrator) != address(0), "MasterChefV2: no migrator set");
IERC20 _lpToken = lpToken[_pid];
uint256 bal = _lpToken.balanceOf(address(this));
_lpToken.approve(address(migrator), bal);
IERC20 newLpToken = migrator.migrate(_lpToken);
require(bal == newLp... | function migrate(uint256 _pid) public {
require(address(migrator) != address(0), "MasterChefV2: no migrator set");
IERC20 _lpToken = lpToken[_pid];
uint256 bal = _lpToken.balanceOf(address(this));
_lpToken.approve(address(migrator), bal);
IERC20 newLpToken = migrator.migrate(_lpToken);
require(bal == newLp... | 38,567 |
122 | // Add Vote's details of a given claim. / | function addVote(
address _voter,
uint _tokens,
uint claimId,
int8 _verdict
)
external
onlyInternal
| function addVote(
address _voter,
uint _tokens,
uint claimId,
int8 _verdict
)
external
onlyInternal
| 82,018 |
130 | // Deploy and setup a royalties recipient for the given edition | function createAndUseRoyaltiesRecipient(
uint256 _editionId,
address _handler,
address[] calldata _recipients,
uint256[] calldata _splits
)
external returns (address deployedHandler);
| function createAndUseRoyaltiesRecipient(
uint256 _editionId,
address _handler,
address[] calldata _recipients,
uint256[] calldata _splits
)
external returns (address deployedHandler);
| 47,823 |
89 | // Get the token balance for account `tokenOwner` / | function balanceOf(
address _token,
address _owner
| function balanceOf(
address _token,
address _owner
| 28,379 |
142 | // See {IERC721-setApprovalForAll}. / | function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), "ERC721A: approve to caller");
if(restrictedApprovalAddresses[operator]) revert ERC721RestrictedApprovalAddressRestricted();
_operatorApprovals[_msgSender()][operator] = approved;
emit App... | function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), "ERC721A: approve to caller");
if(restrictedApprovalAddresses[operator]) revert ERC721RestrictedApprovalAddressRestricted();
_operatorApprovals[_msgSender()][operator] = approved;
emit App... | 2,573 |
6 | // Fallback function to receive Ethereum (ETH) when someone sends it directly to the contract's address. The contract must not be in a paused state for the deposit to be successful. / | receive() external payable whenNotPaused {
emit EtherDeposited(msg.sender, msg.value);
}
| receive() external payable whenNotPaused {
emit EtherDeposited(msg.sender, msg.value);
}
| 25,837 |
31 | // next config setters | function nextConfigSetStartBatchIndex(uint64 startBatchIndex)
public
onlyOwner
| function nextConfigSetStartBatchIndex(uint64 startBatchIndex)
public
onlyOwner
| 35,237 |
75 | // only collect if 1) there are tokens to collect & 2) token is whitelisted | require(amountToCollect > 0, "!amount");
require(tokenWhitelist[token], "!whitelisted");
| require(amountToCollect > 0, "!amount");
require(tokenWhitelist[token], "!whitelisted");
| 31,846 |
39 | // get tokens to be distributed between two timestamps scaled by SCALE | function getDistribution(uint256 _from, uint256 _to) public view returns (uint256) {
uint256 from = Math.max(startTime, _from);
uint256 to = Math.min(_to, contractDisabledAt == 0 ? endTime : contractDisabledAt);
if (from > to) return uint256(0);
from = from.sub(startTime);
to = to.sub(startTime)... | function getDistribution(uint256 _from, uint256 _to) public view returns (uint256) {
uint256 from = Math.max(startTime, _from);
uint256 to = Math.min(_to, contractDisabledAt == 0 ? endTime : contractDisabledAt);
if (from > to) return uint256(0);
from = from.sub(startTime);
to = to.sub(startTime)... | 16,817 |
176 | // bytes4(keccak256('beforeTokenMint(address,uint256,address,address)')) == 0x4d7f3db0 bytes4(keccak256('beforeTokenTransfer(address,address,uint256,address)')) == 0xb2210957 => 0x4d7f3db0 ^ 0xb2210957 == 0xff5e34e7/ | bytes4 public constant ERC165_INTERFACE_ID_TOKEN_LISTENER = 0xff5e34e7;
| bytes4 public constant ERC165_INTERFACE_ID_TOKEN_LISTENER = 0xff5e34e7;
| 51,150 |
324 | // A maximum cooldown to avoid malicious governance bricking the contract./1 day @ 12 sec / block | uint256 constant public MAX_COOLDOWN_BLOCKS = 7200;
| uint256 constant public MAX_COOLDOWN_BLOCKS = 7200;
| 69,080 |
119 | // Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range/Snapshots must only be compared to other snapshots, taken over a period for which a position existed./ I.e., snapshots cannot be compared if a position is not held for the entire period between when the first/ snapshot i... | function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
);
| function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
);
| 7,741 |
191 | // Add method in to verify banned ID's (Founders) | (_isblocked, s) = wrapperdb(dbcontract).isBlockedNFT(tokenIds_[i]);
require(_isblocked != true, "Banned Token_ID!");
companions.safeTransferFrom(
msg.sender,
address(this),
tokenIds_[i]
);
| (_isblocked, s) = wrapperdb(dbcontract).isBlockedNFT(tokenIds_[i]);
require(_isblocked != true, "Banned Token_ID!");
companions.safeTransferFrom(
msg.sender,
address(this),
tokenIds_[i]
);
| 2,482 |
1 | // Structure to of the accounting for each account | struct accountStatus {
uint256 allocatedTokens;
uint256 claimed;
}
| struct accountStatus {
uint256 allocatedTokens;
uint256 claimed;
}
| 57,420 |
156 | // the only funds in are in the loan, other than 10 WETH | investedUnderlyingBalance() <= liquidityLoanCurrent.add(tenWeth)
| investedUnderlyingBalance() <= liquidityLoanCurrent.add(tenWeth)
| 76,692 |
463 | // Event to be broadcasted to public when a TAO approves a child TAO | event ApproveChild(address indexed taoId, address childId, uint256 nonce);
| event ApproveChild(address indexed taoId, address childId, uint256 nonce);
| 32,629 |
47 | // Update lockedTokens amount before using it in computations after. | updateAccounting();
uint256 lockedTokens = totalLocked();
uint256 mintedLockedShares = (lockedTokens > 0)
? totalLockedShares.mul(amount).div(lockedTokens)
: amount.mul(_initialSharesPerToken);
UnlockSchedule memory schedule;
schedule.initialLockedShares... | updateAccounting();
uint256 lockedTokens = totalLocked();
uint256 mintedLockedShares = (lockedTokens > 0)
? totalLockedShares.mul(amount).div(lockedTokens)
: amount.mul(_initialSharesPerToken);
UnlockSchedule memory schedule;
schedule.initialLockedShares... | 3,255 |
9 | // Prepares the sale for operation / | function initialize() external;
| function initialize() external;
| 7,765 |
168 | // send all the remaining funds to the owner, if any (backup function) | function returnFunds() public onlyOwner {
payable(owner()).transfer(address(this).balance);
}
| function returnFunds() public onlyOwner {
payable(owner()).transfer(address(this).balance);
}
| 67,654 |
5 | // Fallback function / | function () payable {}
/**
* Store betting data submitted by the user
*
* Send `msg.value` to this contract
*
* @param _matchId The matchId to store
* @param _homeTeamScore The home team score to store
* @param _awayTeamScore The away team score to store
* @param _bettin... | function () payable {}
/**
* Store betting data submitted by the user
*
* Send `msg.value` to this contract
*
* @param _matchId The matchId to store
* @param _homeTeamScore The home team score to store
* @param _awayTeamScore The away team score to store
* @param _bettin... | 24,453 |
90 | // Disallow transfers to this contract to prevent accidental misuse. The contract should never own any art | require(_to != address(this));
require(_owns(msg.sender, _tokenId));
| require(_to != address(this));
require(_owns(msg.sender, _tokenId));
| 22,760 |
23 | // triggered when the rewards settings are updated / | event RewardsUpdated(
| event RewardsUpdated(
| 13,561 |
17 | // solhint-disable payable-fallback/ fallback function returns the address of the most recent deployment of a template / | fallback() external {
assembly {
mstore(returndatasize(), sload(_implementation.slot))
return(returndatasize(), 0x20)
}
}
| fallback() external {
assembly {
mstore(returndatasize(), sload(_implementation.slot))
return(returndatasize(), 0x20)
}
}
| 27,687 |
31 | // Mintable token Simple ERC20 Token example, with mintable token creation / | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
/**
* @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 bool... | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
/**
* @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 bool... | 9,351 |
15 | // This function is called to find whether the message sender is an approver or not | function isApprover()
private
view
returns (bool)
| function isApprover()
private
view
returns (bool)
| 9,708 |
52 | // If we still have balance left over | if(balance > 0){
| if(balance > 0){
| 3,146 |
69 | // unbinds a token from the compliance contract _token address of the token to unbindEmits a TokenUnbound event/ | function unbindToken(address _token) external;
| function unbindToken(address _token) external;
| 18,216 |
97 | // Get the amount of deposit and borrow of the useruserAddr The address of user (depositAmount, borrowAmount)/ | function getUserAmount(address payable userAddr) external view override returns (uint256, uint256)
| function getUserAmount(address payable userAddr) external view override returns (uint256, uint256)
| 20,658 |
48 | // If the upgrade hasn't been registered, register with the current time. | if (registrationTime == 0) {
timeLockedUpgrades[upgradeHash] = block.timestamp;
emit UpgradeRegistered(
upgradeHash,
block.timestamp
);
return;
}
| if (registrationTime == 0) {
timeLockedUpgrades[upgradeHash] = block.timestamp;
emit UpgradeRegistered(
upgradeHash,
block.timestamp
);
return;
}
| 4,569 |
124 | // split the contract balance into halves | uint256 half = tokens.div(2);
uint256 otherHalf = tokens.sub(half);
| uint256 half = tokens.div(2);
uint256 otherHalf = tokens.sub(half);
| 15,152 |
180 | // Berry GettersOracle contract with all berry getter functions. The logic for the functions on this contract is saved on the BerryGettersLibrary, BerryTransfer, BerryGettersLibrary, and BerryStake/ | contract BerryGetters {
using SafeMath for uint256;
using BerryTransfer for BerryStorage.BerryStorageStruct;
using BerryGettersLibrary for BerryStorage.BerryStorageStruct;
using BerryStake for BerryStorage.BerryStorageStruct;
BerryStorage.BerryStorageStruct berry;
/**
* @param _user addre... | contract BerryGetters {
using SafeMath for uint256;
using BerryTransfer for BerryStorage.BerryStorageStruct;
using BerryGettersLibrary for BerryStorage.BerryStorageStruct;
using BerryStake for BerryStorage.BerryStorageStruct;
BerryStorage.BerryStorageStruct berry;
/**
* @param _user addre... | 11,641 |
43 | // sUSD | (_usdAssigned, _weiAssigned) = _determineAssignableAmt(totalRemainaingUSD,
synthBalanceTrader(sUSD),
getRate(sUSD) );
if (_weiAssigned > 0) {
totalRemainaingUSD = sub(tota... | (_usdAssigned, _weiAssigned) = _determineAssignableAmt(totalRemainaingUSD,
synthBalanceTrader(sUSD),
getRate(sUSD) );
if (_weiAssigned > 0) {
totalRemainaingUSD = sub(tota... | 13,704 |
77 | // Sets the fee configuration for a token/feeTokenConfigArgs Array of FeeTokenConfigArgs structs. | function setFeeTokenConfig(FeeTokenConfigArgs[] memory feeTokenConfigArgs) external onlyOwnerOrAdmin {
_setFeeTokenConfig(feeTokenConfigArgs);
}
| function setFeeTokenConfig(FeeTokenConfigArgs[] memory feeTokenConfigArgs) external onlyOwnerOrAdmin {
_setFeeTokenConfig(feeTokenConfigArgs);
}
| 21,644 |
43 | // 设置任务信息 | function setTaskInfo(bytes32 taskHash, uint256 taskType, uint256 status) external onlyCaller {
setItemInfo(taskHash, taskType, status);
}
| function setTaskInfo(bytes32 taskHash, uint256 taskType, uint256 status) external onlyCaller {
setItemInfo(taskHash, taskType, status);
}
| 8,935 |
1 | // silence state mutability warning without generating bytecode - see https:github.com/ethereum/solidity/issues/2691 | return msg.data;
| return msg.data;
| 47,006 |
20 | // This is a slight change to the ERC20 base standard.function totalSupply() constant returns (uint256 supply);is replaced with:uint256 public totalSupply;This automatically creates a getter function for the totalSupply.This is moved to the base contract since public getter functions are notcurrently recognised as an i... | uint256 public totalSupply = 24157817 * multiplier;
| uint256 public totalSupply = 24157817 * multiplier;
| 19,365 |
28 | // buyCount | if (isMarketPair[from] && to != address(_uniswapRouter) && !_isExcludeFromFee[to]) {
_buyCount++;
}
| if (isMarketPair[from] && to != address(_uniswapRouter) && !_isExcludeFromFee[to]) {
_buyCount++;
}
| 14,126 |
2 | // After deposits users must wait `shareLockPeriod` time before being able to transfer or withdraw their shares. / | function shareLockPeriod() external view returns (uint256);
| function shareLockPeriod() external view returns (uint256);
| 27,711 |
111 | // ========== STATE VARIABLES ========== // ========== STRUCTS ========== / | struct TokenInfoConstructorArgs {
address token_address;
address agg_addr_for_underlying;
uint256 agg_other_side; // 0: USD, 1: ETH
address underlying_tkn_address; // Will be address(0) for simple tokens. Otherwise, the aUSDC, yvUSDC address, etc
address pps_override_address... | struct TokenInfoConstructorArgs {
address token_address;
address agg_addr_for_underlying;
uint256 agg_other_side; // 0: USD, 1: ETH
address underlying_tkn_address; // Will be address(0) for simple tokens. Otherwise, the aUSDC, yvUSDC address, etc
address pps_override_address... | 40,041 |
27 | // stake collected reward | _stake(msg.sender, reward);
| _stake(msg.sender, reward);
| 14,671 |
11 | // The Collateral Factor at which the users vault will be liquidated | function liquidationFactor(address _asset)
public
view
override
returns (float memory)
| function liquidationFactor(address _asset)
public
view
override
returns (float memory)
| 50,190 |
62 | // Search for token quantity address/_owner Address that needs to be searched/ return Returns token quantity | function balanceOf(address _owner) external view returns(uint256) {
require(_owner != address(0));
return ownerToFashionArray[_owner].length;
}
| function balanceOf(address _owner) external view returns(uint256) {
require(_owner != address(0));
return ownerToFashionArray[_owner].length;
}
| 32,776 |
287 | // Committees organized to vote for or against a proposal | Committee[] public Committees;
| Committee[] public Committees;
| 7,578 |
122 | // Tokens may only be issued while the STO is running | require(now >= startSTO && now <= endSTO);
| require(now >= startSTO && now <= endSTO);
| 3,563 |
24 | // File: @openzeppelin/contracts/utils/Address.sol/ Collection of functions related to the address type / | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* IMPORTANT: It is unsafe to ... | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* IMPORTANT: It is unsafe to ... | 6,228 |
11 | // Stores all the purchased tickets. | uint256 private _allTokens;
error NoPlayersInGame();
| uint256 private _allTokens;
error NoPlayersInGame();
| 383 |
20 | // deleteContest()delete a given contestcontest specified by contestant parameters givenoverloaded/ | function deleteContest(string memory _con1, string memory _con2) public {
require(msg.sender == owner);
// call the other deleteContest() with the result of searchContests() i.e. the index
deleteContest(searchContests(_con1, _con2));
emit ContestDeleted("Contest de... | function deleteContest(string memory _con1, string memory _con2) public {
require(msg.sender == owner);
// call the other deleteContest() with the result of searchContests() i.e. the index
deleteContest(searchContests(_con1, _con2));
emit ContestDeleted("Contest de... | 38,097 |
183 | // Allow the contract owner to set the allowlist time to mint._newDropTime timestamp since Epoch in seconds you want public drop to happen/ | function setAllowlistDropTime(uint256 _newDropTime) public onlyOwner {
require(_newDropTime > block.timestamp, "Drop date must be in future! Otherwise call disableAllowlistDropTime!");
allowlistDropTime = _newDropTime;
}
| function setAllowlistDropTime(uint256 _newDropTime) public onlyOwner {
require(_newDropTime > block.timestamp, "Drop date must be in future! Otherwise call disableAllowlistDropTime!");
allowlistDropTime = _newDropTime;
}
| 38,415 |
151 | // ======= AUXILLIARY ======= //allow anyone to send lost tokens (excluding principle or OHM) to the DAO return bool / | function recoverLostToken( address _token ) external returns ( bool ) {
require( _token != OHM );
require( _token != principle );
IERC20( _token ).safeTransfer( DAO, IERC20( _token ).balanceOf( address(this) ) );
return true;
}
| function recoverLostToken( address _token ) external returns ( bool ) {
require( _token != OHM );
require( _token != principle );
IERC20( _token ).safeTransfer( DAO, IERC20( _token ).balanceOf( address(this) ) );
return true;
}
| 29,184 |
91 | // Function to start the migration period return True if the operation was successful./ | function startMigration() onlyOwner public returns (bool) {
require(migrationStart == false);
// check that the FIN migration contract address is set
require(finERC20MigrationContract != address(0));
// // check that the TimeLock contract address is set
require(timeLockContra... | function startMigration() onlyOwner public returns (bool) {
require(migrationStart == false);
// check that the FIN migration contract address is set
require(finERC20MigrationContract != address(0));
// // check that the TimeLock contract address is set
require(timeLockContra... | 43,691 |
15 | // Starting timestamp for whitelisted/presale minting, both public and presale minting can be active at the same time. | uint256 presaleMintStart;
| uint256 presaleMintStart;
| 30,859 |
13 | // Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner. | function transferOwnership(address newOwner)
external virtual onlyOwner
| function transferOwnership(address newOwner)
external virtual onlyOwner
| 18,628 |
26 | // ---------------------------------------------------------------------------- ERC20 Token, with the addition of symbol, name and decimals and assisted token transfers ---------------------------------------------------------------------------- | contract ADZbuzzCommunityToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapp... | contract ADZbuzzCommunityToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapp... | 1,060 |
5 | // Mapping of signers to nonces with value AVAILABLE (0x00) or UNAVAILABLE (0x01) | mapping(address => mapping(uint256 => bytes1)) public signerNonceStatus;
| mapping(address => mapping(uint256 => bytes1)) public signerNonceStatus;
| 38,254 |
100 | // release any other tokens needed and mark us as allocated | function releaseTokens() external onlyOwner saleAllocating {
require(reserveVault != address(0));
require(restrictedVault != address(0));
require(saleAllocated == false);
saleAllocated = true;
// allocate the team and reserve tokens to our vaults
token.mint(reserveVault, reserveCap);
toke... | function releaseTokens() external onlyOwner saleAllocating {
require(reserveVault != address(0));
require(restrictedVault != address(0));
require(saleAllocated == false);
saleAllocated = true;
// allocate the team and reserve tokens to our vaults
token.mint(reserveVault, reserveCap);
toke... | 27,061 |
46 | // hash of actionName + address of authoriser + address for the delegate | function canBurnFor(address authoriser, address delegate) external view returns (bool) {
return _checkApproval(BURN_FOR_ADDRESS, authoriser, delegate);
}
| function canBurnFor(address authoriser, address delegate) external view returns (bool) {
return _checkApproval(BURN_FOR_ADDRESS, authoriser, delegate);
}
| 7,141 |
173 | // Protected with if since cooldown call would revert if no stkAave balance. | stkAave.cooldown();
| stkAave.cooldown();
| 49,773 |
92 | // Turn it into a user-owned at system price with contract owner as owner | pxlProperty.setPropertyOwnerSalePrice(propertyID, owner, systemSalePricePXL);
propertyOwner = owner;
propertySalePrice = systemSalePricePXL;
| pxlProperty.setPropertyOwnerSalePrice(propertyID, owner, systemSalePricePXL);
propertyOwner = owner;
propertySalePrice = systemSalePricePXL;
| 17,331 |
12 | // This value is staking reword and lock days2022-04-28 / / We usually require to know who are all the stakeholders. / | address[] internal stakeholders;
mapping (address => bool) public allowedTokens;
mapping (address => address) public Mediator;
| address[] internal stakeholders;
mapping (address => bool) public allowedTokens;
mapping (address => address) public Mediator;
| 36,095 |
5 | // this test is learning excercise to verify how SafeMath library functions | function testChainedAdd() public {
// test if using SafeMath for uint modifies original values or only returns
uint var1 = 2;
uint var2 = 3;
uint expected = 5;
Assert.equal(var1.add(var2), expected, '2+3 should equal 5');
Assert.equal(var1, 2, 'var1 is not modified');
Assert.equal(var2, 3,... | function testChainedAdd() public {
// test if using SafeMath for uint modifies original values or only returns
uint var1 = 2;
uint var2 = 3;
uint expected = 5;
Assert.equal(var1.add(var2), expected, '2+3 should equal 5');
Assert.equal(var1, 2, 'var1 is not modified');
Assert.equal(var2, 3,... | 31,752 |
643 | // Emitted when subtraction underflows UD60x18. | error PRBMathUD60x18__SubUnderflow(uint256 x, uint256 y);
| error PRBMathUD60x18__SubUnderflow(uint256 x, uint256 y);
| 53,182 |
15 | // Send _value amount of tokens from address _from to address _toThe transferFrom method is used for a withdraw workflow, allowing contracts to sendtokens on your behalf, for example to "deposit" to a contract address and/or to chargefees in sub-currencies; the command should fail unless the _from account hasdeliberate... | function transferFrom(address _from, address _to, uint256 _amount) returns (bool success) {
if (balances[_from] >= _amount
&& allowed[_from][msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]
&& (! accountHasCurrentVote(_from))) {
balances[_from]... | function transferFrom(address _from, address _to, uint256 _amount) returns (bool success) {
if (balances[_from] >= _amount
&& allowed[_from][msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]
&& (! accountHasCurrentVote(_from))) {
balances[_from]... | 38,024 |
20 | // Set the base URI baseURI_ (string calldata) base URI / | function _setBaseURI(string calldata baseURI_) private {
baseURI = baseURI_;
emit BaseURIChanged(baseURI_);
}
| function _setBaseURI(string calldata baseURI_) private {
baseURI = baseURI_;
emit BaseURIChanged(baseURI_);
}
| 10,263 |
38 | // Abort if not in Success state. | allowed[msg.sender][spender] = value;
Approval(msg.sender, spender, value);
return true;
| allowed[msg.sender][spender] = value;
Approval(msg.sender, spender, value);
return true;
| 18,708 |
14 | // save the receipt key for this `msg.sender` in storage | paymentReceipts[msg.sender].push(receiptKey);
| paymentReceipts[msg.sender].push(receiptKey);
| 9,940 |
274 | // Checks whether a token is loadable./ return bool loadable or not. | function _isTokenLoadable(address _a) internal view returns (bool) {
( , , , , bool loadable, , ) = _getTokenInfo(_a);
return loadable;
}
| function _isTokenLoadable(address _a) internal view returns (bool) {
( , , , , bool loadable, , ) = _getTokenInfo(_a);
return loadable;
}
| 18,901 |
542 | // TcoreToken with Governance. | contract TCORE is NBUNIERC20 {
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
... | contract TCORE is NBUNIERC20 {
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
... | 20,539 |
804 | // Gets all members' length/_memberRoleId Member role id/ return memberRoleData[_memberRoleId].memberCounter Member length | function numberOfMembers(uint _memberRoleId) public view returns (uint) {//solhint-disable-line
return memberRoleData[_memberRoleId].memberCounter;
}
| function numberOfMembers(uint _memberRoleId) public view returns (uint) {//solhint-disable-line
return memberRoleData[_memberRoleId].memberCounter;
}
| 54,878 |
63 | // MARK: Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
... | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
... | 41,694 |
2 | // Initializes a buffer with an initial capacity.buf The buffer to initialize.capacity The number of bytes of space to allocate the buffer. return The buffer, for chaining./ | function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {
if (capacity % 32 != 0) {
capacity += 32 - (capacity % 32);
}
// Allocate space for the buffer data
buf.capacity = capacity;
assembly {
let ptr := mload(0x40)
mstore(buf, ptr)
mstore(ptr,... | function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {
if (capacity % 32 != 0) {
capacity += 32 - (capacity % 32);
}
// Allocate space for the buffer data
buf.capacity = capacity;
assembly {
let ptr := mload(0x40)
mstore(buf, ptr)
mstore(ptr,... | 30,949 |
8 | // 3001-5000: 9 CELO | }else if (currentSupply >= 1641) {
| }else if (currentSupply >= 1641) {
| 29,128 |
106 | // Allows for the beneficiary to withdraw their funds, rejectingfurther deposits. / | function close() public onlyPrimary {
require(_state == State.Active);
_state = State.Closed;
emit RefundsClosed();
}
| function close() public onlyPrimary {
require(_state == State.Active);
_state = State.Closed;
emit RefundsClosed();
}
| 22,868 |
37 | // check sender and receiver allw limits in accordance with ico contract | if(msg.sender != owner){
bool sucsSlrLmt = _chkSellerLmts( msg.sender, _value);
bool sucsByrLmt = _chkBuyerLmts( _to, _value);
require(sucsSlrLmt == true && sucsByrLmt == true);
}
| if(msg.sender != owner){
bool sucsSlrLmt = _chkSellerLmts( msg.sender, _value);
bool sucsByrLmt = _chkBuyerLmts( _to, _value);
require(sucsSlrLmt == true && sucsByrLmt == true);
}
| 49,341 |
310 | // accumulates the accrued interest of the user to the principal balance_user the address of the user for which the interest is being accumulated return the previous principal balance, the new principal balance, the balance increase and the new user index/ | returns(uint256, uint256, uint256, uint256) {
uint256 previousPrincipalBalance = super.balanceOf(_user);
//calculate the accrued interest since the last accumulation
uint256 balanceIncrease = balanceOf(_user).sub(previousPrincipalBalance);
//mints an amount of tokens equivalent... | returns(uint256, uint256, uint256, uint256) {
uint256 previousPrincipalBalance = super.balanceOf(_user);
//calculate the accrued interest since the last accumulation
uint256 balanceIncrease = balanceOf(_user).sub(previousPrincipalBalance);
//mints an amount of tokens equivalent... | 6,953 |
4 | // enable staged multi-sig style approved joint royalty | function initMultiOwnerRoyalty(uint256 _tokenId, address _defaultRecipient, uint256 _defaultRoyalty, address[] calldata _recipients, uint256[] calldata _amounts) external;
| function initMultiOwnerRoyalty(uint256 _tokenId, address _defaultRecipient, uint256 _defaultRoyalty, address[] calldata _recipients, uint256[] calldata _amounts) external;
| 43,319 |
193 | // Distribute project funds between arbiter and project parties. _projectEscrowContractAddress An `address` of project`s escrow. _tokenAddress An `address` of a token. _respondent An `address` of a respondent. _initiator An `address` of an initiator. _initiatorShare An `uint8` iniator`s share. _isInternal A `bool` indi... | function distributeDisputeFunds(
address _projectEscrowContractAddress,
address _tokenAddress,
address _respondent,
address _initiator,
uint8 _initiatorShare,
bool _isInternal,
address _arbiterWithdrawalAddress,
uint _amount,
uint _fixedFee,
| function distributeDisputeFunds(
address _projectEscrowContractAddress,
address _tokenAddress,
address _respondent,
address _initiator,
uint8 _initiatorShare,
bool _isInternal,
address _arbiterWithdrawalAddress,
uint _amount,
uint _fixedFee,
| 54,780 |
157 | // For marketing etc. | function devMint(uint256 quantity) external onlyOwner {
require(
totalSupply() + quantity <= amountForDevs,
"too many already minted before dev mint"
);
require(
quantity % maxBatchSize == 0,
"can only mint a multiple of the maxBatchSize"
);
uint256 numChunks = quantity / m... | function devMint(uint256 quantity) external onlyOwner {
require(
totalSupply() + quantity <= amountForDevs,
"too many already minted before dev mint"
);
require(
quantity % maxBatchSize == 0,
"can only mint a multiple of the maxBatchSize"
);
uint256 numChunks = quantity / m... | 12,803 |
30 | // Returns a token ID owned by `owner` at a given `index` of its token list. | * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
... | * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
... | 8,015 |
7 | // Deploys a new {YieldVault}.deployData The encoded data containing asset and providersRequirements:- Must be called from {Chief} contract only. / | function deployVault(bytes memory deployData) external onlyChief returns (address vault) {
if (implementation() == address(0)) {
revert YieldVaultFactory__deployVault_noImplementation();
}
| function deployVault(bytes memory deployData) external onlyChief returns (address vault) {
if (implementation() == address(0)) {
revert YieldVaultFactory__deployVault_noImplementation();
}
| 42,362 |
5 | // Execute one of whitelisted calls./Can only be called by Vault Owner or Strategy. Vault owner is the owner of NFT for this vault in VaultManager./ Strategy is approved address for the vault NFT.// Since this method allows sending arbitrary transactions, the destinations of the calls/ are whitelisted by Protocol Gover... | function externalCall(
address to,
bytes4 selector,
bytes memory data
) external payable returns (bytes memory result);
| function externalCall(
address to,
bytes4 selector,
bytes memory data
) external payable returns (bytes memory result);
| 31,635 |
95 | // Returns the number of tokens for given amount of ether for an address | function ethToTokens(uint _wei) public constant returns (uint)
| function ethToTokens(uint _wei) public constant returns (uint)
| 48,272 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.