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
|
|---|---|---|---|---|
27
|
// The mint price
|
uint256 public constant MINT_PRICE = 0.01 ether;
|
uint256 public constant MINT_PRICE = 0.01 ether;
| 59,892
|
5
|
// Ensure current collateral amount differs from the new collateral amount.
|
if (newCollateralAmountD18 == currentCollateralAmount) revert InvalidCollateralAmount();
|
if (newCollateralAmountD18 == currentCollateralAmount) revert InvalidCollateralAmount();
| 25,588
|
6
|
// Creamos el evento para notificar a los demas que el autor decidio cerrar el fondeotemporalmente
|
event changeState(
address editor,
bool change);
|
event changeState(
address editor,
bool change);
| 1,649
|
8
|
// during construction, the "nonce" field hold the salt. if we assert it is zero, then we allow only a single wallet per owner.
|
if (userOp.initCode.length == 0) {
_validateAndUpdateNonce(userOp);
}
|
if (userOp.initCode.length == 0) {
_validateAndUpdateNonce(userOp);
}
| 27,184
|
7
|
// address addressForLoanAssetExchangeB = uniswapFactoryB.getExchange(RESERVE_ADDRESS); Instantiate Exchange A
|
exchangeAforLoanAsset = IUniswapExchange(addressForLoanAssetExchangeA);
|
exchangeAforLoanAsset = IUniswapExchange(addressForLoanAssetExchangeA);
| 30,136
|
39
|
// Check maxAmount raised
|
if (raised >= maxAmount || sclToken.totalSupply() >= maxSupply) {
stage = Stages.Ended;
}
|
if (raised >= maxAmount || sclToken.totalSupply() >= maxSupply) {
stage = Stages.Ended;
}
| 35,706
|
24
|
// max contribution in wei
|
uint256 public privateIcoMax = 350 ether;
uint256 public preIcoMax = 10000 ether;
uint256 public ico1Max = 10000 ether;
uint256 public ico2Max = 10000 ether;
uint256 public ico3Max = 10000 ether;
uint256 public ico4Max = 10000 ether;
|
uint256 public privateIcoMax = 350 ether;
uint256 public preIcoMax = 10000 ether;
uint256 public ico1Max = 10000 ether;
uint256 public ico2Max = 10000 ether;
uint256 public ico3Max = 10000 ether;
uint256 public ico4Max = 10000 ether;
| 4,751
|
206
|
// Internal function to clear current approval of a given token ID_tokenId uint256 ID of the token to be transferred/
|
function _clearApproval(address _owner, uint256 _tokenId) private {
require(ownerOf(_tokenId) == _owner);
tokenApprovals[_tokenId] = 0;
Approval(_owner, 0, _tokenId);
}
|
function _clearApproval(address _owner, uint256 _tokenId) private {
require(ownerOf(_tokenId) == _owner);
tokenApprovals[_tokenId] = 0;
Approval(_owner, 0, _tokenId);
}
| 65,859
|
48
|
// used to notify a gauge/bribe of a given reward, this can create griefing attacks by extending rewards
|
function notifyRewardAmount(address token, uint amount) external lock {
require(amount > 0);
if (rewardRate[token] == 0) _writeRewardPerTokenCheckpoint(token, 0, block.timestamp);
(rewardPerTokenStored[token], lastUpdateTime[token]) = _updateRewardPerToken(token);
if (block.timestamp >= periodFinish[token]) {
_safeTransferFrom(token, msg.sender, address(this), amount);
rewardRate[token] = amount / DURATION;
} else {
uint _remaining = periodFinish[token] - block.timestamp;
uint _left = _remaining * rewardRate[token];
require(amount > _left);
_safeTransferFrom(token, msg.sender, address(this), amount);
rewardRate[token] = (amount + _left) / DURATION;
}
require(rewardRate[token] > 0);
uint balance = erc20(token).balanceOf(address(this));
require(rewardRate[token] <= balance / DURATION, "Provided reward too high");
periodFinish[token] = block.timestamp + DURATION;
if (!isReward[token]) {
isReward[token] = true;
rewards.push(token);
}
emit NotifyReward(msg.sender, token, amount);
}
|
function notifyRewardAmount(address token, uint amount) external lock {
require(amount > 0);
if (rewardRate[token] == 0) _writeRewardPerTokenCheckpoint(token, 0, block.timestamp);
(rewardPerTokenStored[token], lastUpdateTime[token]) = _updateRewardPerToken(token);
if (block.timestamp >= periodFinish[token]) {
_safeTransferFrom(token, msg.sender, address(this), amount);
rewardRate[token] = amount / DURATION;
} else {
uint _remaining = periodFinish[token] - block.timestamp;
uint _left = _remaining * rewardRate[token];
require(amount > _left);
_safeTransferFrom(token, msg.sender, address(this), amount);
rewardRate[token] = (amount + _left) / DURATION;
}
require(rewardRate[token] > 0);
uint balance = erc20(token).balanceOf(address(this));
require(rewardRate[token] <= balance / DURATION, "Provided reward too high");
periodFinish[token] = block.timestamp + DURATION;
if (!isReward[token]) {
isReward[token] = true;
rewards.push(token);
}
emit NotifyReward(msg.sender, token, amount);
}
| 33,178
|
1
|
// all token send to owner when create
|
_totalSupply = _maxSupply;
_balances[owner()] = _totalSupply;
emit Transfer(address(0), owner(), _totalSupply);
|
_totalSupply = _maxSupply;
_balances[owner()] = _totalSupply;
emit Transfer(address(0), owner(), _totalSupply);
| 29,799
|
29
|
// _initial Bool indicating if the window is an initial dispute window or a standard dispute windowreturn The current dispute window if it exists /
|
function getCurrentDisputeWindow(bool _initial) public view returns (IDisputeWindow) {
return getDisputeWindowByTimestamp(augur.getTimestamp(), _initial);
}
|
function getCurrentDisputeWindow(bool _initial) public view returns (IDisputeWindow) {
return getDisputeWindowByTimestamp(augur.getTimestamp(), _initial);
}
| 36,662
|
3
|
// Returned when a function is called in the wrong contract state. /
|
error WrongState(uint256 currentState, uint256 requiredState);
|
error WrongState(uint256 currentState, uint256 requiredState);
| 14,867
|
205
|
// one byte prefix
|
require(item.len == 33);
uint result;
uint memPtr = item.memPtr + 1;
assembly {
result := mload(memPtr)
}
|
require(item.len == 33);
uint result;
uint memPtr = item.memPtr + 1;
assembly {
result := mload(memPtr)
}
| 39,655
|
56
|
// Checks if the account should be allowed to repay a borrow in the given market cToken The market to verify the repay against payer The account which would repay the asset borrower The account which would borrowed the asset repayAmount The amount of the underlying asset the account would repayreturn 0 if the repay is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol) /
|
function repayBorrowAllowed(
address cToken,
address payer,
address borrower,
|
function repayBorrowAllowed(
address cToken,
address payer,
address borrower,
| 25,272
|
32
|
// Get the balance of multiple account/token pairs _owners The addresses of the token holders _idsID of the TokensreturnThe _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) /
|
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);
|
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);
| 22,485
|
292
|
// do one lookup of the rate & time to minimize gas
|
RateAndUpdatedTime memory rateEntry = _getRateAndUpdatedTime(currencyKeys[i]);
rates[i] = rateEntry.rate;
if (!anyRateInvalid && currencyKeys[i] != sUSD) {
anyRateInvalid = flagList[i] || _rateIsStaleWithTime(_rateStalePeriod, rateEntry.time);
}
|
RateAndUpdatedTime memory rateEntry = _getRateAndUpdatedTime(currencyKeys[i]);
rates[i] = rateEntry.rate;
if (!anyRateInvalid && currencyKeys[i] != sUSD) {
anyRateInvalid = flagList[i] || _rateIsStaleWithTime(_rateStalePeriod, rateEntry.time);
}
| 34,167
|
7
|
// UTILITY FUNCTIONS// Get operating status of contract return A bool that is the current operating status /
|
function isOperational() external view returns (bool) {
return operational;
}
|
function isOperational() external view returns (bool) {
return operational;
}
| 16,930
|
7
|
// submited by -xu https:github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.solSafeMath: overflow/underflow checksMath operations with safety checks that throw on error
|
library SafeMath {
// @notice Multiplies two numbers, throws on overflow.
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
// @notice Integer division of two numbers, truncating the quotient.
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
// @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
// @notice Adds two numbers, throws on overflow.
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
// @notice Returns fractional amount
function getFractionalAmount(uint256 _amount, uint256 _percentage)
internal
pure
returns (uint256) {
return div(mul(_amount, _percentage), 100);
}
}
|
library SafeMath {
// @notice Multiplies two numbers, throws on overflow.
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
// @notice Integer division of two numbers, truncating the quotient.
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
// @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
// @notice Adds two numbers, throws on overflow.
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
// @notice Returns fractional amount
function getFractionalAmount(uint256 _amount, uint256 _percentage)
internal
pure
returns (uint256) {
return div(mul(_amount, _percentage), 100);
}
}
| 6,309
|
68
|
// / ERC721Metadata//A descriptive name for a collection of NFTs in this contract
|
function name() external view returns (string _name){
return _ERC721name;
}
|
function name() external view returns (string _name){
return _ERC721name;
}
| 5,486
|
133
|
// Increase the _amount of tokens that an owner has allowed to a _spender.This method should be used instead of approve() to avoid the double approval vulnerabilitydescribed above. _spender The address which will spend the funds. _addedValue The _amount of tokens to increase the allowance by. /
|
function increaseAllowance(address _spender, uint256 _addedValue)
public
returns (bool)
|
function increaseAllowance(address _spender, uint256 _addedValue)
public
returns (bool)
| 25,461
|
39
|
// Returns whether operator restriction can be set in the given execution context.
|
function _canSetOperatorRestriction() internal virtual returns (bool) {
return hasRole(DEFAULT_ADMIN_ROLE, _msgSender());
}
|
function _canSetOperatorRestriction() internal virtual returns (bool) {
return hasRole(DEFAULT_ADMIN_ROLE, _msgSender());
}
| 3,818
|
139
|
// Check if _iToken is listed /
|
function _checkiTokenListed(address _iToken) private view {
require(iTokens.contains(_iToken), "Token has not been listed");
}
|
function _checkiTokenListed(address _iToken) private view {
require(iTokens.contains(_iToken), "Token has not been listed");
}
| 57,799
|
42
|
// DATA TYPES // 猫咪的主要结构体,加密猫里的每个猫都要用这个结构体表示。务必确保这个结构体使用 2 个 256 位的字数。/ 由于以太坊自己包装跪着,这个结构体中顺序很重要(改动就不满足 2 个 256 要求了)
|
struct Kitty {
// 猫咪的基因是 256 位,格式是 sooper-sekret 不知道这是什么格式??
uint256 genes;
// 出生的时间戳
uint64 birthTime;
// 这只猫可以再次进行繁育活动的最小时间戳 公猫和母猫都用这个时间戳 冷却时间?!
uint64 cooldownEndBlock;
// 下面 ID 用于记录猫咪的父母,对于第 0 代猫咪,设置为 0
// 采用 32 位数字,最大仅有 4 亿多点,目前够用了 截止目前 2021-09-26 有 200 万个猫咪了
uint32 matronId;
uint32 sireId;
// 母猫怀孕的话,设置为公猫的 id,否则是 0。非 0 表明猫咪怀孕了。
// 当新的猫出生时需要基因物质。
uint32 siringWithId;
// 当前猫咪的冷却时间,是冷却时间数组的序号。第 0 代猫咪开始为 0,其他的猫咪是代数除以 2,每次成功繁育后都要自增 1
uint16 cooldownIndex;
// 代数 直接由合约创建出来的是第 0 代,其他出生的猫咪由父母最大代数加 1
uint16 generation;
}
|
struct Kitty {
// 猫咪的基因是 256 位,格式是 sooper-sekret 不知道这是什么格式??
uint256 genes;
// 出生的时间戳
uint64 birthTime;
// 这只猫可以再次进行繁育活动的最小时间戳 公猫和母猫都用这个时间戳 冷却时间?!
uint64 cooldownEndBlock;
// 下面 ID 用于记录猫咪的父母,对于第 0 代猫咪,设置为 0
// 采用 32 位数字,最大仅有 4 亿多点,目前够用了 截止目前 2021-09-26 有 200 万个猫咪了
uint32 matronId;
uint32 sireId;
// 母猫怀孕的话,设置为公猫的 id,否则是 0。非 0 表明猫咪怀孕了。
// 当新的猫出生时需要基因物质。
uint32 siringWithId;
// 当前猫咪的冷却时间,是冷却时间数组的序号。第 0 代猫咪开始为 0,其他的猫咪是代数除以 2,每次成功繁育后都要自增 1
uint16 cooldownIndex;
// 代数 直接由合约创建出来的是第 0 代,其他出生的猫咪由父母最大代数加 1
uint16 generation;
}
| 43,986
|
109
|
// Get the bounds for a draft batch based on the active balances of the guardians_termId Term ID of the active balances that will be used to compute the boundaries_selectedGuardians Number of guardians already selected for the draft_batchRequestedGuardians Number of guardians to be selected in the given batch of the draft_roundRequestedGuardians Total number of guardians requested to be drafted return low Low bound to be used for the sortition to draft the requested number of guardians for the given batch return high High bound to be used for the sortition to draft the requested number of guardians for the given batch/
|
function getSearchBatchBounds(
HexSumTree.Tree storage tree,
uint64 _termId,
uint256 _selectedGuardians,
uint256 _batchRequestedGuardians,
uint256 _roundRequestedGuardians
)
internal
view
returns (uint256 low, uint256 high)
|
function getSearchBatchBounds(
HexSumTree.Tree storage tree,
uint64 _termId,
uint256 _selectedGuardians,
uint256 _batchRequestedGuardians,
uint256 _roundRequestedGuardians
)
internal
view
returns (uint256 low, uint256 high)
| 19,395
|
38
|
// gas saving
|
team_accumuluated_eth=team_accumuluated_eth.sub(amount);
reward_in_pool_eth=reward_in_pool_eth.sub(amount);
uint half = amount.div(2);
team_address.transfer(amount.sub(half));
team_address2.transfer(half);
emit ClaimTeamFeeEth(amount);
|
team_accumuluated_eth=team_accumuluated_eth.sub(amount);
reward_in_pool_eth=reward_in_pool_eth.sub(amount);
uint half = amount.div(2);
team_address.transfer(amount.sub(half));
team_address2.transfer(half);
emit ClaimTeamFeeEth(amount);
| 56,223
|
30
|
// assignment of successors /
|
function setSuccessors(
Successors calldata _newSuccessors
)
external
correctStatus(
DeathConfirmationState.StillAlive,
msg.sender,
"first confirm that you are still alive"
)
|
function setSuccessors(
Successors calldata _newSuccessors
)
external
correctStatus(
DeathConfirmationState.StillAlive,
msg.sender,
"first confirm that you are still alive"
)
| 6,059
|
246
|
// send token to buyer (assumes approval has been made, if not then this will fail)
|
koda.safeTransferFrom(creator, _buyer, tokenId);
|
koda.safeTransferFrom(creator, _buyer, tokenId);
| 18,137
|
47
|
// Set correct size of returned array solium-disable-next-line security/no-inline-assembly
|
assembly {
mstore(array, moduleCount)
}
|
assembly {
mstore(array, moduleCount)
}
| 6,661
|
125
|
// - ERC20 functionality - //Transfer tokens to a specified address.to The address to transfer to.value The amount to be transferred. return True on success, false otherwise./
|
function transfer(address to, uint256 value)
external
validRecipient(to)
rebaseAtTheEnd
returns (bool)
|
function transfer(address to, uint256 value)
external
validRecipient(to)
rebaseAtTheEnd
returns (bool)
| 39,819
|
44
|
// The number of votes required in order for a voter to become a proposer.
|
function proposalThreshold() public view returns (uint96) {
uint96 totalVotingPower =
staking.getPriorTotalVotingPower(
safe32(
block.number - 1,
"GovernorAlpha::proposalThreshold: block number overflow"
),
block.timestamp
);
// 1% of current total voting power.
return totalVotingPower / 100;
}
|
function proposalThreshold() public view returns (uint96) {
uint96 totalVotingPower =
staking.getPriorTotalVotingPower(
safe32(
block.number - 1,
"GovernorAlpha::proposalThreshold: block number overflow"
),
block.timestamp
);
// 1% of current total voting power.
return totalVotingPower / 100;
}
| 34,222
|
26
|
// Add to index.
|
doc.index = uint16(documentsIndex.push(_id).sub(1));
|
doc.index = uint16(documentsIndex.push(_id).sub(1));
| 11,372
|
145
|
// Overrides ERC1155MintBurn to change the batch birth events to creator transfers, and to set _supply
|
function _batchMint(
address _to,
uint256[] memory _ids,
uint256[] memory _amounts,
bytes memory _data
|
function _batchMint(
address _to,
uint256[] memory _ids,
uint256[] memory _amounts,
bytes memory _data
| 10,629
|
14
|
// Mint a new Item receiver account address to receive the new item /
|
function _awardItem(address receiver) private returns (uint256) {
_tokenIds.increment();
uint256 newId = _tokenIds.current();
_safeMint(receiver, newId);
return newId;
}
|
function _awardItem(address receiver) private returns (uint256) {
_tokenIds.increment();
uint256 newId = _tokenIds.current();
_safeMint(receiver, newId);
return newId;
}
| 1,118
|
69
|
// Transfer tokens from the caller toPayee's address value Transfer amountreturn True if successful /
|
function transfer(address to, uint256 value)
external
override
whenNotPaused
notBlacklisted(msg.sender)
notBlacklisted(to)
returns (bool)
|
function transfer(address to, uint256 value)
external
override
whenNotPaused
notBlacklisted(msg.sender)
notBlacklisted(to)
returns (bool)
| 3,194
|
11
|
// -- Admin --
|
function modifyParameters(
bytes32 parameter,
uint256 val
|
function modifyParameters(
bytes32 parameter,
uint256 val
| 17,629
|
85
|
// call returns 0 on error.
|
case 0 { revert(0, returndatasize) }
|
case 0 { revert(0, returndatasize) }
| 37,012
|
200
|
// Emergency functions
|
function execute(address _target, bytes memory _data)
public
payable
returns (bytes memory response)
|
function execute(address _target, bytes memory _data)
public
payable
returns (bytes memory response)
| 2,674
|
30
|
// check prefix present
|
uint expectedPrefixLength = (bytes(nameDataPrefix)).length;
if (_data.length < expectedPrefixLength) {
throw;
}
|
uint expectedPrefixLength = (bytes(nameDataPrefix)).length;
if (_data.length < expectedPrefixLength) {
throw;
}
| 42,343
|
74
|
// Handles the receipt of an NFT The ERC721 smart contract calls this function on the recipient after a `transfer`. This function MAY throw to revert and reject the transfer. Return of other than the magic value MUST result in the transaction being reverted. Note: the contract address is always the message sender._operator The address which called `safeTransferFrom` function _from The address which previously owned the token _tokenIdThe NFT identifier which is being transferred _data Additional data with no specified formatreturn`bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` unless a reversion occurs. /
|
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
|
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
| 819
|
15
|
// new bid
|
bids[version][index] = Bid(col, row, msg.value, msg.sender);
emit EtheriaBidCreated(version, index, msg.value, msg.sender);
|
bids[version][index] = Bid(col, row, msg.value, msg.sender);
emit EtheriaBidCreated(version, index, msg.value, msg.sender);
| 55,338
|
8
|
// Save current values for inclusion in log
|
address oldImplementation = controllerImplementation;
address oldPendingImplementation = pendingControllerImplementation;
controllerImplementation = pendingControllerImplementation;
pendingControllerImplementation = address(0);
emit NewImplementation(oldImplementation, controllerImplementation);
emit NewPendingImplementation(oldPendingImplementation, pendingControllerImplementation);
|
address oldImplementation = controllerImplementation;
address oldPendingImplementation = pendingControllerImplementation;
controllerImplementation = pendingControllerImplementation;
pendingControllerImplementation = address(0);
emit NewImplementation(oldImplementation, controllerImplementation);
emit NewPendingImplementation(oldPendingImplementation, pendingControllerImplementation);
| 34,456
|
151
|
// Linear interpolation: start + (end - start)(step/duration) For 150 steps, duration = 149, start / end can be in any formatas long as <= 1049. start The starting value end The ending value step Number of blocks into interpolation duration Total range /
|
function lerp(
uint256 start,
uint256 end,
uint256 step,
uint256 duration
|
function lerp(
uint256 start,
uint256 end,
uint256 step,
uint256 duration
| 13,517
|
0
|
// Soul Pass Mapping
|
mapping (uint256 => bool) public soulPassClaimed;
address soulPass;
constructor(
address SoulPassContract
|
mapping (uint256 => bool) public soulPassClaimed;
address soulPass;
constructor(
address SoulPassContract
| 81,905
|
68
|
// !!! can be called by any user or contract >>> since we are making a withdrawal to our own contract/address only there is no possible attack using re-entrancy vulnerability/
|
function withdrawAllToWithdrawalAddress() external returns (bool success) {
// http://solidity.readthedocs.io/en/develop/security-considerations.html#sending-and-receiving-ether
// about <address>.send(uint256 amount) and <address>.transfer(uint256 amount)
// see: http://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=transfer#address-related
// https://ethereum.stackexchange.com/questions/19341/address-send-vs-address-transfer-best-practice-usage
uint sum = address(this).balance;
if (!withdrawalAddress.send(sum)) {// makes withdrawal and returns true (success) or false
emit Withdrawal(withdrawalAddress, sum, msg.sender, false);
return false;
}
emit Withdrawal(withdrawalAddress, sum, msg.sender, true);
return true;
}
|
function withdrawAllToWithdrawalAddress() external returns (bool success) {
// http://solidity.readthedocs.io/en/develop/security-considerations.html#sending-and-receiving-ether
// about <address>.send(uint256 amount) and <address>.transfer(uint256 amount)
// see: http://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=transfer#address-related
// https://ethereum.stackexchange.com/questions/19341/address-send-vs-address-transfer-best-practice-usage
uint sum = address(this).balance;
if (!withdrawalAddress.send(sum)) {// makes withdrawal and returns true (success) or false
emit Withdrawal(withdrawalAddress, sum, msg.sender, false);
return false;
}
emit Withdrawal(withdrawalAddress, sum, msg.sender, true);
return true;
}
| 26,845
|
50
|
// Returns the addition of two unsigned integers, reverting onoverflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow. /
|
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
|
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| 448
|
29
|
// Transfer the total prize to the user
|
safeTransfer(payable(msg.sender), totalPrize);
emit PrizeClaimed(msg.sender, totalPrize);
|
safeTransfer(payable(msg.sender), totalPrize);
emit PrizeClaimed(msg.sender, totalPrize);
| 29,828
|
22
|
// This function evaluates if a role is allowed to dismiss another role.dismissalRoles bitset encoding the indexes of the role that is trying to dismiss,nomineeRole index of the role to dismiss, return true if @dismissalRoles can dismiss @nomineeRole according to the binding policy, otherwise false./
|
function checkDismissesCandidates(uint dismissalRoles, uint8 nomineeRole) public pure returns(bool) {
uint nomineeRoleMask = uint(1) << nomineeRole;
uint dismissalsMask = 0;
if (nomineeRoleMask & 4 == 4) // CarrierCandidate
dismissalsMask = 16; // dismissed by CarrierCandidate
return dismissalsMask & dismissalRoles != 0;
}
|
function checkDismissesCandidates(uint dismissalRoles, uint8 nomineeRole) public pure returns(bool) {
uint nomineeRoleMask = uint(1) << nomineeRole;
uint dismissalsMask = 0;
if (nomineeRoleMask & 4 == 4) // CarrierCandidate
dismissalsMask = 16; // dismissed by CarrierCandidate
return dismissalsMask & dismissalRoles != 0;
}
| 18,994
|
99
|
// In this case we're transferring underlying tokens, we want to convert the internal asset transfer amount to store in cash balances
|
assetTransferAmountInternal = assetToken.convertToInternal(assetTransferAmountExternal);
|
assetTransferAmountInternal = assetToken.convertToInternal(assetTransferAmountExternal);
| 64,850
|
21
|
// Multiplies two unsigned integers, reverts on overflow. /
|
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, 'SafeMath mul error');
return c;
}
|
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, 'SafeMath mul error');
return c;
}
| 24,017
|
141
|
// deposit on behalf of `user`, must be called on fresh deposit only user deposit user amount amount to deposit /
|
function depositFor(address user, uint256 amount)
external
override
nonReentrant
onlyRole(DEPOSIT_ROLE)
returns (bool)
|
function depositFor(address user, uint256 amount)
external
override
nonReentrant
onlyRole(DEPOSIT_ROLE)
returns (bool)
| 52,812
|
60
|
// check approve
|
require(IERC20Upgradeable(_tokenAddr).allowance(msg.sender, address(this)) >= _amount, "JAave: allowance failed buying tranche A");
SafeERC20Upgradeable.safeTransferFrom(IERC20Upgradeable(_tokenAddr), msg.sender, address(this), _amount);
|
require(IERC20Upgradeable(_tokenAddr).allowance(msg.sender, address(this)) >= _amount, "JAave: allowance failed buying tranche A");
SafeERC20Upgradeable.safeTransferFrom(IERC20Upgradeable(_tokenAddr), msg.sender, address(this), _amount);
| 31,700
|
50
|
// add liquidity
|
swapAndLiquify(liquidityPoolTokens);
|
swapAndLiquify(liquidityPoolTokens);
| 29,697
|
2
|
// Returns a DID of the supplychainfinance Returns a unique DID (Decentralized Identifier) for the supplychainfinance.return string representing the DID of the supplychainfinance /
|
function DID() public view returns (string memory) {
return string(abi.encodePacked('did:demo:supplychainfinance:', _Case_ID));
}
|
function DID() public view returns (string memory) {
return string(abi.encodePacked('did:demo:supplychainfinance:', _Case_ID));
}
| 21,252
|
18
|
// geting price with 6 decimals
|
return uint256((uint256(answer) * tokensforadolar)/10**8);
|
return uint256((uint256(answer) * tokensforadolar)/10**8);
| 53,570
|
13
|
// DATATYPES /
|
struct Person {
string name;
}
|
struct Person {
string name;
}
| 3,420
|
264
|
// Reward limit
|
function setRewardLimit(
string memory _githubRepository,
uint256 _rewardLimit
|
function setRewardLimit(
string memory _githubRepository,
uint256 _rewardLimit
| 16,940
|
35
|
// require(amount >= minTransfer && balanceEnough(amount));
|
require(amount >= minTransfer);
transferBalance(this, to, amount);
Transfer(this, to, amount);
|
require(amount >= minTransfer);
transferBalance(this, to, amount);
Transfer(this, to, amount);
| 39,646
|
15
|
// Verify that minting is open.
|
require(getTokenMintStartTime(id) <= block.timestamp && getTokenMintStartTime(id) != 0, "minting has not started");
require(getTokenMintEndTime(id) >= block.timestamp, "minting has ended");
|
require(getTokenMintStartTime(id) <= block.timestamp && getTokenMintStartTime(id) != 0, "minting has not started");
require(getTokenMintEndTime(id) >= block.timestamp, "minting has ended");
| 37,249
|
7
|
// Functions laying out certain behavior to protect from bots
|
function setMaxBuyAmount(uint256 maxBuyAmount) external onlyOwner {
_maxBuyAmount = maxBuyAmount;
}
|
function setMaxBuyAmount(uint256 maxBuyAmount) external onlyOwner {
_maxBuyAmount = maxBuyAmount;
}
| 3,751
|
50
|
// Public function to update an ilk's pip and flip if the ilk has been updated.
|
function update(bytes32 ilk) external {
require(JoinLike(ilkData[ilk].join).vat() == address(vat), "IlkRegistry/invalid-ilk");
require(JoinLike(ilkData[ilk].join).live() == 1, "IlkRegistry/ilk-not-live-use-remove-instead");
(address _pip,) = spot.ilks(ilk);
require(_pip != address(0), "IlkRegistry/pip-invalid");
(address _flip,,) = cat.ilks(ilk);
require(_flip != address(0), "IlkRegistry/flip-invalid");
require(FlipLike(_flip).cat() == address(cat), "IlkRegistry/flip-wrong-cat");
require(FlipLike(_flip).vat() == address(vat), "IlkRegistry/flip-wrong-vat");
ilkData[ilk].pip = _pip;
ilkData[ilk].flip = _flip;
emit UpdateIlk(ilk);
}
|
function update(bytes32 ilk) external {
require(JoinLike(ilkData[ilk].join).vat() == address(vat), "IlkRegistry/invalid-ilk");
require(JoinLike(ilkData[ilk].join).live() == 1, "IlkRegistry/ilk-not-live-use-remove-instead");
(address _pip,) = spot.ilks(ilk);
require(_pip != address(0), "IlkRegistry/pip-invalid");
(address _flip,,) = cat.ilks(ilk);
require(_flip != address(0), "IlkRegistry/flip-invalid");
require(FlipLike(_flip).cat() == address(cat), "IlkRegistry/flip-wrong-cat");
require(FlipLike(_flip).vat() == address(vat), "IlkRegistry/flip-wrong-vat");
ilkData[ilk].pip = _pip;
ilkData[ilk].flip = _flip;
emit UpdateIlk(ilk);
}
| 31,322
|
5
|
// input ptr
|
let dataPtr := data
let endPtr := add(dataPtr, mload(data))
|
let dataPtr := data
let endPtr := add(dataPtr, mload(data))
| 29,682
|
4
|
// interact with the contract at the specified address that has the price feed information view function ensures that state will not modify.
|
function getVersion() public view returns(uint256) {
AggregatorV3Interface priceFeed = AggregatorV3Interface(0x8A753747A1Fa494EC906cE90E9f37563A8AF630e);
return priceFeed.version();
}
|
function getVersion() public view returns(uint256) {
AggregatorV3Interface priceFeed = AggregatorV3Interface(0x8A753747A1Fa494EC906cE90E9f37563A8AF630e);
return priceFeed.version();
}
| 34,404
|
131
|
// Deauthorized `_contract` by contract id _cid The contract id /
|
function deauthorizeContractById(uint256 _cid)
public
onlyOwner
authorizedContractIdValid(_cid)
|
function deauthorizeContractById(uint256 _cid)
public
onlyOwner
authorizedContractIdValid(_cid)
| 35,238
|
52
|
// Approve Dai tokens as collateral
|
dai.approve(cDaiAddress, totalAmount);
|
dai.approve(cDaiAddress, totalAmount);
| 36,280
|
37
|
// Contracts that should be able to recover tokens SylTi This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.This will prevent any accidental loss of tokens. /
|
contract CanReclaimToken is Ownable {
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.transfer(owner, balance);
}
}
|
contract CanReclaimToken is Ownable {
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.transfer(owner, balance);
}
}
| 27,855
|
433
|
// Decodes and returns a 22 bits signed integer shifted by an offset from a 256 bit word. /
|
function decodeInt22(bytes32 word, uint256 offset) internal pure returns (int256) {
int256 value = int256(uint256(word >> offset) & _MASK_22);
// In case the decoded value is greater than the max positive integer that can be represented with 22 bits,
// we know it was originally a negative integer. Therefore, we mask it to restore the sign in the 256 bit
// representation.
return value > _MAX_INT_22 ? (value | int256(~_MASK_22)) : value;
}
|
function decodeInt22(bytes32 word, uint256 offset) internal pure returns (int256) {
int256 value = int256(uint256(word >> offset) & _MASK_22);
// In case the decoded value is greater than the max positive integer that can be represented with 22 bits,
// we know it was originally a negative integer. Therefore, we mask it to restore the sign in the 256 bit
// representation.
return value > _MAX_INT_22 ? (value | int256(~_MASK_22)) : value;
}
| 13,522
|
447
|
// Create empty record to begin executor IDs at 1
|
executorsNextIndex = 1;
|
executorsNextIndex = 1;
| 47,191
|
170
|
// Enable or disable approval for a third party ("operator") to manage all of owner's assets - on behalfExecutes setApprovalForAll(_operator, _approved) on behalf of the owner who EIP-712 signed the transaction, i.e. as if transaction sender is the EIP712 signerSets the `_operator` as the token operator for `_owner` tokens, given `_owner` EIP-712 signed approvalEmits `ApprovalForAll` event in the same way as `setApprovalForAll` doesRequires:- `_operator` to be non-zero address- `_exp` to be a timestamp in the future- `v`, `r` and `s` to be a valid `secp256k1` signature from `_owner` over the EIP712-formatted function arguments.- the signature to use `_owner` current nonce (see
|
function permitForAll(address _owner, address _operator, bool _approved, uint256 _exp, uint8 v, bytes32 r, bytes32 s) public {
// verify permits are enabled
require(isFeatureEnabled(FEATURE_OPERATOR_PERMITS), "operator permits are disabled");
// derive signer of the EIP712 PermitForAll message, and
// update the nonce for that particular signer to avoid replay attack!!! --------------------->>> ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
address signer = __deriveSigner(abi.encode(PERMIT_FOR_ALL_TYPEHASH, _owner, _operator, _approved, permitNonces[_owner]++, _exp), v, r, s);
// perform message integrity and security validations
require(signer == _owner, "invalid signature");
require(block.timestamp < _exp, "signature expired");
// delegate call to `__approve` - execute the logic required
__approveForAll(_owner, _operator, _approved);
}
|
function permitForAll(address _owner, address _operator, bool _approved, uint256 _exp, uint8 v, bytes32 r, bytes32 s) public {
// verify permits are enabled
require(isFeatureEnabled(FEATURE_OPERATOR_PERMITS), "operator permits are disabled");
// derive signer of the EIP712 PermitForAll message, and
// update the nonce for that particular signer to avoid replay attack!!! --------------------->>> ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
address signer = __deriveSigner(abi.encode(PERMIT_FOR_ALL_TYPEHASH, _owner, _operator, _approved, permitNonces[_owner]++, _exp), v, r, s);
// perform message integrity and security validations
require(signer == _owner, "invalid signature");
require(block.timestamp < _exp, "signature expired");
// delegate call to `__approve` - execute the logic required
__approveForAll(_owner, _operator, _approved);
}
| 50,420
|
9
|
// See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address.- the caller must have a balance of at least `amount`. /
|
function transfer(address recipient, uint256 amount) public virtual override returns (bool);
|
function transfer(address recipient, uint256 amount) public virtual override returns (bool);
| 3,649
|
62
|
// Burns a specific amount of tokens._value The amount of token to be burned./
|
function burn(uint256 _value) internal {
_burn(msg.sender, _value);
}
|
function burn(uint256 _value) internal {
_burn(msg.sender, _value);
}
| 21,781
|
13
|
// Withdraw
|
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyOwner {
_setDefaultRoyalty(receiver, feeNumerator);
}
|
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyOwner {
_setDefaultRoyalty(receiver, feeNumerator);
}
| 16,905
|
0
|
// Standar ERC Token Interface
|
contract ERC20Interface {
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function approve(address spender, uint tokens) public returns (bool success);
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function transfer(address to, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens);
}
|
contract ERC20Interface {
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function approve(address spender, uint tokens) public returns (bool success);
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function transfer(address to, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens);
}
| 24,675
|
275
|
// _updateLockedBond stores the new `amount` into the BOND locked history
|
function _updateLockedBond(uint256 amount) internal {
LibBarnStorage.Storage storage ds = LibBarnStorage.barnStorage();
if (ds.bondStakedHistory.length == 0 || ds.bondStakedHistory[ds.bondStakedHistory.length - 1].timestamp < block.timestamp) {
ds.bondStakedHistory.push(LibBarnStorage.Checkpoint(block.timestamp, amount));
} else {
LibBarnStorage.Checkpoint storage old = ds.bondStakedHistory[ds.bondStakedHistory.length - 1];
old.amount = amount;
}
}
|
function _updateLockedBond(uint256 amount) internal {
LibBarnStorage.Storage storage ds = LibBarnStorage.barnStorage();
if (ds.bondStakedHistory.length == 0 || ds.bondStakedHistory[ds.bondStakedHistory.length - 1].timestamp < block.timestamp) {
ds.bondStakedHistory.push(LibBarnStorage.Checkpoint(block.timestamp, amount));
} else {
LibBarnStorage.Checkpoint storage old = ds.bondStakedHistory[ds.bondStakedHistory.length - 1];
old.amount = amount;
}
}
| 78,295
|
107
|
// call the staking smart contract to init the epoch
|
epochs[epochId] = _getPoolSize(epochId);
|
epochs[epochId] = _getPoolSize(epochId);
| 48,178
|
4
|
// Modifier which checks if respondent is already completed survey or not. /
|
modifier onlyValidRespondent() {
require((!isRespondentExists[msg.sender] && (surveyor != msg.sender)), "Sender not authorized.");
_;
}
|
modifier onlyValidRespondent() {
require((!isRespondentExists[msg.sender] && (surveyor != msg.sender)), "Sender not authorized.");
_;
}
| 16,507
|
3
|
// Send given amount of Eth to dest from sender.This is a convenience function, which is equivalent to calling sendTxToL1 with empty calldataForL1. destination recipient address on L1return unique identifier for this L2-to-L1 transaction. /
|
function withdrawEth(address destination)
external
payable
returns (uint256);
|
function withdrawEth(address destination)
external
payable
returns (uint256);
| 39,318
|
10
|
// Used during the upgrade process to verify valid Tellor Contracts /
|
function verify() external pure returns (uint256) {
return 9999;
}
|
function verify() external pure returns (uint256) {
return 9999;
}
| 63,263
|
26
|
// Swap tokens for ETH and pay amount of ETH as tip, using permit for approval router Uniswap V2-compliant Router contract trade Trade details permit Permit details /
|
function swapExactTokensForETHWithPermitAndTipAmount(
IUniRouter router,
Trade calldata trade,
Permit calldata permit
|
function swapExactTokensForETHWithPermitAndTipAmount(
IUniRouter router,
Trade calldata trade,
Permit calldata permit
| 7,874
|
1
|
// Get no. of token holders. /
|
function getNumTokenHolders() external view returns (uint256);
|
function getNumTokenHolders() external view returns (uint256);
| 5,021
|
322
|
// maxDeleverage is how much we want to increase by
|
function _normalLeverage(
uint256 maxLeverage,
uint256 lent,
uint256 borrowed,
uint256 collatRatio
|
function _normalLeverage(
uint256 maxLeverage,
uint256 lent,
uint256 borrowed,
uint256 collatRatio
| 29,600
|
9
|
// `editInfo` Allows owner to change hotel's dataUri._dataUri New dataUri pointer of this hotel /
|
function editInfo(string _dataUri) onlyFromIndex public {
_editInfoImpl(_dataUri);
}
|
function editInfo(string _dataUri) onlyFromIndex public {
_editInfoImpl(_dataUri);
}
| 40,991
|
276
|
// NftBox contract Extends ERC721 Non-Fungible Token Standard basic implementation /
|
contract NftBox is ERC721, Ownable {
using SafeMath for uint256;
uint256 public apePrice; //80000000000000000 = 0.08 ETH
uint public maxApePurchase;
uint256 public MAX_APES;
bool public saleIsActive = true;
address[] private minters;
constructor (string memory name, string memory symbol, uint256 maxNftSupply,uint256 apePrices,uint maxApePurchases,string memory baseURI) ERC721(name, symbol) payable {
apePrice = apePrices;
maxApePurchase = maxApePurchases;
MAX_APES = maxNftSupply;
_setBaseURI(baseURI);
}
/**
* judge address if a minter
*/
function isMinter(address inputAddress) public view returns(bool) {
if(minters.length == 0){
return false;
}
for(uint i = 0; i < minters.length; i++){
if(minters[i] == inputAddress){
return true;
}
}
return false;
}
/**
* Add a minter
*/
function addMinter(address minter) public onlyOwner {
require(!isMinter(minter),"address already is a minter");
minters.push(minter);
}
/**
* Remove a minter
*/
function removeMinter(address minter) public onlyOwner {
require(isMinter(minter),"address is not a minter");
_removeMinter(minter);
}
function _removeMinter(address minter) internal {
require(minters.length>0,"minters is empty,no address can be remove");
address[] storage newMinters;
for(uint i=0; i<minters.length; i++){
if(minters[i] != minter){
newMinters.push(minters[i]);
}
}
minters = newMinters;
}
function withdraw() public onlyOwner {
uint balance = address(this).balance;
msg.sender.transfer(balance);
}
function setBaseURI(string memory baseURI) public onlyOwner {
_setBaseURI(baseURI);
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
saleIsActive = !saleIsActive;
}
/**
* Mints nftBox
*/
function mint(uint numberOfTokens) public onlyOwner payable {
require(saleIsActive, "Sale must be active to mint nft");
require(numberOfTokens <= maxApePurchase, "Can only mint 100 tokens at a time");
require(totalSupply().add(numberOfTokens) <= MAX_APES, "Purchase would exceed max supply of Apes");
require(apePrice.mul(numberOfTokens) <= msg.value, "BNB value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_APES) {
_safeMint(msg.sender, mintIndex);
}
}
}
/**
* Open box(minter mint a nft)
*/
function openBox() public payable {
require(saleIsActive, "Sale must be active to mint nft");
require(totalSupply().add(1) <= MAX_APES, "Purchase would exceed max supply of nft");
require(apePrice.mul(1) <= msg.value, "BNB value sent is not correct");
require(isMinter(msg.sender),"you are not a minter");
uint mintIndex = totalSupply();
_safeMint(msg.sender, mintIndex);
_removeMinter(msg.sender);
}
/**
* mint one nft with appoint tokenId
*/
function mintOne(uint tokenId) public onlyOwner payable {
require(saleIsActive, "Sale must be active to mint nft");
require(totalSupply().add(1) <= MAX_APES, "Purchase would exceed max supply of nft");
require(apePrice.mul(1) <= msg.value, "BNB value sent is not correct");
require(tokenId==totalSupply(),"tokenId must be equals current totalSupply");
_safeMint(msg.sender, tokenId);
}
}
|
contract NftBox is ERC721, Ownable {
using SafeMath for uint256;
uint256 public apePrice; //80000000000000000 = 0.08 ETH
uint public maxApePurchase;
uint256 public MAX_APES;
bool public saleIsActive = true;
address[] private minters;
constructor (string memory name, string memory symbol, uint256 maxNftSupply,uint256 apePrices,uint maxApePurchases,string memory baseURI) ERC721(name, symbol) payable {
apePrice = apePrices;
maxApePurchase = maxApePurchases;
MAX_APES = maxNftSupply;
_setBaseURI(baseURI);
}
/**
* judge address if a minter
*/
function isMinter(address inputAddress) public view returns(bool) {
if(minters.length == 0){
return false;
}
for(uint i = 0; i < minters.length; i++){
if(minters[i] == inputAddress){
return true;
}
}
return false;
}
/**
* Add a minter
*/
function addMinter(address minter) public onlyOwner {
require(!isMinter(minter),"address already is a minter");
minters.push(minter);
}
/**
* Remove a minter
*/
function removeMinter(address minter) public onlyOwner {
require(isMinter(minter),"address is not a minter");
_removeMinter(minter);
}
function _removeMinter(address minter) internal {
require(minters.length>0,"minters is empty,no address can be remove");
address[] storage newMinters;
for(uint i=0; i<minters.length; i++){
if(minters[i] != minter){
newMinters.push(minters[i]);
}
}
minters = newMinters;
}
function withdraw() public onlyOwner {
uint balance = address(this).balance;
msg.sender.transfer(balance);
}
function setBaseURI(string memory baseURI) public onlyOwner {
_setBaseURI(baseURI);
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
saleIsActive = !saleIsActive;
}
/**
* Mints nftBox
*/
function mint(uint numberOfTokens) public onlyOwner payable {
require(saleIsActive, "Sale must be active to mint nft");
require(numberOfTokens <= maxApePurchase, "Can only mint 100 tokens at a time");
require(totalSupply().add(numberOfTokens) <= MAX_APES, "Purchase would exceed max supply of Apes");
require(apePrice.mul(numberOfTokens) <= msg.value, "BNB value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_APES) {
_safeMint(msg.sender, mintIndex);
}
}
}
/**
* Open box(minter mint a nft)
*/
function openBox() public payable {
require(saleIsActive, "Sale must be active to mint nft");
require(totalSupply().add(1) <= MAX_APES, "Purchase would exceed max supply of nft");
require(apePrice.mul(1) <= msg.value, "BNB value sent is not correct");
require(isMinter(msg.sender),"you are not a minter");
uint mintIndex = totalSupply();
_safeMint(msg.sender, mintIndex);
_removeMinter(msg.sender);
}
/**
* mint one nft with appoint tokenId
*/
function mintOne(uint tokenId) public onlyOwner payable {
require(saleIsActive, "Sale must be active to mint nft");
require(totalSupply().add(1) <= MAX_APES, "Purchase would exceed max supply of nft");
require(apePrice.mul(1) <= msg.value, "BNB value sent is not correct");
require(tokenId==totalSupply(),"tokenId must be equals current totalSupply");
_safeMint(msg.sender, tokenId);
}
}
| 19,008
|
26
|
// Get the contract constant _decimals /
|
function decimals() constant returns (uint8 decimals) {
return _decimals;
}
|
function decimals() constant returns (uint8 decimals) {
return _decimals;
}
| 34,666
|
98
|
//
|
* @dev Implementation of the {IBEP20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {BEP20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-BEP20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of BEP20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IBEP20-approve}.
*/
contract BEP20 is Context, IBEP20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply = 1000000;
string private _name = "Floki";
string private _symbol = "Floki";
uint8 private _decimals = 18;
/**
* @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
* construction.
*/
constructor(string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
_decimals = 18;
}
/**
* @dev Returns the bep token owner.
*/
function getOwner() external override view returns (address) {
return owner();
}
/**
* @dev Returns the token name.
*/
function name() public override view returns (string memory) {
return _name;
}
/**
* @dev Returns the token decimals.
*/
function decimals() public override view returns (uint8) {
return _decimals;
}
/**
* @dev Returns the token symbol.
*/
function symbol() public override view returns (string memory) {
return _symbol;
}
/**
* @dev See {BEP20-totalSupply}.
*/
function totalSupply() public override view returns (uint256) {
return _totalSupply;
}
/**
* @dev See {BEP20-balanceOf}.
*/
function balanceOf(address account) public override view returns (uint256) {
return _balances[account];
}
/**
* @dev See {BEP20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {BEP20-allowance}.
*/
function allowance(address owner, address spender)
public
override
view
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* @dev See {BEP20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {BEP20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {BEP20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"BEP20: transfer amount exceeds allowance"
)
);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {BEP20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {BEP20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"BEP20: decreased allowance below zero"
)
);
return true;
}
/**
* @dev Creates `amount` tokens and assigns them to `msg.sender`, increasing
* the total supply.
*
* Requirements
*
* - `msg.sender` must be the token owner
*/
function mint(uint256 amount) public onlyOwner returns (bool) {
_mint(_msgSender(), amount);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(
amount,
"BEP20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "BEP20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
require(account != address(0), "BEP20: burn from the zero address");
_balances[account] = _balances[account].sub(
amount,
"BEP20: burn amount exceeds balance"
);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(
account,
_msgSender(),
_allowances[account][_msgSender()].sub(
amount,
"BEP20: burn amount exceeds allowance"
)
);
}
}
|
* @dev Implementation of the {IBEP20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {BEP20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-BEP20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of BEP20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IBEP20-approve}.
*/
contract BEP20 is Context, IBEP20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply = 1000000;
string private _name = "Floki";
string private _symbol = "Floki";
uint8 private _decimals = 18;
/**
* @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
* construction.
*/
constructor(string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
_decimals = 18;
}
/**
* @dev Returns the bep token owner.
*/
function getOwner() external override view returns (address) {
return owner();
}
/**
* @dev Returns the token name.
*/
function name() public override view returns (string memory) {
return _name;
}
/**
* @dev Returns the token decimals.
*/
function decimals() public override view returns (uint8) {
return _decimals;
}
/**
* @dev Returns the token symbol.
*/
function symbol() public override view returns (string memory) {
return _symbol;
}
/**
* @dev See {BEP20-totalSupply}.
*/
function totalSupply() public override view returns (uint256) {
return _totalSupply;
}
/**
* @dev See {BEP20-balanceOf}.
*/
function balanceOf(address account) public override view returns (uint256) {
return _balances[account];
}
/**
* @dev See {BEP20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {BEP20-allowance}.
*/
function allowance(address owner, address spender)
public
override
view
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* @dev See {BEP20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {BEP20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {BEP20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"BEP20: transfer amount exceeds allowance"
)
);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {BEP20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {BEP20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"BEP20: decreased allowance below zero"
)
);
return true;
}
/**
* @dev Creates `amount` tokens and assigns them to `msg.sender`, increasing
* the total supply.
*
* Requirements
*
* - `msg.sender` must be the token owner
*/
function mint(uint256 amount) public onlyOwner returns (bool) {
_mint(_msgSender(), amount);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(
amount,
"BEP20: transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "BEP20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
require(account != address(0), "BEP20: burn from the zero address");
_balances[account] = _balances[account].sub(
amount,
"BEP20: burn amount exceeds balance"
);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(
account,
_msgSender(),
_allowances[account][_msgSender()].sub(
amount,
"BEP20: burn amount exceeds allowance"
)
);
}
}
| 14,790
|
58
|
// calculate remaining elements in proof
|
remaining = _proof.length - j;
|
remaining = _proof.length - j;
| 45,178
|
92
|
// bad contributor of presale
|
mapping(address => bool) preSaleCancelledList;
|
mapping(address => bool) preSaleCancelledList;
| 49,782
|
2
|
// ZkBobPermit2Mixin /
|
abstract contract ZkBobPermit2Mixin is ZkBobPool {
IPermit2 public immutable permit2;
constructor(address _permit2) {
require(Address.isContract(_permit2), "ZkBobPool: not a contract");
permit2 = IPermit2(_permit2);
}
// @inheritdoc ZkBobPool
function _transferFromByPermit(address _user, uint256 _nullifier, int256 _tokenAmount) internal override {
(uint8 v, bytes32 r, bytes32 s) = _permittable_deposit_signature();
bytes memory depositSignature = new bytes(65);
assembly {
mstore(add(depositSignature, 0x20), r)
mstore(add(depositSignature, 0x40), s)
mstore8(add(depositSignature, 0x60), v)
}
permit2.permitTransferFrom(
IPermit2.PermitTransferFrom({
permitted: IPermit2.TokenPermissions({token: token, amount: uint256(_tokenAmount) * TOKEN_DENOMINATOR}),
nonce: _nullifier,
deadline: uint256(_memo_permit_deadline())
}),
IPermit2.SignatureTransferDetails({
to: address(this),
requestedAmount: uint256(_tokenAmount) * TOKEN_DENOMINATOR
}),
_user,
depositSignature
);
}
}
|
abstract contract ZkBobPermit2Mixin is ZkBobPool {
IPermit2 public immutable permit2;
constructor(address _permit2) {
require(Address.isContract(_permit2), "ZkBobPool: not a contract");
permit2 = IPermit2(_permit2);
}
// @inheritdoc ZkBobPool
function _transferFromByPermit(address _user, uint256 _nullifier, int256 _tokenAmount) internal override {
(uint8 v, bytes32 r, bytes32 s) = _permittable_deposit_signature();
bytes memory depositSignature = new bytes(65);
assembly {
mstore(add(depositSignature, 0x20), r)
mstore(add(depositSignature, 0x40), s)
mstore8(add(depositSignature, 0x60), v)
}
permit2.permitTransferFrom(
IPermit2.PermitTransferFrom({
permitted: IPermit2.TokenPermissions({token: token, amount: uint256(_tokenAmount) * TOKEN_DENOMINATOR}),
nonce: _nullifier,
deadline: uint256(_memo_permit_deadline())
}),
IPermit2.SignatureTransferDetails({
to: address(this),
requestedAmount: uint256(_tokenAmount) * TOKEN_DENOMINATOR
}),
_user,
depositSignature
);
}
}
| 35,155
|
10
|
// decrease a user's productivity./Note the best practice will be restrict the callee to prove of productivity's contract address./ return true to confirm that the productivity removed success.
|
function decreaseProductivity(address user, uint value) external returns (uint);
|
function decreaseProductivity(address user, uint value) external returns (uint);
| 82,348
|
9
|
// ------------------------------------------------------------------------------------------ Number ranges------------------------------------------------------------------------------------------
|
function getCurrentPoNumber() override public view returns (uint poNumber)
|
function getCurrentPoNumber() override public view returns (uint poNumber)
| 6,603
|
48
|
// only team just can activate
|
require(
msg.sender == creator,
"only team just can activate"
);
|
require(
msg.sender == creator,
"only team just can activate"
);
| 38,518
|
41
|
// Internal function to clear current approval and transfer the ownership of a given land ID_from address which you want to send lands from_to address which you want to transfer the land to_landId uint256 ID of the land to be transferred/
|
function clearApprovalAndTransfer(address _from, address _to, uint256 _landId) internal {
require(owns(_from, _landId));
require(_to != address(0));
require(_to != ownerOf(_landId));
clearApproval(_from, _landId);
removeLand(_from, _landId);
addLand(_to, _landId);
emit Transfer(_from, _to, _landId);
}
|
function clearApprovalAndTransfer(address _from, address _to, uint256 _landId) internal {
require(owns(_from, _landId));
require(_to != address(0));
require(_to != ownerOf(_landId));
clearApproval(_from, _landId);
removeLand(_from, _landId);
addLand(_to, _landId);
emit Transfer(_from, _to, _landId);
}
| 20,824
|
18
|
// Add a listing to an existing board. /
|
function _addListingToBoard(
uint boardId,
uint strike,
uint skew
|
function _addListingToBoard(
uint boardId,
uint strike,
uint skew
| 16,747
|
8
|
// Owner can update token information here. It is often useful to conceal the actual token association, untilthe token operations, like central issuance or reissuance have been completed. This function allows the token owner to rename the token after the operationshave been completed and then point the audience to use the token contract. /
|
function setTokenInformation(string _name, string _symbol) public onlyOwner {
name = _name;
symbol = _symbol;
emit UpdatedTokenInformation(name, symbol);
}
|
function setTokenInformation(string _name, string _symbol) public onlyOwner {
name = _name;
symbol = _symbol;
emit UpdatedTokenInformation(name, symbol);
}
| 11,886
|
55
|
// List must contain the node
|
require(contains(self, _id), "node not in list");
if (self.size > 1) {
|
require(contains(self, _id), "node not in list");
if (self.size > 1) {
| 43,361
|
66
|
// Turn Power Off/ access control: only admin/ state machine: only when online/ state scope: only modify _status/ token transfer: none
|
function powerOff() external override onlyOwner {
require(_status == IPowerSwitch.State.Online, "PowerSwitch: cannot power off");
_status = IPowerSwitch.State.Offline;
emit PowerOff();
}
|
function powerOff() external override onlyOwner {
require(_status == IPowerSwitch.State.Online, "PowerSwitch: cannot power off");
_status = IPowerSwitch.State.Offline;
emit PowerOff();
}
| 24,676
|
171
|
// Update reward variables of the given pool to be up-to-date.
|
function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
|
function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
| 353
|
94
|
// ids_offset == 0xa0
|
eq(
calldataload(
add(
elementPtr,
ConduitBatch1155Transfer_ids_head_offset
)
),
ConduitBatch1155Transfer_ids_length_offset
),
|
eq(
calldataload(
add(
elementPtr,
ConduitBatch1155Transfer_ids_head_offset
)
),
ConduitBatch1155Transfer_ids_length_offset
),
| 20,520
|
17
|
// sets the collection manager and emits an event sets the collection manager and emits an event can only be called by the contract owner _collectionManager - address of the collection manager /
|
function setCollectionManager(address _collectionManager) external onlyOwner {
collectionManager = IRootCollection(_collectionManager);
emit RootCollectionUpdated(_collectionManager);
}
|
function setCollectionManager(address _collectionManager) external onlyOwner {
collectionManager = IRootCollection(_collectionManager);
emit RootCollectionUpdated(_collectionManager);
}
| 11,295
|
14
|
// Increases the total supply
|
_totalSupply = _totalSupply.add(amount);
|
_totalSupply = _totalSupply.add(amount);
| 22,486
|
53
|
// Sender's hint was not a valid insert position Use sender's hint to find a valid insert position
|
(prevId, nextId) = findInsertPosition(self, _key, prevId, nextId);
|
(prevId, nextId) = findInsertPosition(self, _key, prevId, nextId);
| 23,552
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.