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 |
|---|---|---|---|---|
163 | // Make sure only oraclize can call this function | require(msg.sender == oraclize_cbAddress());
| require(msg.sender == oraclize_cbAddress());
| 7,168 |
15 | // should be enough | delete _stakersPool[tokenIds[i]].policyBookAddress;
| delete _stakersPool[tokenIds[i]].policyBookAddress;
| 45,208 |
110 | // require(_investAmount <= marketTypes[_minute].minute.mul(singleInvestAmount)); | IERC20(BUSD).safeTransferFrom(msg.sender, BSNData, _investAmount);
uint price = getEthUsd();
uint openBlock = marketTypes[_minute].duration.add(block.number);
bool isSet = IBSNInterface(BSNData).invest(msg.sender, uint(_investType), _minute, _investAmount, block.number, block.timestamp, openBlock ,price... | IERC20(BUSD).safeTransferFrom(msg.sender, BSNData, _investAmount);
uint price = getEthUsd();
uint openBlock = marketTypes[_minute].duration.add(block.number);
bool isSet = IBSNInterface(BSNData).invest(msg.sender, uint(_investType), _minute, _investAmount, block.number, block.timestamp, openBlock ,price... | 15,018 |
10 | // Segment lies in cycle | uint256[MAX_CYCLE_SIZE] memory result_t7; // empty array
uint256[MAX_CYCLE_SIZE] memory dates_t7;
dates_t7 = computeDatesFromCycleSegment(cStart, cEnd, c, addEndTime, sStart, sEnd);
result_t7[0] = uint256(1525132800); // Tuesday, 2018-05-01 00:00:00 UTC
result_t7[1] = uint256(15... | uint256[MAX_CYCLE_SIZE] memory result_t7; // empty array
uint256[MAX_CYCLE_SIZE] memory dates_t7;
dates_t7 = computeDatesFromCycleSegment(cStart, cEnd, c, addEndTime, sStart, sEnd);
result_t7[0] = uint256(1525132800); // Tuesday, 2018-05-01 00:00:00 UTC
result_t7[1] = uint256(15... | 36,785 |
3 | // 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 c;
}
| 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 c;
}
| 11,655 |
1 | // @inheritdoc IDackieV3PoolImmutables | address public immutable override token0;
| address public immutable override token0;
| 16,188 |
77 | // calculate fee | else if (recipient == uniswapV2Pair) {
feeswap =
sellTaxes.liquidity +
sellTaxes.marketing;
feesum = feeswap;
feeBurn = sellTaxes.burn;
currentTaxes = sellTaxes;
} else if (sender == uniswapV2Pair) {
| else if (recipient == uniswapV2Pair) {
feeswap =
sellTaxes.liquidity +
sellTaxes.marketing;
feesum = feeswap;
feeBurn = sellTaxes.burn;
currentTaxes = sellTaxes;
} else if (sender == uniswapV2Pair) {
| 13,741 |
136 | // Getter function for next requestIds on queue/request with highest payouts at time the function is called / | function getNewVariablesOnDeck()
external
view
returns (uint256[5] memory idsOnDeck, uint256[5] memory tipsOnDeck)
| function getNewVariablesOnDeck()
external
view
returns (uint256[5] memory idsOnDeck, uint256[5] memory tipsOnDeck)
| 77,120 |
11 | // 4 - the rest is by voting only (requires addNewProposal permission) so accessable by Managers only even with voting | dao.allowActionByVoting("manageGroups", token);
dao.allowActionByVoting("modifyMoneyscheme", token);
| dao.allowActionByVoting("manageGroups", token);
dao.allowActionByVoting("modifyMoneyscheme", token);
| 33,849 |
50 | // Admin functionality / |
event Halted();
event Resumed();
bool public halted = false;
|
event Halted();
event Resumed();
bool public halted = false;
| 51,720 |
11 | // Withdraw all assets in the given bundle, returning them to the msg.sender Requirements: - The bundle with id `bundleId` must have been initialized with {initializeBundle}- The bundle with id `bundleId` must be owned by or approved to msg.sender / | function withdraw(uint256 bundleId) external;
| function withdraw(uint256 bundleId) external;
| 52,906 |
145 | // Sets the address that is authorised to perform identity operations on this identity/ manager instance.//newIdentityOperator The address of the new identity operator.// return _ The address of the old identity operator. | function setIdentityOperator(address newIdentityOperator)
public
virtual
onlyProxy
onlyInitialized
onlyOwner
returns (address)
| function setIdentityOperator(address newIdentityOperator)
public
virtual
onlyProxy
onlyInitialized
onlyOwner
returns (address)
| 31,172 |
26 | // get the number of active votes a user holds after delegation (vs the basic balance of reputation he holds)/_user the user to get active votes for/_global wether to include reputation from other blockchains/_blockNumber get votes state at specific block/ return the number of votes | function getVotesAt(
address _user,
bool _global,
uint256 _blockNumber
| function getVotesAt(
address _user,
bool _global,
uint256 _blockNumber
| 29,521 |
2 | // Minimum tick exponential (0.25) / | uint256 internal constant MIN_TICK_EXPONENTIAL = 0.25 * 1e18;
| uint256 internal constant MIN_TICK_EXPONENTIAL = 0.25 * 1e18;
| 16,517 |
25 | // ================= ERC20 =============== | function name() public pure returns (string memory) {
return _name;
}
| function name() public pure returns (string memory) {
return _name;
}
| 929 |
35 | // double check | uint refund = ringFromETH.sub(priceInRING);
if (refund > 0) {
| uint refund = ringFromETH.sub(priceInRING);
if (refund > 0) {
| 38,827 |
23 | // Reverts if there is currently no active deployment ID. / | error NoActiveDeployment();
| error NoActiveDeployment();
| 34,256 |
14 | // Send the ether to the specified address. | msg.sender.send(account.cash);
| msg.sender.send(account.cash);
| 7,034 |
157 | // withdraw ERC20 in the case a held NFT earned ERC20 | function withdrawERC20(address _token) external {
require(_isApprovedOrOwner(msg.sender, 0), "withdraw:not allowed");
IERC20(_token).transfer(msg.sender, IERC20(_token).balanceOf(address(this)));
emit WithdrawERC20(_token, msg.sender);
}
| function withdrawERC20(address _token) external {
require(_isApprovedOrOwner(msg.sender, 0), "withdraw:not allowed");
IERC20(_token).transfer(msg.sender, IERC20(_token).balanceOf(address(this)));
emit WithdrawERC20(_token, msg.sender);
}
| 29,982 |
87 | // if no reserve or a new pair is created | if (amountToSwap <= 0) amountToSwap = SafeMath.div(token0Bought, 2);
token1Bought = _eth2Token(_ToUnipoolToken1, amountToSwap);
token0Bought = SafeMath.sub(token0Bought, amountToSwap);
| if (amountToSwap <= 0) amountToSwap = SafeMath.div(token0Bought, 2);
token1Bought = _eth2Token(_ToUnipoolToken1, amountToSwap);
token0Bought = SafeMath.sub(token0Bought, amountToSwap);
| 35,350 |
22 | // Constructor is called only once and can not be called again / | function CARXTOKEN() public {
balanceOf[msg.sender] = totalSupply;
}
| function CARXTOKEN() public {
balanceOf[msg.sender] = totalSupply;
}
| 24,348 |
14 | // Returns number of allowed tokens that a spender can transfer on behalf of a token owner./_owner Address of token owner./_who Address of token spender./ return Returns remaining allowance for spender. | function allowance(address _owner, address _who) constant public returns (uint256)
| function allowance(address _owner, address _who) constant public returns (uint256)
| 43,620 |
12 | // Construct the calldata for the transferFrom call. | bytes memory proxyCalldata = abi.encodeWithSelector(
IAssetProxy(address(0)).transferFrom.selector,
assetData,
from,
to,
amount
);
| bytes memory proxyCalldata = abi.encodeWithSelector(
IAssetProxy(address(0)).transferFrom.selector,
assetData,
from,
to,
amount
);
| 8,195 |
0 | // uniswap Factory interface to call createPair in constructor | interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
| interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
| 17,882 |
4 | // Receives the answer from the Chainlink node. |
function chainlinkCallback(bytes32 _clRequestId, int256 _response)
external
|
function chainlinkCallback(bytes32 _clRequestId, int256 _response)
external
| 51,918 |
15 | // Has Max | if (typeMaxSupply[_typeId] > 0) {
return tokenMgr.totalMinted(_typeId).add(_amount) <= typeMaxSupply[_typeId];
}
| if (typeMaxSupply[_typeId] > 0) {
return tokenMgr.totalMinted(_typeId).add(_amount) <= typeMaxSupply[_typeId];
}
| 27,105 |
4 | // Convert an amount of input token_ to an equivalent amount of the output tokentoken_ address of token to swap amount amount of token to swap/receive / | function swap(address token_, uint256 amount) external {
IERC20 inputToken = IERC20(token_);
address currentAddress = address(this);
require(inputToken.allowance(msg.sender, currentAddress) >= amount, "Wrapper: Insufficient Allowance.");
// Transfer A || B token from sender to wrapper
inputToken.... | function swap(address token_, uint256 amount) external {
IERC20 inputToken = IERC20(token_);
address currentAddress = address(this);
require(inputToken.allowance(msg.sender, currentAddress) >= amount, "Wrapper: Insufficient Allowance.");
// Transfer A || B token from sender to wrapper
inputToken.... | 13,140 |
101 | // return the next worse offer in the sorted listthe worse offer is the higher one if its an ask,a lower one if its a bid offer,and in both cases the newer one if they're equal. | function getWorseOffer(uint256 id) public view returns (uint256) {
return _rank[id].prev;
}
| function getWorseOffer(uint256 id) public view returns (uint256) {
return _rank[id].prev;
}
| 17,024 |
12 | // return The local chain token address of given ethereum chain token address. / | function getLocalTokenOf(address foreignContractAddress) public view returns (address) {
return tokenForeignToLocal[foreignContractAddress];
}
| function getLocalTokenOf(address foreignContractAddress) public view returns (address) {
return tokenForeignToLocal[foreignContractAddress];
}
| 50,402 |
20 | // transfer releasable tokens for beneficiary wrt the release graph / | function release() external onlyState(State.Active) onlyBeneficiary(msg.sender) {
require(!beneficiaries[msg.sender].releaseAllTokens);
uint releasableAmount = getReleasableAmount(msg.sender);
beneficiaries[msg.sender].withdrawAmount = beneficiaries[msg.sender].withdrawAmount.add(releasableAmount);
... | function release() external onlyState(State.Active) onlyBeneficiary(msg.sender) {
require(!beneficiaries[msg.sender].releaseAllTokens);
uint releasableAmount = getReleasableAmount(msg.sender);
beneficiaries[msg.sender].withdrawAmount = beneficiaries[msg.sender].withdrawAmount.add(releasableAmount);
... | 56,083 |
41 | // ICO is suspended, tokens cannot be distributed among investors. ICO can be resumed to `Active state`. ICO parameters (end date, hard/low caps) may changed. | Suspended,
| Suspended,
| 16,959 |
55 | // Returns a list of all tokens assigned to an address. _owner The owner whose tokens we are interested in This method MUST NEVER be called by smart contract code. First, it's fairlyexpensive (it walks the entire token array looking for tokens belonging to owner),but it also returns a dynamic array, which is only suppo... | function tokensOfOwner(address _owner) external view returns(uint256[] ownerTokens) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
// Return an empty array
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 totalTokens ... | function tokensOfOwner(address _owner) external view returns(uint256[] ownerTokens) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
// Return an empty array
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 totalTokens ... | 15,117 |
341 | // Specifies whether the contract is paused at the moment | bool public paused = false;
| bool public paused = false;
| 26,632 |
221 | // Returns lowest total debt that will be split. | function LOW_TOTAL_DEBT() external view returns (uint256);
| function LOW_TOTAL_DEBT() external view returns (uint256);
| 6,056 |
4 | // redeem, caller handles transfer of created value | function redeem(address account, uint256 amount) public onlyOwner {
require(account != address(0), "zero address");
require(_balances[account] >= amount, "Insufficent balance");
_balances[account] = _balances[account].sub(amount);
_outstandingSupply = _outstandingSupply.sub(amount);... | function redeem(address account, uint256 amount) public onlyOwner {
require(account != address(0), "zero address");
require(_balances[account] >= amount, "Insufficent balance");
_balances[account] = _balances[account].sub(amount);
_outstandingSupply = _outstandingSupply.sub(amount);... | 14,859 |
2 | // Emitted when borrowing is enabled or disabled on a reserve. asset The address of the underlying asset of the reserve enabled True if borrowing is enabled, false otherwise / | event ReserveBorrowing(address indexed asset, bool enabled);
| event ReserveBorrowing(address indexed asset, bool enabled);
| 35,396 |
192 | // number of observations oracle is due to be reimbursed for _signerOrTransmitter address used by oracle for signing or transmitting reports / | function oracleObservationCount(address _signerOrTransmitter)
external
view
returns (uint16)
| function oracleObservationCount(address _signerOrTransmitter)
external
view
returns (uint16)
| 15,854 |
177 | // Checks whether an address is a system account. account the address to check.return true if system account. / | function isSystemAccount(address account) public view returns (bool) {
return systemAccounts.has(account);
}
| function isSystemAccount(address account) public view returns (bool) {
return systemAccounts.has(account);
}
| 3,419 |
17 | // This check is neccessary to prevent a situation where all ownersare accidentally removed, because we do not want an ownable contractto become an orphan. | require(ownerCount > 1);
require(isOwner[owner]);
isOwner[owner] = false;
ownerCount--;
OwnerRemovedEvent(owner);
| require(ownerCount > 1);
require(isOwner[owner]);
isOwner[owner] = false;
ownerCount--;
OwnerRemovedEvent(owner);
| 6,835 |
3 | // Add a new product to the supply chain | function addProduct(uint _id, string memory _name, string memory _description, uint _quantity) public {
products.push(Product(_id, _name, _description, _quantity, msg.sender));
productIdToIndex[_id] = products.length - 1;
}
| function addProduct(uint _id, string memory _name, string memory _description, uint _quantity) public {
products.push(Product(_id, _name, _description, _quantity, msg.sender));
productIdToIndex[_id] = products.length - 1;
}
| 12,469 |
34 | // returns an existing locked network token balance details_providerlocked balances provider _index start indexreturn amount of network tokensreturn lock expiration time / | function lockedBalance(address _provider, uint256 _index) external view override returns (uint256, uint256) {
LockedBalance storage balance = lockedBalances[_provider][_index];
return (balance.amount, balance.expirationTime);
}
| function lockedBalance(address _provider, uint256 _index) external view override returns (uint256, uint256) {
LockedBalance storage balance = lockedBalances[_provider][_index];
return (balance.amount, balance.expirationTime);
}
| 3,159 |
138 | // Make division exact by subtracting the remainder from [prod1 prod0] Compute remainder using mulmod | uint256 remainder;
assembly {
remainder := mulmod(a, b, denominator)
}
| uint256 remainder;
assembly {
remainder := mulmod(a, b, denominator)
}
| 8,915 |
64 | // Make sure that advertisers are requesting a refund for how much ever ether they have. | require(amount > 0, "Amount should be greater than 0");
require(advertiserBalances[msg.sender] > 0, "You have no balance");
require(advertiserBalances[msg.sender] >= amount, "Insufficient balance to refund");
| require(amount > 0, "Amount should be greater than 0");
require(advertiserBalances[msg.sender] > 0, "You have no balance");
require(advertiserBalances[msg.sender] >= amount, "Insufficient balance to refund");
| 51,426 |
9 | // transfer the tokens to this contract | uint256 amountReceived = custodyTokens(token, amount);
uint256 targetRelayerFee = relayerFee(targetChain, address(token));
require(
amountReceived > targetRelayerFee + toNativeTokenAmount,
"insufficient amountReceived"
);
| uint256 amountReceived = custodyTokens(token, amount);
uint256 targetRelayerFee = relayerFee(targetChain, address(token));
require(
amountReceived > targetRelayerFee + toNativeTokenAmount,
"insufficient amountReceived"
);
| 8,974 |
34 | // When a monster flees, the hero health is reduced by monster level + monsterStrength. | uint public monsterStrength = 4;
| uint public monsterStrength = 4;
| 71,436 |
68 | // Events contract issues new tokens for address. Returns success/_for Address of receiver/outcomeTokenCount Number of tokens to issue | function issue(address _for, uint outcomeTokenCount)
public
isEventContract
| function issue(address _for, uint outcomeTokenCount)
public
isEventContract
| 16,013 |
355 | // either debt has decreased, or debt ceilings are not exceeded | require(either(dart <= 0, both(mul(ilk.Art, ilk.rate) <= ilk.line, debt <= Line)), "Vat/ceiling-exceeded");
| require(either(dart <= 0, both(mul(ilk.Art, ilk.rate) <= ilk.line, debt <= Line)), "Vat/ceiling-exceeded");
| 47,026 |
11 | // Update Target Admirer's Last Voted Hrs for Current Token | s.admirers[invokerId][targetId] = block.timestamp;
| s.admirers[invokerId][targetId] = block.timestamp;
| 17,236 |
31 | // Performs the initial distribution of tokens. / | function _initialTokenDistribution() private {
uint[8] memory tokenAmounts = [
uint(140_000_000 ether),
uint(95_000_000 ether),
uint(60_000_000 ether),
uint(18_750_000 ether),
uint(8_250_000 ether),
uint(8_750_000 ether),
u... | function _initialTokenDistribution() private {
uint[8] memory tokenAmounts = [
uint(140_000_000 ether),
uint(95_000_000 ether),
uint(60_000_000 ether),
uint(18_750_000 ether),
uint(8_250_000 ether),
uint(8_750_000 ether),
u... | 44,688 |
95 | // UniRef constructor/_core Fei Core to reference/_pair Uniswap pair to reference/_oracle oracle to reference/_backupOracle backup oracle to reference | constructor(
address _core,
address _pair,
address _oracle,
address _backupOracle
| constructor(
address _core,
address _pair,
address _oracle,
address _backupOracle
| 58,363 |
47 | // "only growth" check | assert(_burnPrice >= _burnPriceTmp);
return true;
| assert(_burnPrice >= _burnPriceTmp);
return true;
| 52,059 |
147 | // The name of the token. | string public override name;
| string public override name;
| 22,503 |
23 | // minor performance improvement, caches the value | rate = payment_tier[i].rate;
| rate = payment_tier[i].rate;
| 21,136 |
32 | // Binary search of the value in the array | uint256 min = 0;
uint256 max = checkpoints.length-1;
while (max > min) {
uint256 mid = (max + min + 1) / 2;
if (checkpoints[mid].fromBlock <= _block) {
min = mid;
} else {
| uint256 min = 0;
uint256 max = checkpoints.length-1;
while (max > min) {
uint256 mid = (max + min + 1) / 2;
if (checkpoints[mid].fromBlock <= _block) {
min = mid;
} else {
| 54,366 |
55 | // Copy remaining bytes | let srcPart := and(mload(src), not(mask))
let destPart := and(mload(dest), mask)
mstore(dest, or(destPart, srcPart))
| let srcPart := and(mload(src), not(mask))
let destPart := and(mload(dest), mask)
mstore(dest, or(destPart, srcPart))
| 39,976 |
47 | // Send the remainder to the owner | token.safeTransfer(owner, token.balanceOf(this));
revoked = true;
Revoked();
| token.safeTransfer(owner, token.balanceOf(this));
revoked = true;
Revoked();
| 23,846 |
37 | // all the settings for this farm in one struct | struct FarmInfo {
IERC20 lpToken;
IERC20 rewardToken;
uint256 startBlock;
uint256 blockReward;
uint256 bonusEndBlock;
uint256 bonus;
uint256 endBlock;
uint256 lastRewardBlock; // Last block number that reward distribution occurs.
uint256 accRewardPerShare; // Accumulated Rewards ... | struct FarmInfo {
IERC20 lpToken;
IERC20 rewardToken;
uint256 startBlock;
uint256 blockReward;
uint256 bonusEndBlock;
uint256 bonus;
uint256 endBlock;
uint256 lastRewardBlock; // Last block number that reward distribution occurs.
uint256 accRewardPerShare; // Accumulated Rewards ... | 19,380 |
63 | // Overrides delivery by minting tokens upon purchase. _beneficiary Token purchaser _tokenAmount Number of tokens to be minted / | function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
require(MintableToken(token).mint(_beneficiary, _tokenAmount));
}
| function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
require(MintableToken(token).mint(_beneficiary, _tokenAmount));
}
| 11,635 |
23 | // for the purpose of protecting user assets, under extreme conditions, the circulation of all tokens in the contract needs to be frozen.This process is under the supervision of the community. / | function emergencyPause() external onlyOwner notSealed {
_pause();
}
| function emergencyPause() external onlyOwner notSealed {
_pause();
}
| 11,957 |
26 | // ownership can be transferred to provided newOwner. Function can only be initiated by contract owner's account | function transferOwnership(address newOwner) public onlyOwner {
require (newOwner != address(0));
owner = newOwner;
}
| function transferOwnership(address newOwner) public onlyOwner {
require (newOwner != address(0));
owner = newOwner;
}
| 42,493 |
36 | // Public Variables | address public multiSigWallet;
uint256 public amountRaised;
uint256 public dividendPayment;
uint256 public numberOfRecordEntries;
uint256 public numberOfTokenHolders;
uint256 public startTime;
uint256 public stopTime;
uint256 public hardcap;
uint256 public pri... | address public multiSigWallet;
uint256 public amountRaised;
uint256 public dividendPayment;
uint256 public numberOfRecordEntries;
uint256 public numberOfTokenHolders;
uint256 public startTime;
uint256 public stopTime;
uint256 public hardcap;
uint256 public pri... | 9,109 |
12 | // Mapping of managed id to deactivated state | function deactivated(uint256 tokenId) external view returns (bool inactive);
| function deactivated(uint256 tokenId) external view returns (bool inactive);
| 24,391 |
182 | // using SafeMath for uint256; | bytes32 private constant META_TRANSACTION_TYPEHASH =
keccak256(
bytes(
"MetaTransaction(uint256 nonce,address from,bytes functionSignature)"
)
);
event MetaTransactionExecuted(
address userAddress,
address payable relayerAddress,
by... | bytes32 private constant META_TRANSACTION_TYPEHASH =
keccak256(
bytes(
"MetaTransaction(uint256 nonce,address from,bytes functionSignature)"
)
);
event MetaTransactionExecuted(
address userAddress,
address payable relayerAddress,
by... | 54,887 |
13 | // Lease signed by the tenant / | {
lease.tenant = msg.sender;
securityDeposited = msg.value;
require( securityDeposited >= lease.securityDeposit);
lease.signedTimestamp = block.timestamp;
state = LeaseState.Signed;
emit leaseSigned(lease.tenant, lease.signedTimestamp);
}//cc
| {
lease.tenant = msg.sender;
securityDeposited = msg.value;
require( securityDeposited >= lease.securityDeposit);
lease.signedTimestamp = block.timestamp;
state = LeaseState.Signed;
emit leaseSigned(lease.tenant, lease.signedTimestamp);
}//cc
| 31,798 |
2 | // Auto-generated via 'PrintFunctionOptimalLog.py' and 'PrintFunctionOptimalExp.py' / | uint256 private constant OPT_LOG_MAX_VAL = 0x15bf0a8b1457695355fb8ac404e7a79e3;
uint256 private constant OPT_EXP_MAX_VAL = 0x800000000000000000000000000000000;
| uint256 private constant OPT_LOG_MAX_VAL = 0x15bf0a8b1457695355fb8ac404e7a79e3;
uint256 private constant OPT_EXP_MAX_VAL = 0x800000000000000000000000000000000;
| 1,572 |
4 | // Boolean to prevent using the same signature twice | mapping(bytes => bool) public usedSignatures;
| mapping(bytes => bool) public usedSignatures;
| 41,284 |
36 | // excludes for | excludedFromFees[address(this)] = true;
excludedFromRewards[address(this)] = true;
excludedFromPausable[address(this)] = true;
| excludedFromFees[address(this)] = true;
excludedFromRewards[address(this)] = true;
excludedFromPausable[address(this)] = true;
| 29,690 |
166 | // sets the address to send withdrawable funds to _teamAddress the new destination address / | function setTeamAddress(address payable _teamAddress) public onlyOwner {
teamAddress = _teamAddress;
}
| function setTeamAddress(address payable _teamAddress) public onlyOwner {
teamAddress = _teamAddress;
}
| 50,340 |
30 | // address public uniswapRouterAddress; IUniswapV2Router02 public uniswapRouter; |
address[] public tokenList;
mapping(address => bool) public whitelist;
|
address[] public tokenList;
mapping(address => bool) public whitelist;
| 48,543 |
21 | // Team allocation percentages (F3D, P3D) + (Pot , Referrals, Community) Referrals / Community rewards are mathematically designed to come from the winner's share of the pot. | fees_[0] = F3Ddatasets.TeamFee(56,10); //50% to pot, 10% to aff, 2% to com, 1% to pot swap, 1% to air drop pot
fees_[1] = F3Ddatasets.TeamFee(56,10); //43% to pot, 10% to aff, 2% to com, 1% to pot swap, 1% to air drop pot
fees_[2] = F3Ddatasets.TeamFee(56,10); //20% to pot, 10% to aff, 2% t... | fees_[0] = F3Ddatasets.TeamFee(56,10); //50% to pot, 10% to aff, 2% to com, 1% to pot swap, 1% to air drop pot
fees_[1] = F3Ddatasets.TeamFee(56,10); //43% to pot, 10% to aff, 2% to com, 1% to pot swap, 1% to air drop pot
fees_[2] = F3Ddatasets.TeamFee(56,10); //20% to pot, 10% to aff, 2% t... | 32,356 |
3 | // If answers after this, will have punishment for being late | uint constant LATE = 10;
uint constant LATE_FEE = 0.1 ether;
uint constant DEPOSIT = 1 ether;
| uint constant LATE = 10;
uint constant LATE_FEE = 0.1 ether;
uint constant DEPOSIT = 1 ether;
| 39,376 |
175 | // Candidate and reserve transcoders | SortedDoublyLL.Data private transcoderPool;
| SortedDoublyLL.Data private transcoderPool;
| 2,052 |
1 | // Required methods | function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view returns (address addr);
function takeOwnership(uint256 _tokenId) public;
fu... | function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view returns (address addr);
function takeOwnership(uint256 _tokenId) public;
fu... | 26,844 |
115 | // claim function to claim pending rewards | function claim() public noContractsAllowed {
updateAccount(msg.sender);
}
| function claim() public noContractsAllowed {
updateAccount(msg.sender);
}
| 6,361 |
56 | // Lock defines a lock of token/ | struct Lock {
uint256 amount;
uint256 expiresAt;
}
| struct Lock {
uint256 amount;
uint256 expiresAt;
}
| 77,319 |
63 | // See {IEIP2981RoyaltyOverride-setDefaultRoyalty}. / | function setDefaultRoyalty(TokenRoyalty calldata royalty) external override onlyOwner {
_setDefaultRoyalty(royalty);
}
| function setDefaultRoyalty(TokenRoyalty calldata royalty) external override onlyOwner {
_setDefaultRoyalty(royalty);
}
| 39,975 |
40 | // Returns the minimum voting power required to create a proposal stored in the voting settings./ return The minimum voting power required to create a proposal. | function minProposerVotingPower() public view virtual returns (uint256) {
return votingSettings.minProposerVotingPower;
}
| function minProposerVotingPower() public view virtual returns (uint256) {
return votingSettings.minProposerVotingPower;
}
| 10,017 |
27 | // Gets the maximum number of tokens an address is allowed to hold/addr The address to check restrictions for | function getMaxBalance(address addr) external view returns(uint256) {
return _maxBalances[addr];
}
| function getMaxBalance(address addr) external view returns(uint256) {
return _maxBalances[addr];
}
| 39,657 |
7 | // Asset States | EntityStates["__IGNORED__"] = 0;
EntityStates["NEW"] = 1;
| EntityStates["__IGNORED__"] = 0;
EntityStates["NEW"] = 1;
| 42,205 |
43 | // Get the available amount of an EtherDelta order./orderAddresses Array of address arrays containing individual order addresses./orderValues Array of uint arrays containing individual order values./exchangeFee Fee percentage of the exchange./v Array ECDSA signature v parameters./r Array of ECDSA signature r parameters... | function getAvailableAmount(
address[5] orderAddresses,
uint[6] orderValues,
uint exchangeFee,
uint8 v,
bytes32 r,
bytes32 s
| function getAvailableAmount(
address[5] orderAddresses,
uint[6] orderValues,
uint exchangeFee,
uint8 v,
bytes32 r,
bytes32 s
| 3,455 |
18 | // Matching Commission | function matchingCarBonus(address _user) internal {
address sponser = userList[users[_user].referrerID];
uint _carBonus;
if(sponser == address(0)) sponser = userList[1];
_teamNetworkEarnWallet[sponser] = new address[](0);
if(((users[sponser... | function matchingCarBonus(address _user) internal {
address sponser = userList[users[_user].referrerID];
uint _carBonus;
if(sponser == address(0)) sponser = userList[1];
_teamNetworkEarnWallet[sponser] = new address[](0);
if(((users[sponser... | 53,792 |
237 | // Uses binarysearch to find the unclaimed lockups for a given account / | function _findFirstUnclaimed(uint64 _lastClaim, address _account)
internal
view
returns(uint256 first)
| function _findFirstUnclaimed(uint64 _lastClaim, address _account)
internal
view
returns(uint256 first)
| 13,491 |
3 | // Function to transfer to another owner for this bike contract / | function transfer(address newOwner) onlyOwner public {
owner = newOwner;
}
| function transfer(address newOwner) onlyOwner public {
owner = newOwner;
}
| 1,288 |
1 | // Returns a boolean value indicating whether `_account` has role `_roleName` or not. | function checkRole(bytes32 _roleName, address _account) external view returns (bool);
| function checkRole(bytes32 _roleName, address _account) external view returns (bool);
| 34,145 |
61 | // Deploy new VestingTrustee contract. | trustee = new VestingTrustee(blok);
fundingRecipient = _fundingRecipient;
startTime = _startTime;
endTime = startTime + SALE_DURATION;
| trustee = new VestingTrustee(blok);
fundingRecipient = _fundingRecipient;
startTime = _startTime;
endTime = startTime + SALE_DURATION;
| 26,844 |
62 | // calculate fee | else{
if(recipient == pair) fee = amount * totSellTax / 100;
else fee = amount * totTax / 100;
}
| else{
if(recipient == pair) fee = amount * totSellTax / 100;
else fee = amount * totTax / 100;
}
| 468 |
14 | // implement signup function | function onSignUp(string hydroId, uint allowance) public senderIsSnowflake() returns (bool) {
require(allowance >= signUpFee, "Must set an allowance of at least 1 HYDRO.");
Snowflake snowflake = Snowflake(snowflakeAddress);
snowflake.withdrawSnowflakeBalanceFrom(hydroId, owner, signUpFee);
... | function onSignUp(string hydroId, uint allowance) public senderIsSnowflake() returns (bool) {
require(allowance >= signUpFee, "Must set an allowance of at least 1 HYDRO.");
Snowflake snowflake = Snowflake(snowflakeAddress);
snowflake.withdrawSnowflakeBalanceFrom(hydroId, owner, signUpFee);
... | 14,475 |
171 | // fee growth per unit of liquidity as of the last update to liquidity or fees owed | uint256 feeGrowthInside0LastX128;
uint256 feeGrowthInside1LastX128;
| uint256 feeGrowthInside0LastX128;
uint256 feeGrowthInside1LastX128;
| 41,292 |
3 | // Integer division of two unsigned integers truncating the quotient,reverts on division by zero. / | function div(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return a / b;
}
| function div(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return a / b;
}
| 17,460 |
126 | // 20% discount bonus amount | uint256 tier1BonusTokens;
| uint256 tier1BonusTokens;
| 19,053 |
17 | // we start with false here to save gas and negate it before returning --> (!invalid) | bool invalid,
string memory reason
)
| bool invalid,
string memory reason
)
| 2,779 |
6 | // Returns the current implementation. | * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
* https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0x360894a13ba1a... | * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
* https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0x360894a13ba1a... | 1,544 |
223 | // List of Items by Type | mapping (OrderType => uint256[]) public itemsByOrderType;
| mapping (OrderType => uint256[]) public itemsByOrderType;
| 34,360 |
17 | // Convenience contract used to make batch view calls to DAO contracts | contract Convenience is Ownable {
enum VotingAppType { Primary, Secondary }
Api3Pool public api3Pool;
address[] public erc20Addresses;
constructor(address api3PoolAddress)
{
api3Pool = Api3Pool(api3PoolAddress);
}
/// @notice Called by the owner to update the addresses of the con... | contract Convenience is Ownable {
enum VotingAppType { Primary, Secondary }
Api3Pool public api3Pool;
address[] public erc20Addresses;
constructor(address api3PoolAddress)
{
api3Pool = Api3Pool(api3PoolAddress);
}
/// @notice Called by the owner to update the addresses of the con... | 36,476 |
7 | // A library for calculating and storing accumulations of time-weighted average values in the form of sumationsof (valuetime). / | library AccumulationLibrary {
/**
* @notice A struct for storing a snapshot of liquidity accumulations.
* @dev The difference of a newer snapshot against an older snapshot can be used to derive time-weighted average
* liquidities by dividing the difference in value by the difference in time.
*... | library AccumulationLibrary {
/**
* @notice A struct for storing a snapshot of liquidity accumulations.
* @dev The difference of a newer snapshot against an older snapshot can be used to derive time-weighted average
* liquidities by dividing the difference in value by the difference in time.
*... | 45,849 |
26 | // require((_when + _present) > _present, "Time travel not possible"); | _tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_setMinter(_to, _tokenId, _uri);
_destroy = _present + _when;
_sender = msg.sender;
| _tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_setMinter(_to, _tokenId, _uri);
_destroy = _present + _when;
_sender = msg.sender;
| 14,902 |
8 | // Function to return username of an Address. | function getUserNameFromAddress(address _address) public view returns(string memory _userName){
return bytes32ToString(userAddressToUsername[_address]);
}
| function getUserNameFromAddress(address _address) public view returns(string memory _userName){
return bytes32ToString(userAddressToUsername[_address]);
}
| 34,213 |
308 | // Get borrowed balance of a token in the uint256 of Wei / | function getBorrowETH(
address _accountAddr
| function getBorrowETH(
address _accountAddr
| 15,128 |
40 | // enable optimisation to pack this in 32b | struct feeRatesStruct {
uint8 rfi;
uint8 liquidity;
uint8 research;
uint8 dev;
}
| struct feeRatesStruct {
uint8 rfi;
uint8 liquidity;
uint8 research;
uint8 dev;
}
| 11,746 |
6 | // if not last element, switch with last | if (pos < admins.length - 1) {
admins[pos] = admins[admins.length - 1];
}
| if (pos < admins.length - 1) {
admins[pos] = admins[admins.length - 1];
}
| 9,657 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.