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 |
|---|---|---|---|---|
35 | // addressstate variable | address payable botWallet;
address payable adminFeeWallet;
address payable managementFeeWallet;
address payable divsFeeWallet;
address payable bonusWallet;
uint256 public minETH = 1e17;
uint256 public maxETH = 1e21; //1000 eth
uint256 public maxPoolSize = 500e18;
uint256 public ... | address payable botWallet;
address payable adminFeeWallet;
address payable managementFeeWallet;
address payable divsFeeWallet;
address payable bonusWallet;
uint256 public minETH = 1e17;
uint256 public maxETH = 1e21; //1000 eth
uint256 public maxPoolSize = 500e18;
uint256 public ... | 36,546 |
15 | // Any contract that inheritis this contract becomes a flash lender of anyERC20 tokens that it has whitelisted. | contract EVRTFlashLender is Ownable, ReentrancyGuard {
using SafeMath for uint256;
uint256 internal _tokenBorrowFee = 0.001e18; // fee at 0.1%
// only whitelist tokens whose 'transferFrom' function returns false (or reverts)
// on failure
mapping(address => bool) internal _whitelist;
// @not... | contract EVRTFlashLender is Ownable, ReentrancyGuard {
using SafeMath for uint256;
uint256 internal _tokenBorrowFee = 0.001e18; // fee at 0.1%
// only whitelist tokens whose 'transferFrom' function returns false (or reverts)
// on failure
mapping(address => bool) internal _whitelist;
// @not... | 36,726 |
30 | // Everything else not used | cooldownDecreaseAmt: 0,
basePower: 0,
currentPower: 0,
powerIncreaseAmt: 0,
powerDrop: 0,
powerCap: 0,
previousOwner: address(0),
currentOwner: address(0)
| cooldownDecreaseAmt: 0,
basePower: 0,
currentPower: 0,
powerIncreaseAmt: 0,
powerDrop: 0,
powerCap: 0,
previousOwner: address(0),
currentOwner: address(0)
| 39,223 |
373 | // Sets the media contract address. This address is the only permitted address thatcan call the mutable functions. This method can only be called once. / | function configure(address mediaContractAddress) external override {
require(msg.sender == _owner, "Market: Only owner");
require(mediaContract == address(0), "Market: Already configured");
require(
mediaContractAddress != address(0),
"Market: cannot set media contrac... | function configure(address mediaContractAddress) external override {
require(msg.sender == _owner, "Market: Only owner");
require(mediaContract == address(0), "Market: Already configured");
require(
mediaContractAddress != address(0),
"Market: cannot set media contrac... | 22,020 |
5 | // Mapping, returning underlying prices for each token | mapping(address => PriceData) public pricesInfo;
| mapping(address => PriceData) public pricesInfo;
| 31,443 |
51 | // Irrevocably puts contract into safe mode. When in this mode, transactions may only be sent to signing addresses. / | function activateSafeMode() external onlySigner {
safeMode = true;
emit SafeModeActivated(msg.sender);
}
| function activateSafeMode() external onlySigner {
safeMode = true;
emit SafeModeActivated(msg.sender);
}
| 16,874 |
451 | // bytes32 public constant RELAY_ROLE = keccak256("RELAY_ROLE"); | bytes32 public constant RELAY_ROLE = 0x077a1d526a4ce8a773632ab13b4fbbf1fcc954c3dab26cd27ea0e2a6750da5d7;
| bytes32 public constant RELAY_ROLE = 0x077a1d526a4ce8a773632ab13b4fbbf1fcc954c3dab26cd27ea0e2a6750da5d7;
| 82,834 |
134 | // If we have at least reached the bonus 3 range, issue bonuses to everyone in bonus 1 & 2 | else if (tdeFundsRaisedInWei > rangeETHAmount.mul(2) && tdeFundsRaisedInWei <= rangeETHAmount.mul(3)) {
| else if (tdeFundsRaisedInWei > rangeETHAmount.mul(2) && tdeFundsRaisedInWei <= rangeETHAmount.mul(3)) {
| 46,058 |
7 | // Maximum value that can be safely used as an addition operator. Test maxFixedAdd() equals maxInt256()-1 / 2Test add(maxFixedAdd(),maxFixedAdd()) equals maxFixedAdd() + maxFixedAdd()Test add(maxFixedAdd()+1,maxFixedAdd()) throws Test add(-maxFixedAdd(),-maxFixedAdd()) equals -maxFixedAdd() - maxFixedAdd()Test add(-max... | function maxFixedAdd() internal pure returns(int256) {
return 28948022309329048855892746252171976963317496166410141009864396001978282409983;
}
| function maxFixedAdd() internal pure returns(int256) {
return 28948022309329048855892746252171976963317496166410141009864396001978282409983;
}
| 47,949 |
14 | // Transfer ether to user | msg.sender.transfer(leftoverWeth);
| msg.sender.transfer(leftoverWeth);
| 38,974 |
1 | // Stake reward rate | uint256 private constant interest = 2;
uint256 private constant minimumTokenValue = 1000000000000;
| uint256 private constant interest = 2;
uint256 private constant minimumTokenValue = 1000000000000;
| 13,619 |
1 | // The proxy deployment failed. | error DeploymentFailed();
| error DeploymentFailed();
| 18,871 |
21 | // Initialize Contract Parameters | symbol = _tokenSymbol;
name = _tokenName;
decimals = 18; // default decimals is going to be 18 always
_mint(initialAccount, initialBalance);
| symbol = _tokenSymbol;
name = _tokenName;
decimals = 18; // default decimals is going to be 18 always
_mint(initialAccount, initialBalance);
| 59,776 |
10 | // Verifies the authorization status of a request/This method has redundant arguments because all authorizer/ contracts have to have the same interface and potential authorizer/ contracts may require to access the arguments that are redundant here/requestId Request ID/airnode Airnode address/endpointId Endpoint ID/spon... | function isAuthorized(
bytes32 requestId, // solhint-disable-line no-unused-vars
address airnode,
bytes32 endpointId,
address sponsor, // solhint-disable-line no-unused-vars
address requester
| function isAuthorized(
bytes32 requestId, // solhint-disable-line no-unused-vars
address airnode,
bytes32 endpointId,
address sponsor, // solhint-disable-line no-unused-vars
address requester
| 33,831 |
277 | // Loop through collateral assets | for(uint256 i = 0; i < enabledAssets[_setToken].collateralCTokens.length; i++) {
address collateralCToken = enabledAssets[_setToken].collateralCTokens[i];
uint256 previousPositionUnit = _setToken.getDefaultPositionRealUnit(collateralCToken).toUint256();
uint25... | for(uint256 i = 0; i < enabledAssets[_setToken].collateralCTokens.length; i++) {
address collateralCToken = enabledAssets[_setToken].collateralCTokens[i];
uint256 previousPositionUnit = _setToken.getDefaultPositionRealUnit(collateralCToken).toUint256();
uint25... | 35,897 |
154 | // For the grand reveal and where things are now.. where things will forever be.. gods willing | function setBaseURI(string memory uri) public onlyOwner {
baseURI = uri;
}
| function setBaseURI(string memory uri) public onlyOwner {
baseURI = uri;
}
| 21,494 |
10 | // The nonce used by this effectiveTrader. Nonces are used to protect against replay. | uint256 nonce;
| uint256 nonce;
| 10,349 |
20 | // increase the collateral balance in a vault _vault vault to add collateral to _collateralAsset address of the _collateralAsset being added to the user's vault _amount number of _collateralAsset being added to the user's vault _index index of _collateralAsset in the user's vault.collateralAssets array / | function addCollateral(
Vault storage _vault,
address _collateralAsset,
uint256 _amount,
uint256 _index
| function addCollateral(
Vault storage _vault,
address _collateralAsset,
uint256 _amount,
uint256 _index
| 15,912 |
17 | // Max wallet | uint256 public _maxWalletSize = (_totalSupply * 15) / 1000;
uint256 public _maxTxSize = (_totalSupply * 15) / 1000;
| uint256 public _maxWalletSize = (_totalSupply * 15) / 1000;
uint256 public _maxTxSize = (_totalSupply * 15) / 1000;
| 20,216 |
1 | // 存储对账号的控制 ERC20标准 | mapping(address => mapping(address => uint256)) public allowance;
bool stopped;
| mapping(address => mapping(address => uint256)) public allowance;
bool stopped;
| 35,457 |
19 | // ERC20 related state // custom events // contstructor. / | constructor() public {
admins[msg.sender] = true;
}
| constructor() public {
admins[msg.sender] = true;
}
| 16,446 |
55 | // Approve Uniswap router to transfer tokens on behalf of this contract. | if (token.ALLOWANCE300(address(this), address(_uniswap_router975)) != uint256(-1)) {
ok = token.APPROVE776(address(_uniswap_router975), uint256(-1));
require(ok, "Token approval for Uniswap router failed.");
}
| if (token.ALLOWANCE300(address(this), address(_uniswap_router975)) != uint256(-1)) {
ok = token.APPROVE776(address(_uniswap_router975), uint256(-1));
require(ok, "Token approval for Uniswap router failed.");
}
| 14,301 |
55 | // A mapping from Asset UniqueIDs to the price of the token./ stored outside Asset Struct to save gas, because price can change frequently | mapping (uint256 => uint256) internal assetIndexToPrice;
| mapping (uint256 => uint256) internal assetIndexToPrice;
| 14,585 |
30 | // PWRD STAKE | function stakePWRD(uint256 _amount, uint256 _days) public {
require(!PWRDstakingPaused, "STAKING_IS_PAUSED");
require( _days == 15 || _days == 30, "INVALID_STAKING_DURATION");
maxxToken.approve(address(this), _amount);
maxxToken.transferFrom(msg.sender, address(this), _amount);
... | function stakePWRD(uint256 _amount, uint256 _days) public {
require(!PWRDstakingPaused, "STAKING_IS_PAUSED");
require( _days == 15 || _days == 30, "INVALID_STAKING_DURATION");
maxxToken.approve(address(this), _amount);
maxxToken.transferFrom(msg.sender, address(this), _amount);
... | 10,205 |
125 | // Important: Underlying tokens must convert back to original decimals! | amounts[i] = tokenAmount.div(precisions[i]);
require(amounts[i] >= _minRedeemAmounts[i], "fewer than expected");
| amounts[i] = tokenAmount.div(precisions[i]);
require(amounts[i] >= _minRedeemAmounts[i], "fewer than expected");
| 54,036 |
32 | // See `IERC20.balanceOf`./ | function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
| function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
| 22,129 |
39 | // min return check | require(receivedYToken >= minReturn, "MIN_RETURN_FAIL");
| require(receivedYToken >= minReturn, "MIN_RETURN_FAIL");
| 8,904 |
52 | // Moves locked tokens to team account. Could be called only after release time,otherwise would throw an exeption./ | function releaseTeamTokens() public {
teamTimelock.release();
}
| function releaseTeamTokens() public {
teamTimelock.release();
}
| 52,933 |
0 | // Map the dataKeys to their dataValues / | mapping(bytes32 => bytes) internal _store;
| mapping(bytes32 => bytes) internal _store;
| 16,459 |
3 | // Constructor. _finderAddress finder to use to get addresses of DVM contracts. / | constructor(address _finderAddress) {
finder = FinderInterface(_finderAddress);
}
| constructor(address _finderAddress) {
finder = FinderInterface(_finderAddress);
}
| 38,421 |
260 | // Revoke vesting `_vestingId` from `_holder`, returning unvested tokens to the Token Manager_holder Address whose vesting to revoke_vestingId Numeric id of the vesting/ | function revokeVesting(address _holder, uint256 _vestingId)
external
authP(REVOKE_VESTINGS_ROLE, arr(_holder))
vestingExists(_holder, _vestingId)
| function revokeVesting(address _holder, uint256 _vestingId)
external
authP(REVOKE_VESTINGS_ROLE, arr(_holder))
vestingExists(_holder, _vestingId)
| 49,048 |
22 | // read the headerHash from its calldata position in `packedMetadata` | calldataload(pointer)
)
mstore(
| calldataload(pointer)
)
mstore(
| 29,613 |
40 | // Determine hexagons in row. First half is ascending. Second half is descending. | uint8 hexagonsInRow;
if (i <= flatTopRows / 2) {
| uint8 hexagonsInRow;
if (i <= flatTopRows / 2) {
| 3,184 |
64 | // outstanding returns = (total new returns pointsivestor keys) / MULTIPLIER The MULTIPLIER is used also at the point of returns disbursment | outstanding = newReturns.mul(rnd.safeBreakers[_safeBreaker].keys) / MULTIPLIER;
| outstanding = newReturns.mul(rnd.safeBreakers[_safeBreaker].keys) / MULTIPLIER;
| 23,992 |
8 | // if profit is negative, tx will be rollback | uint256 profit = cashOutToken1.sub(cost).sub(fixCost);
if (profit < minProfit) {
revert('No Profit');
}
| uint256 profit = cashOutToken1.sub(cost).sub(fixCost);
if (profit < minProfit) {
revert('No Profit');
}
| 9,269 |
28 | // multi buy | _transfer(this, msg.sender, tthVal);
| _transfer(this, msg.sender, tthVal);
| 35,280 |
4 | // Change The pair contract that you will use as a bot and have liquidity current pair isreturn WETH/USDT / |
function changePairContractManual(
address _wethContract,
address _erc20Contract
)
|
function changePairContractManual(
address _wethContract,
address _erc20Contract
)
| 23,643 |
5 | // nonces[_keyHash] must stay in sync with | nonces[_keyHash] = nonces[_keyHash].add(1);
| nonces[_keyHash] = nonces[_keyHash].add(1);
| 34,991 |
29 | // multiply a UQ112x112 by a uint, returning a UQ144x112 reverts on overflow | function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
uint z;
require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
return uq144x112(z);
}
| function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
uint z;
require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
return uq144x112(z);
}
| 6,120 |
177 | // Removes a reward address from the rewards list. Only the owner can call this method._addr old reward account, that should be removed./ | function removeRewardAddress(address _addr) external onlyOwner {
_removeRewardAddress(_addr);
}
| function removeRewardAddress(address _addr) external onlyOwner {
_removeRewardAddress(_addr);
}
| 21,019 |
290 | // After payback, if strategy has credit line available then send more fund to strategy If payback is more than available credit line then get fund from strategy | if (_totalPayback < _creditLine) {
token.safeTransfer(_strategy, _creditLine - _totalPayback);
} else if (_totalPayback > _creditLine) {
| if (_totalPayback < _creditLine) {
token.safeTransfer(_strategy, _creditLine - _totalPayback);
} else if (_totalPayback > _creditLine) {
| 5,451 |
5 | // Allocate space for the buffer data | buf.capacity = capacity;
assembly {
let ptr := mload(0x40)
mstore(buf, ptr)
mstore(0x40, add(ptr, capacity))
}
| buf.capacity = capacity;
assembly {
let ptr := mload(0x40)
mstore(buf, ptr)
mstore(0x40, add(ptr, capacity))
}
| 31,613 |
14 | // Initialize this contract. _arbitrator Arbitrator role _minimumDeposit Minimum deposit required to create a Dispute _fishermanRewardPercentage Percent of slashed funds for fisherman (ppm) _qrySlashingPercentage Percentage of indexer stake slashed for query disputes (ppm) _idxSlashingPercentage Percentage of indexer s... | function initialize(
address _controller,
address _arbitrator,
uint256 _minimumDeposit,
uint32 _fishermanRewardPercentage,
uint32 _qrySlashingPercentage,
uint32 _idxSlashingPercentage
| function initialize(
address _controller,
address _arbitrator,
uint256 _minimumDeposit,
uint32 _fishermanRewardPercentage,
uint32 _qrySlashingPercentage,
uint32 _idxSlashingPercentage
| 38,545 |
3 | // Modifier to make a function callable only if caller is granted with {LINKER_ROLE}. / | modifier onlyLinker() {
require(hasRole(LINKER_ROLE, msg.sender), "Linker role is required");
_;
}
| modifier onlyLinker() {
require(hasRole(LINKER_ROLE, msg.sender), "Linker role is required");
_;
}
| 59,569 |
7 | // Returns the candlestick at the given index. Doesn't account for the candlestick currently forming. _index Index of the candlestick.return (Candlestick) Latest candlestick for this asset. / | function getPriceAt(uint256 _index) external view returns (Candlestick memory);
| function getPriceAt(uint256 _index) external view returns (Candlestick memory);
| 23,594 |
159 | // This also deletes the contents at the last position of the array | delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
| delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
| 52,590 |
13 | // Emitted when an original NFT with a new seed is minted / | event MintOriginal(address indexed to, uint256 seed, uint256 indexed originalsMinted);
| event MintOriginal(address indexed to, uint256 seed, uint256 indexed originalsMinted);
| 55,299 |
2 | // dai address address public DAI_ADDRESS = 0x6B175474E89094C44Da98b954EedeAC495271d0F; | address public DAI_ADDRESS;
ICToken public CToken;
IERC20 public dai;
| address public DAI_ADDRESS;
ICToken public CToken;
IERC20 public dai;
| 45,345 |
0 | // address of pool creator | address creator;
| address creator;
| 24,334 |
8 | // Contract constructor.It sets the `msg.sender` as the proxy administrator. implementationContract address of the initial implementation. / | constructor(address implementationContract)
public
UpgradeabilityProxy(implementationContract)
| constructor(address implementationContract)
public
UpgradeabilityProxy(implementationContract)
| 31,123 |
189 | // let user lock NFT, access: ANY/_nftId is the NFT id which locked | function lockNFT(uint256 _nftId) external;
| function lockNFT(uint256 _nftId) external;
| 24,535 |
7 | // return _balances[tokenIdToShares[_id]][_owner]; | return balanceOf(_owner, tokenIdToShares[_id]);
| return balanceOf(_owner, tokenIdToShares[_id]);
| 11,661 |
122 | // 配置信息 | uint public taxRate;
uint gasForOraclize;
uint systemGasForOraclize;
uint256 public minStake;
uint256 public maxStake;
uint256 public maxWin;
uint256 public normalRoomMin;
uint256 public normalRoomMax;
uint256 public tripleRoomMin;
uint256 public tripleRoomMax;
| uint public taxRate;
uint gasForOraclize;
uint systemGasForOraclize;
uint256 public minStake;
uint256 public maxStake;
uint256 public maxWin;
uint256 public normalRoomMin;
uint256 public normalRoomMax;
uint256 public tripleRoomMin;
uint256 public tripleRoomMax;
| 34,011 |
169 | // extend base functionality with min investment amount / | function validPurchase() internal view returns (bool) {
// minimal investment: 250 CHF (represented in wei)
require (msg.value >= minContributionInWei);
return super.validPurchase();
}
| function validPurchase() internal view returns (bool) {
// minimal investment: 250 CHF (represented in wei)
require (msg.value >= minContributionInWei);
return super.validPurchase();
}
| 19,092 |
10 | // get rewards too | if (claim) {
getReward(msg.sender, true);
}
| if (claim) {
getReward(msg.sender, true);
}
| 21,226 |
36 | // Private function that sets the specified token URI tokenId uint256 ID of the token to set the URI of uri string the token URI / | function _setTokenURI(uint256 tokenId, string uri) private {
require(_exists(tokenId), "the specified token doesn't exist");
Token storage ownedToken = _tokens[tokenId];
ownedToken.uri = uri;
}
| function _setTokenURI(uint256 tokenId, string uri) private {
require(_exists(tokenId), "the specified token doesn't exist");
Token storage ownedToken = _tokens[tokenId];
ownedToken.uri = uri;
}
| 5,102 |
10 | // Each CommitSig is 105 bytes | uint256 constant COMMIT_SIG_BYTES = 105;
| uint256 constant COMMIT_SIG_BYTES = 105;
| 51,176 |
25 | // 2256 - 1 | return 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
| return 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
| 47,276 |
61 | // AC can accept MET via this function, needed for MetToEth conversion | require(_from != autonomousConverter);
require(_allowance[_from][msg.sender] >= _value);
_balanceOf[_from] = _balanceOf[_from].sub(_value);
_balanceOf[_to] = _balanceOf[_to].add(_value);
_allowance[_from][msg.sender] = _allowance[_from][msg.sender].sub(_value);
... | require(_from != autonomousConverter);
require(_allowance[_from][msg.sender] >= _value);
_balanceOf[_from] = _balanceOf[_from].sub(_value);
_balanceOf[_to] = _balanceOf[_to].add(_value);
_allowance[_from][msg.sender] = _allowance[_from][msg.sender].sub(_value);
... | 80,219 |
148 | // Subtract the amount from the beneficiary's total pending. | pendingAmount[_beneficiary] = pendingAmount[_beneficiary].sub(amount);
| pendingAmount[_beneficiary] = pendingAmount[_beneficiary].sub(amount);
| 33,203 |
40 | // getAmountDailybyNum: get the daily bet amount of a set of numbers./ | function getAmountDailybyNum(uint32 round, uint8[5] nums)
public
view
returns(uint32)
| function getAmountDailybyNum(uint32 round, uint8[5] nums)
public
view
returns(uint32)
| 46,568 |
56 | // BaseACL: Same process not allowed to install twice. | string constant SAME_PROCESS_TWICE = "E56";
| string constant SAME_PROCESS_TWICE = "E56";
| 25,420 |
2 | // Public functions // Sets worker._worker Worker address to be added. / | function setWorker(address _worker) public {
workers[_worker] = true;
}
| function setWorker(address _worker) public {
workers[_worker] = true;
}
| 34,015 |
230 | // This is the actual profit collected from the liquidation | TypesV1.Par memory collateralProfit = liquidationCollateralDelta.sub(
liquidatorCollateralCost
);
| TypesV1.Par memory collateralProfit = liquidationCollateralDelta.sub(
liquidatorCollateralCost
);
| 73,706 |
93 | // distributes the hardSTBL from the leverage providers/emits PoolBalancedUpdated event/_stblAmount amount hardSTBL ingressed into the system | function addLeverageProvidersHardSTBL(uint256 _stblAmount) external;
| function addLeverageProvidersHardSTBL(uint256 _stblAmount) external;
| 41,205 |
0 | // ============ Variables ============ |
string internal _name;
string internal _symbol;
uint256 internal _supply;
uint8 internal _decimals;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
|
string internal _name;
string internal _symbol;
uint256 internal _supply;
uint8 internal _decimals;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
| 47,761 |
2 | // no tokens are vested | if (time <= cliff) {
return 0;
}
| if (time <= cliff) {
return 0;
}
| 19,955 |
20 | // ChubbyHippos contract Extends ERC20 Token Standard basic implementation / | contract WatermelonToken is ERC20PresetMinterPauserUpgradeable {
uint public RATE;
uint public CREATION_DATE;
bool public REVEALED;
mapping(address => uint) public rewards;
mapping(address => uint) public lastUpdate;
bytes32 public constant UPDATER_ROLE = keccak256("UPDATER_ROLE");
bytes3... | contract WatermelonToken is ERC20PresetMinterPauserUpgradeable {
uint public RATE;
uint public CREATION_DATE;
bool public REVEALED;
mapping(address => uint) public rewards;
mapping(address => uint) public lastUpdate;
bytes32 public constant UPDATER_ROLE = keccak256("UPDATER_ROLE");
bytes3... | 64,040 |
83 | // Update parameters of the given pool (only the owner may call) | function set(
uint256 _pid,
uint256 _allocPoint,
uint8 _poolType,
bool _votesEnabled
) external;
| function set(
uint256 _pid,
uint256 _allocPoint,
uint8 _poolType,
bool _votesEnabled
) external;
| 6,218 |
11 | // gets a quote in source native gas, for the amount that send() requires to pay for message delivery_dstChainId - the destination chain identifier_userApplication - the user app address on this EVM chain_payload - the custom message to send over LayerZero_payInZRO - if false, user app pays the protocol fee in native t... | function estimateFees(
uint16 _dstChainId,
address _userApplication,
bytes calldata _payload,
bool _payInZRO,
bytes calldata _adapterParam
) external view returns (uint256 nativeFee, uint256 zroFee);
| function estimateFees(
uint16 _dstChainId,
address _userApplication,
bytes calldata _payload,
bool _payInZRO,
bytes calldata _adapterParam
) external view returns (uint256 nativeFee, uint256 zroFee);
| 27,709 |
26 | // Getter for ratio of the value of pairedToken vs the value of the total supply. | function getRatioPairedToken() public view returns (uint256) {
uint256 _total = getTotalSupply() ;
uint256 _pairedTokenBalance = getAmountOutMin(pairedTokenAddress, WETHAddress,pairedToken.balanceOf(address(this)));
if (_total == 0) {
return 0;
} else {
return... | function getRatioPairedToken() public view returns (uint256) {
uint256 _total = getTotalSupply() ;
uint256 _pairedTokenBalance = getAmountOutMin(pairedTokenAddress, WETHAddress,pairedToken.balanceOf(address(this)));
if (_total == 0) {
return 0;
} else {
return... | 3,686 |
35 | // Prforms allowance transfer of asset balance between holders._from holder address to take from. _icap recipient ICAP address to give to. _value amount to transfer. return success. / | function transferFromToICAP(address _from, bytes32 _icap, uint _value) returns(bool) {
return transferFromToICAPWithReference(_from, _icap, _value, '');
}
| function transferFromToICAP(address _from, bytes32 _icap, uint _value) returns(bool) {
return transferFromToICAPWithReference(_from, _icap, _value, '');
}
| 49,470 |
23 | // Gets proposal info for proposal id./id_ id of proposal to get info for./ return proposalAddress address for proposal execution./ return investTokenAddress secondary address for proposal execution, used for investment proposals if ICO and token addresses differ./ return daoFunction proposal type./ return amount propo... | function getProposal(uint256 id_) external view returns (
address proposalAddress,
address investTokenAddress,
DaoFunction daoFunction,
uint256 amount,
address creator,
uint256 endLifetime,
uint256 votesFor,
uint256 votesAgainst,
bool executed
| function getProposal(uint256 id_) external view returns (
address proposalAddress,
address investTokenAddress,
DaoFunction daoFunction,
uint256 amount,
address creator,
uint256 endLifetime,
uint256 votesFor,
uint256 votesAgainst,
bool executed
| 27,336 |
96 | // once enabled, can never be turned off | function enableTrading() external onlyOwner {
require(!tradingActive, "cannot reenable trading");
tradingActive = true;
swapEnabled = true;
tradingActiveBlock = block.number;
}
| function enableTrading() external onlyOwner {
require(!tradingActive, "cannot reenable trading");
tradingActive = true;
swapEnabled = true;
tradingActiveBlock = block.number;
}
| 3,961 |
414 | // 0 = unlimited, can only set once. | function setMaxSupply(uint64 _maxSupply)
public
onlyRole(DEFAULT_ADMIN_ROLE)
| function setMaxSupply(uint64 _maxSupply)
public
onlyRole(DEFAULT_ADMIN_ROLE)
| 53,054 |
64 | // Transfer token for a specified address when not paused _to The address to transfer to. _value The amount to be transferred. / | function transfer(address _to, uint256 _value) whenNotPaused returns (bool) {
require(_to != address(0));
require(_to != address(this));
return super.transfer(_to, _value);
}
| function transfer(address _to, uint256 _value) whenNotPaused returns (bool) {
require(_to != address(0));
require(_to != address(this));
return super.transfer(_to, _value);
}
| 51,395 |
85 | // Log entry on self destruction of the token | event TokenDestroyed();
| event TokenDestroyed();
| 75,269 |
214 | // ERC721 Non-Fungible Token Standard basic implementationModified to remove the mint function and to replace itwith the _addTokenTo function.This function is very similar to the _mint function, but itdoes not emit a Transfer event / | contract NoMintERC721 is Context, ERC165, IERC721 {
using SafeMath for uint256;
using Address for address;
using Counters for Counters.Counter;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.s... | contract NoMintERC721 is Context, ERC165, IERC721 {
using SafeMath for uint256;
using Address for address;
using Counters for Counters.Counter;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.s... | 10,674 |
68 | // Amount of tokens included in team grants cannot exceed the team supply during genesis | require(updatedGrantsAmount <= teamSupply);
teamGrantsAmount = updatedGrantsAmount;
addVestingGrant(_receiver, _amount, _timeToCliff, _vestingDuration);
| require(updatedGrantsAmount <= teamSupply);
teamGrantsAmount = updatedGrantsAmount;
addVestingGrant(_receiver, _amount, _timeToCliff, _vestingDuration);
| 42,347 |
5 | // Enumerates the NFTs assigned to a franchisorThrows if `_index` >= `franchisorBalanceOf(_franchisor)` or if `_franchisor` is the zero address, representing an invalid address._index The index of the token to return (should be less than total franchisor tokens)_franchisor Address of the franchisor owner return uint256... | function tokensOfFranchisorByIndex(uint256 _index, address _franchisor) public view returns (uint256 token);
| function tokensOfFranchisorByIndex(uint256 _index, address _franchisor) public view returns (uint256 token);
| 34,095 |
5 | // config echoMap which indicates how many tokens will be distributed at each epoch | for (uint i = 0; i < NUM_EPOCH; i++) {
Echo storage echo = echoMap[i];
echo.id = i;
echo.endBlock = BLOCKS_PER_EPOCH.mul(i.add(1));
uint amount = DIST_START_AMOUNT.div(i.add(1));
if (amount < DIST_MIN_AMOUNT) {
amount = DIST_MIN_AMOUNT... | for (uint i = 0; i < NUM_EPOCH; i++) {
Echo storage echo = echoMap[i];
echo.id = i;
echo.endBlock = BLOCKS_PER_EPOCH.mul(i.add(1));
uint amount = DIST_START_AMOUNT.div(i.add(1));
if (amount < DIST_MIN_AMOUNT) {
amount = DIST_MIN_AMOUNT... | 6,059 |
79 | // Claim Breadsticks for given Breadstick IDs (address array and breadstickId array order MUST match)/receivers Address of receivers/breadstickIds The tokenId of the Breadstick NFTs | function airdropBreadsticks(address[] memory receivers, uint256[] memory breadstickIds) external {
require(_msgSender() == airdropBuffetWallet, "Can only be initiated by Airdrop Buffet Wallet");
require(bsticksPerBreadstick * receivers.length <= balanceOf(airdropBuffetWallet), "Airdrop Buffet Wallet... | function airdropBreadsticks(address[] memory receivers, uint256[] memory breadstickIds) external {
require(_msgSender() == airdropBuffetWallet, "Can only be initiated by Airdrop Buffet Wallet");
require(bsticksPerBreadstick * receivers.length <= balanceOf(airdropBuffetWallet), "Airdrop Buffet Wallet... | 5,720 |
31 | // swap cake to reward token | uint256 beforeAmt = IERC20(_reward).balanceOf(address(this));
_token2Token(address(sushi), _reward, pending);
uint256 afterAmt = IERC20(_reward).balanceOf(address(this));
IERC20(_reward).safeTransfer(_user, afterAmt - beforeAmt);
| uint256 beforeAmt = IERC20(_reward).balanceOf(address(this));
_token2Token(address(sushi), _reward, pending);
uint256 afterAmt = IERC20(_reward).balanceOf(address(this));
IERC20(_reward).safeTransfer(_user, afterAmt - beforeAmt);
| 18,739 |
6 | // Set a InsiderList Verifier contract for this contract. _verifier Verifier contract address./ | function setInsiderListVerifier(InsiderListVerifier _verifier) external onlyOrchestrator {
require(address(_verifier) != address(0), "Verifier address must not be a zero address.");
require(Address.isContract(address(_verifier)), "Address must point to a contract.");
insiderListVerifier = _v... | function setInsiderListVerifier(InsiderListVerifier _verifier) external onlyOrchestrator {
require(address(_verifier) != address(0), "Verifier address must not be a zero address.");
require(Address.isContract(address(_verifier)), "Address must point to a contract.");
insiderListVerifier = _v... | 27,809 |
135 | // return Returns the currently unclaimed orbs token reward balance of the given address. | function getStakingRewardBalance(address addr) external view returns (uint256 balance);
| function getStakingRewardBalance(address addr) external view returns (uint256 balance);
| 24,156 |
20 | // called by the owner on end of emergency, returns to normal state | function release() external onlyOwner onlyInEmergency {
stopped = false;
}
| function release() external onlyOwner onlyInEmergency {
stopped = false;
}
| 33,112 |
2 | // Performs a delegetecall on a targetContract in the context of self.Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes. targetContract Address of the contract containing the code to execute. calldataPayload Calldata that should be sent to the targ... | function simulateDelegatecall(
address targetContract,
bytes memory calldataPayload
| function simulateDelegatecall(
address targetContract,
bytes memory calldataPayload
| 52,964 |
194 | // Info of each funding. | FundingHolderInfo[] public fundingHolders;
| FundingHolderInfo[] public fundingHolders;
| 513 |
15 | // Event: new document added. | event DocumentAdded (uint id);
| event DocumentAdded (uint id);
| 11,364 |
84 | // ADD BONUS IF APPLICABLE | bonusTokens[msg.sender] += totalBonus;
| bonusTokens[msg.sender] += totalBonus;
| 28,764 |
12 | // create the new quantized token contract | quantizedToken = QuantizedERC20Factory(erc20factory).createQuantized(
address(this),
multitoken,
uint256(token)
);
| quantizedToken = QuantizedERC20Factory(erc20factory).createQuantized(
address(this),
multitoken,
uint256(token)
);
| 12,049 |
114 | // ETH fee equivalent predefined gas price | uint public constant MIN_ETH_FEE_IN_WEI = 4000 * 1 * 10**9;
address public constant TRUSTED_DEPOSIT_TOKEN_ADDRESS = 0x6B175474E89094C44Da98b954EedeAC495271d0F;
address public constant TRUSTED_CTOKEN_ADDRESS = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643;
address public constant TRUSTED_PLATFORM_TOKEN... | uint public constant MIN_ETH_FEE_IN_WEI = 4000 * 1 * 10**9;
address public constant TRUSTED_DEPOSIT_TOKEN_ADDRESS = 0x6B175474E89094C44Da98b954EedeAC495271d0F;
address public constant TRUSTED_CTOKEN_ADDRESS = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643;
address public constant TRUSTED_PLATFORM_TOKEN... | 10,879 |
4 | // stock cards | mapping (uint256 => NTAdatasets.Card) cIDCard; //get card by cID
address cardSeller;
| mapping (uint256 => NTAdatasets.Card) cIDCard; //get card by cID
address cardSeller;
| 21,191 |
67 | // In voting phase | if (votings[votingId].firstVotingBlock < votings[votingId].startBlock ||
votings[votingId].firstVotingBlock + blocksPerPhase >= block.number
) {
return VotePhases.Voting;
}
| if (votings[votingId].firstVotingBlock < votings[votingId].startBlock ||
votings[votingId].firstVotingBlock + blocksPerPhase >= block.number
) {
return VotePhases.Voting;
}
| 47,897 |
424 | // maximum length of return value/revert reason for 'execute' method. Will truncate result if exceeded. | uint256 private constant MAX_RETURN_SIZE = 1024;
| uint256 private constant MAX_RETURN_SIZE = 1024;
| 78,264 |
2 | // wallets currently getting dripped tokens | mapping(address => Accruer) private _accruers;
| mapping(address => Accruer) private _accruers;
| 29,918 |
129 | // Creates `_amount` token to `_account`. Must only be called by the owner. | function mint(address _account, uint256 _amount) public onlyOwner {
_mint(_account, _amount);
_moveDelegates(address(0), _delegates[_account], _amount);
}
| function mint(address _account, uint256 _amount) public onlyOwner {
_mint(_account, _amount);
_moveDelegates(address(0), _delegates[_account], _amount);
}
| 38,668 |
393 | // Calls target with specified data and tests if it's equal to the value/value Value to test/ return Result True if call to target returns the same value as `value`. Otherwise, false | function eq(uint256 value, bytes calldata data) public view returns(bool) {
(bool success, uint256 res) = _selfStaticCall(data);
return success && res == value;
}
| function eq(uint256 value, bytes calldata data) public view returns(bool) {
(bool success, uint256 res) = _selfStaticCall(data);
return success && res == value;
}
| 15,202 |
143 | // Loop over all deposits | for (uint256 i = 0; i < lengthUserDeposits; i++) {
UserDeposit memory currentDeposit = user.deposits[i]; // MEMORY BE CAREFUL
if(currentDeposit.withdrawed == false // If it has not yet been withdrawed
&& // And
| for (uint256 i = 0; i < lengthUserDeposits; i++) {
UserDeposit memory currentDeposit = user.deposits[i]; // MEMORY BE CAREFUL
if(currentDeposit.withdrawed == false // If it has not yet been withdrawed
&& // And
| 8,655 |
1 | // first gem : value = roll between ((numGemsSoFar-1)5+1) and 25 | values[gemId] = _computeValue(
assetId,
gemId,
events[i].blockHash,
slotIndex,
(uint32(numGemsSoFar) - 1) * 5 + 1
);
| values[gemId] = _computeValue(
assetId,
gemId,
events[i].blockHash,
slotIndex,
(uint32(numGemsSoFar) - 1) * 5 + 1
);
| 31,097 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.