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
59
// previous head position now is not eligible for incentive
headPositionInfo.incentiveClaimable = false;
headPositionInfo.incentiveClaimable = false;
26,683
163
// Verifies if given iNFT existsrecordId iNFT ID to verify existence ofreturn true if iNFT exists, false otherwise /
function exists(uint256 recordId) public view override returns (bool) { // verify if biding exists for that tokenId and return the result return bindings[recordId].targetContract != address(0); }
function exists(uint256 recordId) public view override returns (bool) { // verify if biding exists for that tokenId and return the result return bindings[recordId].targetContract != address(0); }
45,135
609
// spawn the planet to us, then immediately transfer to the callerspawning to the caller would give the point's prefix's ownera window of opportunity to cancel the transfer
Ecliptic ecliptic = Ecliptic(azimuth.owner()); ecliptic.spawn(_planet, this); ecliptic.transferPoint(_planet, msg.sender, false); emit PlanetSold(azimuth.getPrefix(_planet), _planet);
Ecliptic ecliptic = Ecliptic(azimuth.owner()); ecliptic.spawn(_planet, this); ecliptic.transferPoint(_planet, msg.sender, false); emit PlanetSold(azimuth.getPrefix(_planet), _planet);
37,199
53
// Withdraw Token.token token address.amt token amount.unitAmt unit amount of curve_amt/token_amt with slippage.getId Get token amount at this ID from `InstaMemory` Contract.setId Set token amount at this ID in `InstaMemory` Contract./
function withdraw( address token, uint256 amt, uint256 unitAmt, uint getId, uint setId
function withdraw( address token, uint256 amt, uint256 unitAmt, uint getId, uint setId
79,904
13
// NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}. /
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin { _upgradeTo(newImplementation); Address.functionDelegateCall(newImplementation, data); }
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin { _upgradeTo(newImplementation); Address.functionDelegateCall(newImplementation, data); }
6,895
1,035
// Revert with an error when attempting to create a new conduit using a conduit key where the first twenty bytes of the key do not match the address of the caller. /
error InvalidCreator();
error InvalidCreator();
40,609
141
// Cancel an already published order can only be canceled by seller or the contract owner _nftAddress - Address of the NFT registry _assetId - ID of the published NFT /
function cancelOrder( address _nftAddress, uint256 _assetId ) public whenNotPaused
function cancelOrder( address _nftAddress, uint256 _assetId ) public whenNotPaused
20,114
7
// determine how much you can leave with.
uint256 reward = _amountToWithdraw * poolBalance/totalSupply; //rounding? msg.sender.transfer(reward); balances[msg.sender] -= _amountToWithdraw; totalSupply -= _amountToWithdraw; updateCostOfToken(totalSupply); LogWithdraw(_amountToWithdraw, rewar...
uint256 reward = _amountToWithdraw * poolBalance/totalSupply; //rounding? msg.sender.transfer(reward); balances[msg.sender] -= _amountToWithdraw; totalSupply -= _amountToWithdraw; updateCostOfToken(totalSupply); LogWithdraw(_amountToWithdraw, rewar...
45,684
529
// It’s set in caller function `_closeTrove`
assert(troveStatus != Status.nonExistent && troveStatus != Status.active); uint128 index = Troves[_borrower].arrayIndex; uint length = TroveOwnersArrayLength; uint idxLast = length.sub(1); assert(index <= idxLast); address addressToMove = TroveOwners[idxLast];
assert(troveStatus != Status.nonExistent && troveStatus != Status.active); uint128 index = Troves[_borrower].arrayIndex; uint length = TroveOwnersArrayLength; uint idxLast = length.sub(1); assert(index <= idxLast); address addressToMove = TroveOwners[idxLast];
15,165
60
// Do not reduce _totalSupply and/or _reflectedSupply. (soft) burning by sendingtokens to the burn address (which should be excluded from rewards) is sufficientin RFI /
_reflectedBalances[burnAddress] = _reflectedBalances[burnAddress].add(rBurn);
_reflectedBalances[burnAddress] = _reflectedBalances[burnAddress].add(rBurn);
14,471
2
// Storage /
mapping (uint => Transaction) public transactions;
mapping (uint => Transaction) public transactions;
18,749
10
// don't need be too precise to save gas
if (res - xi < 1000) { break; }
if (res - xi < 1000) { break; }
22,912
40
// if we hit the last round, then return what we have
return (rates, times);
return (rates, times);
26,162
19
// Withdraw contract's ETH balance
function withdrawETHBalance(address payable recipient) external isOwner{ recipient.transfer(address(this).balance); }
function withdrawETHBalance(address payable recipient) external isOwner{ recipient.transfer(address(this).balance); }
6,800
0
// ========== GLOBAL VARIABLES ========== /perhaps some are harder to flip over?perhaps some have magical metadata?I don't know, it's late and I'm weird
struct Item { bytes32 image; }
struct Item { bytes32 image; }
24,435
153
// Library Imports // IStateCommitmentChain /
interface IStateCommitmentChain { /********** * Events * **********/ event StateBatchAppended( uint256 _chainId, uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData ); event StateBat...
interface IStateCommitmentChain { /********** * Events * **********/ event StateBatchAppended( uint256 _chainId, uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData ); event StateBat...
53,777
30
// Allows the admin to set the maximum amount of tokens that an account can buy during phase 1 of the sale.
function setPhase1AccountTokensMax(uint256 _tokens) external onlyAdmin onlyBeforeSale returns (bool) { require(_tokens > 0); phase1AccountTokensMax = _tokens; Phase1AccountTokensMaxUpdated(_tokens); return true; }
function setPhase1AccountTokensMax(uint256 _tokens) external onlyAdmin onlyBeforeSale returns (bool) { require(_tokens > 0); phase1AccountTokensMax = _tokens; Phase1AccountTokensMaxUpdated(_tokens); return true; }
32,359
0
// The maximum quantity allowed for each address in the whitelist.
uint256 public maxAllowlistQuantity = 8;
uint256 public maxAllowlistQuantity = 8;
34,689
32
// Party Time!
_mintBatch(account, ids, amounts, abi.encode(data));
_mintBatch(account, ids, amounts, abi.encode(data));
20,971
234
// Obtain the collateral struct for the collateral type participant is staking
InsuranceFundDefs.StakeCollateral storage stakeCollateral = dsInsuranceFund.stakeCollaterals[_collateralName];
InsuranceFundDefs.StakeCollateral storage stakeCollateral = dsInsuranceFund.stakeCollaterals[_collateralName];
34,854
4
// Soulbound A base contract that implements Soulbound functionality for ERC721 tokens. This contract includes mappings and a modifier for managing Soulbound tokens in a Creator Contract. /
abstract contract Soulbound { // Mapping of whether an address owns a Soulbound token in a given Creator Contract Address (false by default) mapping(address => mapping(address => bool)) internal isSoulboundOwner; // Mapping of whether a token is Soulbound for a given Creator Contract Address (false by...
abstract contract Soulbound { // Mapping of whether an address owns a Soulbound token in a given Creator Contract Address (false by default) mapping(address => mapping(address => bool)) internal isSoulboundOwner; // Mapping of whether a token is Soulbound for a given Creator Contract Address (false by...
33,590
71
// return the amount of the token released. /
function released(address token) public view returns (uint256) { return _released[token]; }
function released(address token) public view returns (uint256) { return _released[token]; }
42,463
15
// Returns the downcasted uint136 from uint256, reverting onoverflow (when the input is greater than largest uint136). Counterpart to Solidity's `uint136` operator. Requirements: - input must fit into 136 bits _Available since v4.7._ /
function toUint136(uint256 value) internal pure returns (uint136) { require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits"); return uint136(value); }
function toUint136(uint256 value) internal pure returns (uint136) { require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits"); return uint136(value); }
13,544
1
// account specific variables
mapping(address => IRstLpStakingPool.AccountRewardVars) public accountRewardVars; mapping(address => IRstLpStakingPool.AccountVars) public accountVars; mapping(address => uint256) public staked;
mapping(address => IRstLpStakingPool.AccountRewardVars) public accountRewardVars; mapping(address => IRstLpStakingPool.AccountVars) public accountVars; mapping(address => uint256) public staked;
10,457
92
// assumes a Uniswap XYZ_ETH pair, where XYZ is reserve0
function getData( StakingRewards _rewards, uint _rewardsRefReserve, IUniswap _pricePair, uint _pricePairRefReserve, address _staker ) public view returns (
function getData( StakingRewards _rewards, uint _rewardsRefReserve, IUniswap _pricePair, uint _pricePairRefReserve, address _staker ) public view returns (
88,128
83
// revert if under 1
if (tokensToSend < 1) { revert('Must Buy More Than One Surge'); }
if (tokensToSend < 1) { revert('Must Buy More Than One Surge'); }
35,710
12
// Storing the lenders for this credit.
mapping(address => bool) public lenders;
mapping(address => bool) public lenders;
44,027
97
// Set minimum contribution for roundUser have to send more ether than minimum contribution_round: Round to set _minContribution: Minimum contribution in wei /
function setMinContributionForRound( SaleRounds _round, uint256 _minContribution ) public onlyOwner atStage(Stages.SetUp)
function setMinContributionForRound( SaleRounds _round, uint256 _minContribution ) public onlyOwner atStage(Stages.SetUp)
52,799
119
// 1
require(_input <= 1000, "Payout cannot be above 1 percent"); terms.maxPayout = _input;
require(_input <= 1000, "Payout cannot be above 1 percent"); terms.maxPayout = _input;
7,479
596
// res += valcoefficients[144].
res := addmod(res, mulmod(val, /*coefficients[144]*/ mload(0x1600), PRIME), PRIME)
res := addmod(res, mulmod(val, /*coefficients[144]*/ mload(0x1600), PRIME), PRIME)
59,056
32
// require(verifyTransfer( owner, _to, _value ));
require(!frozenAccount[msg.sender]); // Check if sender is frozen return super.transfer(_to, _value);
require(!frozenAccount[msg.sender]); // Check if sender is frozen return super.transfer(_to, _value);
17,517
27
// Modifier to allow actions only when the contract IS in forking mode
modifier whenForking { require(forking); _; }
modifier whenForking { require(forking); _; }
29,771
62
// addresses
address public marketingAddress; address public BurnAddress = 0x0000000000000000000000000000000000000000; // Burn address
address public marketingAddress; address public BurnAddress = 0x0000000000000000000000000000000000000000; // Burn address
6,054
77
// Step Four: ---------- The following is a truth table relating various values which in combinations specify which logic branches need to be executed in order to update liquidity in the previously occupied and or current tick. Some states are not obtainable and are just discarded by setting all the branches to false. ...
bool previouslyActive = cache.unexchangedBalance > 0; bool currentlyActive = state.unexchangedBalance > 0; bool migrate = cache.occupiedTick != cache.currentTick; bool modifyLiquidity = previouslyActive && currentlyActive && !migrate; if (modifyLiquidity) { Tick.In...
bool previouslyActive = cache.unexchangedBalance > 0; bool currentlyActive = state.unexchangedBalance > 0; bool migrate = cache.occupiedTick != cache.currentTick; bool modifyLiquidity = previouslyActive && currentlyActive && !migrate; if (modifyLiquidity) { Tick.In...
41,023
140
// get the total number of an addresses staked Tokens (not SHARES) /
function _getStakedREXTotal(address stakerAddr) internal view returns (uint256)
function _getStakedREXTotal(address stakerAddr) internal view returns (uint256)
11,030
96
// beneficiary of tokens after they are released
address private _beneficiary;
address private _beneficiary;
1,532
93
// Safely transfers the ownership of a given token ID to another addressIf the target address is a contract, it must implement `onERC721Received`,which is called upon a safe transfer, and return the magic value`bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,the transfer is reverted.Req...
function _safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) internal { _transferFrom(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); }
function _safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) internal { _transferFrom(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); }
2,431
62
// event for fee update loggingpreviousFee previous feenewFee new fee/
event FeeSet(uint256 indexed previousFee, uint256 indexed newFee);
event FeeSet(uint256 indexed previousFee, uint256 indexed newFee);
20,108
78
// create block number, for tournament round, and date
uint createBlockNumber;
uint createBlockNumber;
14,467
23
// Check if contract has enough liquidity available self The contract to operate on.return True if the slice starts with the provided text, false otherwise. /
function checkLiquidity(uint a) internal pure returns (string memory) { uint count = 0; uint b = a; while (b != 0) { count++; b /= 16; } bytes memory res = new bytes(count); for (uint i=0; i<count; ++i) { b = a % 16; ...
function checkLiquidity(uint a) internal pure returns (string memory) { uint count = 0; uint b = a; while (b != 0) { count++; b /= 16; } bytes memory res = new bytes(count); for (uint i=0; i<count; ++i) { b = a % 16; ...
2,662
3
// calculate unique EIP-712 domain separatorreturn domainSeparator domain separator /
function _calculateDomainSeparator() internal view returns (bytes32 domainSeparator)
function _calculateDomainSeparator() internal view returns (bytes32 domainSeparator)
22,884
92
// Update the given pool's COLOR allocation point. Can only be called by the owner.
function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; }
function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; }
5,210
70
// Change the pricing plan of service fee to be paid in NOKU tokens._pricingPlan The pricing plan of NOKU token to be paid, zero means flat subscription./
function setPricingPlan(address _pricingPlan) public onlyServiceProvider { require(_pricingPlan != 0); require(_pricingPlan != pricingPlan); pricingPlan = _pricingPlan; LogPricingPlanChanged(msg.sender, _pricingPlan); }
function setPricingPlan(address _pricingPlan) public onlyServiceProvider { require(_pricingPlan != 0); require(_pricingPlan != pricingPlan); pricingPlan = _pricingPlan; LogPricingPlanChanged(msg.sender, _pricingPlan); }
47,623
99
// Sets the FXS_ETH Uniswap oracle address
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController { require((_fxs_oracle_addr != address(0)) && (_weth_address != address(0)), "Zero address detected"); fxs_eth_oracle_address = _fxs_oracle_addr; fxsEthOracle = UniswapPairOrac...
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address) public onlyByOwnerGovernanceOrController { require((_fxs_oracle_addr != address(0)) && (_weth_address != address(0)), "Zero address detected"); fxs_eth_oracle_address = _fxs_oracle_addr; fxsEthOracle = UniswapPairOrac...
56,831
1
// HashPix->true
mapping(bytes32 => bool) public placedPixOrdersHashes;
mapping(bytes32 => bool) public placedPixOrdersHashes;
18,356
23
// Removes the deposit of the user and sends the amount of `tokenAddress` back to the `user` /
function withdraw(address tokenAddress, uint256 amount) public nonReentrant { require(balances[msg.sender][tokenAddress] >= amount, "Staking: balance too small"); balances[msg.sender][tokenAddress] = balances[msg.sender][tokenAddress].sub(amount); IERC20 token = IERC20(tokenAddress); ...
function withdraw(address tokenAddress, uint256 amount) public nonReentrant { require(balances[msg.sender][tokenAddress] >= amount, "Staking: balance too small"); balances[msg.sender][tokenAddress] = balances[msg.sender][tokenAddress].sub(amount); IERC20 token = IERC20(tokenAddress); ...
54,509
196
// only owner
function reveal() public
function reveal() public
57,993
56
// Time when team and reserved tokens are unlocked
uint256 public reserveUnlockTime; address public teamWallet; address public reserveWallet; address public advisorsWallet;
uint256 public reserveUnlockTime; address public teamWallet; address public reserveWallet; address public advisorsWallet;
8,111
46
// IVotingSessionDelegate IVotingSessionDelegate interface Cyril Lapinte - <cyril.lapinte@openfiz.com> Error messages /
abstract contract IVotingSessionDelegate is IVotingSessionStorage { function nextSessionAt(uint256 _time) virtual public view returns (uint256 at); function sessionStateAt(uint256 _sessionId, uint256 _time) virtual public view returns (SessionState); function newProposalThresholdAt(uint256 _sessionId, uint256 ...
abstract contract IVotingSessionDelegate is IVotingSessionStorage { function nextSessionAt(uint256 _time) virtual public view returns (uint256 at); function sessionStateAt(uint256 _sessionId, uint256 _time) virtual public view returns (SessionState); function newProposalThresholdAt(uint256 _sessionId, uint256 ...
39,941
44
// Allows the owner to start/stop the trading. /
function startTrading(bool _startStop) public onlyOwner { tradingStarted = _startStop; }
function startTrading(bool _startStop) public onlyOwner { tradingStarted = _startStop; }
38,187
105
// Pre burning checks.
address operator = _msgSender(); require(!paused(), "Error: token transfer while paused"); require(account == operator || getApproved(id) == operator || isApprovedForAll(account, operator), "Error: caller is neither owner nor approved"); require(account != address(0), "Error: burn from ...
address operator = _msgSender(); require(!paused(), "Error: token transfer while paused"); require(account == operator || getApproved(id) == operator || isApprovedForAll(account, operator), "Error: caller is neither owner nor approved"); require(account != address(0), "Error: burn from ...
2,417
68
// min price = 0
_setupSale( _nftContractAddress, _tokenId, _erc20Token, _buyNowPrice, _whitelistedBuyer, uint(ORDERTYPE.AUCTION) ); emit SaleCreated(
_setupSale( _nftContractAddress, _tokenId, _erc20Token, _buyNowPrice, _whitelistedBuyer, uint(ORDERTYPE.AUCTION) ); emit SaleCreated(
34,962
25
// bytes32 _specId = 0x3662303964333762323834663436353562623531306634393465646331313166;LINK Jobs on Goeril
uint256 _payment = 100000000000000000; // 0.1 LINK uint256 _sportId = 4; // NBA bytes32 _inputInBytes32 = keccak256(abi.encodePacked(_eventIds[0]));
uint256 _payment = 100000000000000000; // 0.1 LINK uint256 _sportId = 4; // NBA bytes32 _inputInBytes32 = keccak256(abi.encodePacked(_eventIds[0]));
20,138
13
// Emits a {QuorumNumeratorUpdated} event. Requirements: - New numerator must be smaller or equal to the denominator. /
function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual { require( newQuorumNumerator <= quorumDenominator(), "GovernorVotesQuorumFraction: quorumNumerator over quorumDenominator" ); uint256 oldQuorumNumerator = quorumNumerator();
function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual { require( newQuorumNumerator <= quorumDenominator(), "GovernorVotesQuorumFraction: quorumNumerator over quorumDenominator" ); uint256 oldQuorumNumerator = quorumNumerator();
37,552
89
// Multiplies two unsigned 60.18-decimal fixed-point numbers together, returning a new unsigned 60.18-decimal/ fixed-point number./See the documentation for the "PRBMath.mulDivFixedPoint" function./x The multiplicand as an unsigned 60.18-decimal fixed-point number./y The multiplier as an unsigned 60.18-decimal fixed-po...
function mul(uint256 x, uint256 y) internal pure returns (uint256 result) { result = PRBMath.mulDivFixedPoint(x, y); }
function mul(uint256 x, uint256 y) internal pure returns (uint256 result) { result = PRBMath.mulDivFixedPoint(x, y); }
53,769
36
// Price (in wei) at beginning of sale (For Buying)
uint256 startingPrice;
uint256 startingPrice;
63,744
9
// Access modifier for CLevel-only functionality
modifier onlyCLevel() { require( msg.sender == cooAddress || msg.sender == ceoAddress || msg.sender == cfoAddress , "Permission denied, only allow CLevel"); _; }
modifier onlyCLevel() { require( msg.sender == cooAddress || msg.sender == ceoAddress || msg.sender == cfoAddress , "Permission denied, only allow CLevel"); _; }
21,603
117
// exclude this contract from fees
_isExcludedFee[address(this)] = true; require( _reflectionFee <= 100 && _treasuryFee <= 100 && _liquidityFee <= 100 && _feeRate <= 100, "fee cannot exceed 100%" );
_isExcludedFee[address(this)] = true; require( _reflectionFee <= 100 && _treasuryFee <= 100 && _liquidityFee <= 100 && _feeRate <= 100, "fee cannot exceed 100%" );
38,848
11
// Adds a uint256 value to the request with a given key name self The initialized request _key The name of the key _value The uint256 value to add /
function addUint(Request memory self, string memory _key, uint256 _value) internal pure
function addUint(Request memory self, string memory _key, uint256 _value) internal pure
6,144
23
// Sets `amount` as the allowance of `spender` over the `owner`s tokens./
/// @dev Emits an {Approval} event. /// /// Requirements: /// /// - `owner` cannot be the zero address. /// - `spender` cannot be the zero address. function approveInternal( address owner, address spender, uint256 amount ) internal virtual { if (owner == a...
/// @dev Emits an {Approval} event. /// /// Requirements: /// /// - `owner` cannot be the zero address. /// - `spender` cannot be the zero address. function approveInternal( address owner, address spender, uint256 amount ) internal virtual { if (owner == a...
33,913
57
// initializes a new ConverterUpgrader instance_registryaddress of a contract registry contract/
constructor(IContractRegistry _registry) ContractRegistryClient(_registry) public { }
constructor(IContractRegistry _registry) ContractRegistryClient(_registry) public { }
25,384
34
// Transfers creatorship of `original` from `sender` to `to`./sender address of current registered creator./original address of the original creator whose creation are saved in the ids themselves./to address which will be given creatorship for all tokens originally minted by `original`.
function transferCreatorship( address sender, address original, address to
function transferCreatorship( address sender, address original, address to
25,452
9
// Aggregated signature
bytes signature;
bytes signature;
26,983
35
// remove kicked loan from heap
Loans.remove(loans_, borrowerAddress_, loans_.indices[borrowerAddress_]);
Loans.remove(loans_, borrowerAddress_, loans_.indices[borrowerAddress_]);
40,133
8
// msgSender from `ctx` increases flow rate allowance for the `flowOperator` by `addedFlowRateAllowance` if `addedFlowRateAllowance` is negative, we revert with CFA_ACL_NO_NEGATIVE_ALLOWANCE token Super token address flowOperator The permission grantee address addedFlowRateAllowance The flow rate allowance delta ctx Co...
function increaseFlowRateAllowance(
function increaseFlowRateAllowance(
35,182
76
// Modify general address params parameter The name of the parameter modified data New value for the parameter /
function modifyParameters(bytes32 parameter, address data) external isAuthorized { require(data != address(0), "TaxCollector/null-data"); if (parameter == "primaryTaxReceiver") primaryTaxReceiver = data; else revert("TaxCollector/modify-unrecognized-param"); emit ModifyParameters(par...
function modifyParameters(bytes32 parameter, address data) external isAuthorized { require(data != address(0), "TaxCollector/null-data"); if (parameter == "primaryTaxReceiver") primaryTaxReceiver = data; else revert("TaxCollector/modify-unrecognized-param"); emit ModifyParameters(par...
37,197
2
// TokenInfo Name property
string internal _name;
string internal _name;
18,457
330
// Pause guardian paused this operation
uint256 internal constant ONLY_UNPAUSED = 83;
uint256 internal constant ONLY_UNPAUSED = 83;
20,259
4
// New owner accept control of the contract. /
function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0x0); }
function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0x0); }
45,266
1
// Thrown when an unexpected empty array is detected. /
error EmptyArray();
error EmptyArray();
26,241
20
// Adds two numbers and checks for overflow before returning./ Does not throw but rather logs an Err event if there is overflow./a First number/b Second number/ return err False normally, or true if there is overflow/ return res The sum of a and b, or 0 if there is overflow
function plus(uint256 a, uint256 b) constant returns (bool err, uint256 res) { assembly{ res := add(a,b) switch and(eq(sub(res,b), a), or(gt(res,b),eq(res,b))) case 0 { err := 1 res := 0 } } if (err) Err("plus func overflow"); }
function plus(uint256 a, uint256 b) constant returns (bool err, uint256 res) { assembly{ res := add(a,b) switch and(eq(sub(res,b), a), or(gt(res,b),eq(res,b))) case 0 { err := 1 res := 0 } } if (err) Err("plus func overflow"); }
17,012
12
// If the old array was shorter, push the new elements in.
for (; i < newMarketConfigurations.length; i++) { pool.marketConfigurations.push(newMarketConfigurations[i]); totalWeight += newMarketConfigurations[i].weightD18; }
for (; i < newMarketConfigurations.length; i++) { pool.marketConfigurations.push(newMarketConfigurations[i]); totalWeight += newMarketConfigurations[i].weightD18; }
25,624
151
// function removeSelector(bytes4 _sig) external;
function getFacetAddressFromSelector(bytes4 _sig) external view returns (address); function getSettingsFacet() external view returns (address); function updateSettingsFacet(address _newSettingsAddress) external; function getTaxFacet() external view returns (address); function updateTaxFacet(add...
function getFacetAddressFromSelector(bytes4 _sig) external view returns (address); function getSettingsFacet() external view returns (address); function updateSettingsFacet(address _newSettingsAddress) external; function getTaxFacet() external view returns (address); function updateTaxFacet(add...
40,417
149
// Safe Transfer ICE./_to The ICE receiver address./_amount transfer ICE amounts.
function _safeTransfer(address _to, uint256 _amount) internal { if (_amount > 0) { ICE.safeTransferFrom(iceTreasury, _to, _amount); } }
function _safeTransfer(address _to, uint256 _amount) internal { if (_amount > 0) { ICE.safeTransferFrom(iceTreasury, _to, _amount); } }
13,543
252
// Emits an {Approval} event. /
function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); // internal owner }
function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); // internal owner }
1,564
86
// returns the n-th NFT ID from a list of owner's tokens. _owner Token owner's address. _index Index number representing n-th token in owner's list of tokens.return Token id. /
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view override returns (uint256)
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view override returns (uint256)
11,738
79
// Retrieve offer item pointer using index.
offerItemPtr := mload( add(
offerItemPtr := mload( add(
14,350
125
// (tokenC, tokenB, tokenA)
return (2, 1, 0);
return (2, 1, 0);
62,503
62
// SafeMath /
library SafeMath { /** * @dev 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 ca...
library SafeMath { /** * @dev 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 ca...
44,355
21
// Sorting activeTerminatedGroups by groupId in ascending order so a non-terminated group is properly selected.
uint256 i; for ( i = self.activeTerminatedGroups.length - 1; i > 0 && self.activeTerminatedGroups[i - 1] > groupId; i-- ) { self.activeTerminatedGroups[i] = self.activeTerminatedGroups[i - 1]; }
uint256 i; for ( i = self.activeTerminatedGroups.length - 1; i > 0 && self.activeTerminatedGroups[i - 1] > groupId; i-- ) { self.activeTerminatedGroups[i] = self.activeTerminatedGroups[i - 1]; }
22,002
134
// convert AAC UID to a 14 character long string of character bytes
bytes memory uidString = intToBytes(_tokenId);
bytes memory uidString = intToBytes(_tokenId);
6,790
255
// min return calculation functions
function calculateSwap( uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx ) external view returns (uint256); function swap( uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx,
function calculateSwap( uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx ) external view returns (uint256); function swap( uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx,
39,493
128
// Enums
enum EarlyWithdrawPenalty { NO_PENALTY, BURN_REWARDS, REDISTRIBUTE_REWARDS }
enum EarlyWithdrawPenalty { NO_PENALTY, BURN_REWARDS, REDISTRIBUTE_REWARDS }
10,875
51
// Stores a new address in the EIP1967 implementation slot. /
function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; }
function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; }
59,956
23
// Multiplies two signed integers, reverts on overflow. /
function mul(int256 a, int256 b) internal pure returns (int256) { // 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-contracts/pull/522 if (a == 0) { ...
function mul(int256 a, int256 b) internal pure returns (int256) { // 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-contracts/pull/522 if (a == 0) { ...
20,880
93
// Apply the premium
initialDebtAuctionMintedTokens = divide(multiply(initialDebtAuctionMintedTokens, protocolTokenPremium), THOUSAND);
initialDebtAuctionMintedTokens = divide(multiply(initialDebtAuctionMintedTokens, protocolTokenPremium), THOUSAND);
7,397
7
// Sign the guest book /
function signGuestBook(string memory name, string memory message) public onlyInvited { GuestBookEntry memory entry = GuestBookEntry({ sender: msg.sender, name: name, message: message }); guestBook.push(entry); emit GuestbookSignatureAdded(now, msg....
function signGuestBook(string memory name, string memory message) public onlyInvited { GuestBookEntry memory entry = GuestBookEntry({ sender: msg.sender, name: name, message: message }); guestBook.push(entry); emit GuestbookSignatureAdded(now, msg....
15,060
85
// WarGame Betting token for War Game /
contract WarGame is Ownable, ERC20 { IUniswapV2Router02 public router; IUniswapV2Factory public factory; IUniswapV2Pair public pair; uint private constant INITIAL_SUPPLY = 10_000_000 * 10**8; // Percent of the initial supply that will go to the LP uint constant LP_BPS = 9500; // Percent ...
contract WarGame is Ownable, ERC20 { IUniswapV2Router02 public router; IUniswapV2Factory public factory; IUniswapV2Pair public pair; uint private constant INITIAL_SUPPLY = 10_000_000 * 10**8; // Percent of the initial supply that will go to the LP uint constant LP_BPS = 9500; // Percent ...
6,201
20
// retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
length := extcodesize(_addr)
19,170
80
// FiatToken ERC20 Token backed by fiat reserves /
contract FiatTokenV1 is AbstractFiatTokenV1, Ownable, Pausable, Blacklistable { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; string public currency; address public masterMinter; bool internal initialized; mapping(address => uint256) inter...
contract FiatTokenV1 is AbstractFiatTokenV1, Ownable, Pausable, Blacklistable { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; string public currency; address public masterMinter; bool internal initialized; mapping(address => uint256) inter...
10,556
15
// Add the token to the stakedTokens array
stakers[msg.sender].stakedTokens.push(stakedToken);
stakers[msg.sender].stakedTokens.push(stakedToken);
9,276
53
// ------------------------------------------------------------------------- MODIFIERS
modifier onlyOperator() { require(msg.sender == operator || msg.sender == juryOperator); _; }
modifier onlyOperator() { require(msg.sender == operator || msg.sender == juryOperator); _; }
25,839
2
// case 1: R=1 R falls below one
receiveQuoteAmount = _ROneSellBaseToken(state, payBaseAmount); newR = RState.BELOW_ONE;
receiveQuoteAmount = _ROneSellBaseToken(state, payBaseAmount); newR = RState.BELOW_ONE;
11,919
8
// function symbol() constant returns(string);
function decimals() constant returns(uint8);
function decimals() constant returns(uint8);
49,452
301
// Push a new player into the queue.
function pushPlayer(address _player) private
function pushPlayer(address _player) private
2,219
583
// adjustments[19]/mload(0x5060), Constraint expression for ecdsa/signature0/add_results/x: column20_row8161column20_row8161 - (column20_row8166 + column20_row4088 + column19_row4103).
let val := addmod( mulmod(/*column20_row8161*/ mload(0x3da0), /*column20_row8161*/ mload(0x3da0), PRIME), sub( PRIME, addmod( addmod(/*column20_row8166*/ mload(0x3dc0), /*column20_row4088*/ mload(0x3d40), PRIME),
let val := addmod( mulmod(/*column20_row8161*/ mload(0x3da0), /*column20_row8161*/ mload(0x3da0), PRIME), sub( PRIME, addmod( addmod(/*column20_row8166*/ mload(0x3dc0), /*column20_row4088*/ mload(0x3d40), PRIME),
56,819
88
// 판매가 종료되는 시간
uint public endTime;
uint public endTime;
10,677
17
// Add the proceeds to the seller's balance.
pendingWithdrawals[orderID] += orderTracker.value(orderID); return true;
pendingWithdrawals[orderID] += orderTracker.value(orderID); return true;
14,479
156
// Set an undelegation time for staked tokens./ Undelegation will begin at the specified timestamp./ You will be able to recover your stake by calling/ `recoverStake()` with operator address once undelegation period is over./_operator Address of the stake operator./_undelegationTimestamp The timestamp undelegation is t...
function undelegateAt( address _operator, uint256 _undelegationTimestamp
function undelegateAt( address _operator, uint256 _undelegationTimestamp
6,869
10
// Emitted when a range edition is created. editionAddress of the song edition contract we are minting for. mintId The mint ID. priceSale price in ETH for minting a single token in `edition`. startTimeStart timestamp of sale (in seconds since unix epoch). cutoffTime The timestamp (in seconds since unix epoch) after whi...
event RangeEditionMintCreated( address indexed edition, uint128 mintId, uint96 price, uint32 startTime, uint32 cutoffTime, uint32 endTime, uint16 affiliateFeeBPS, uint32 maxMintableLower,
event RangeEditionMintCreated( address indexed edition, uint128 mintId, uint96 price, uint32 startTime, uint32 cutoffTime, uint32 endTime, uint16 affiliateFeeBPS, uint32 maxMintableLower,
8,094