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 cycleLength;
| 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 cycleLength;
| 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;
// @notice Borrow tokens via a flash loan
function EVRTFlashLoan(address token, uint256 amount) external {
// Token must be whitelisted by lender
//require(_whitelist[token], "token not whitelisted");
// record debt
uint256 debt = amount*(1 + _tokenBorrowFee)/1;
// send borrower the tokens
require(IERC20(token).transfer(msg.sender, amount), "borrow failed");
// Hand over control to borrower
EVRTFlashBorrower(msg.sender).executeOnEVRTFlashLoan(token, debt, amount);
// repay the dept
require(IERC20(token).transferFrom(msg.sender, address(this), debt), "repayment failed");
}
function tokenBorrowFee() public view returns(uint256) {
return _tokenBorrowFee;
}
}
| 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;
// @notice Borrow tokens via a flash loan
function EVRTFlashLoan(address token, uint256 amount) external {
// Token must be whitelisted by lender
//require(_whitelist[token], "token not whitelisted");
// record debt
uint256 debt = amount*(1 + _tokenBorrowFee)/1;
// send borrower the tokens
require(IERC20(token).transfer(msg.sender, amount), "borrow failed");
// Hand over control to borrower
EVRTFlashBorrower(msg.sender).executeOnEVRTFlashLoan(token, debt, amount);
// repay the dept
require(IERC20(token).transferFrom(msg.sender, address(this), debt), "repayment failed");
}
function tokenBorrowFee() public view returns(uint256) {
return _tokenBorrowFee;
}
}
| 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 contract as zero address"
);
mediaContract = mediaContractAddress;
}
| 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 contract as zero address"
);
mediaContract = mediaContractAddress;
}
| 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(-maxFixedAdd(),-maxFixedAdd()-1) throws/ | 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/sponsor Sponsor address/requester Requester address/ return Authorization status of the request | 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();
uint256 newPositionUnit = _getCollateralPosition(_setToken, collateralCToken, setTotalSupply);
| for(uint256 i = 0; i < enabledAssets[_setToken].collateralCTokens.length; i++) {
address collateralCToken = enabledAssets[_setToken].collateralCTokens[i];
uint256 previousPositionUnit = _setToken.getDefaultPositionRealUnit(collateralCToken).toUint256();
uint256 newPositionUnit = _getCollateralPosition(_setToken, collateralCToken, setTotalSupply);
| 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);
if (_days == 15 && stakerVaultPWRD[msg.sender].isStaked == true) {
claimPWRDRewards();
stakerVaultPWRD[msg.sender].stakedMAXXPWRD += _amount;
stakerVaultPWRD[msg.sender].stakedTill = block.timestamp + 15 days;
stakerVaultPWRD[msg.sender].PWRDDays = 15;
stakerVaultPWRD[msg.sender].stakedSince = block.timestamp;
}
if (_days == 15 && stakerVaultPWRD[msg.sender].isStaked == false) {
stakerVaultPWRD[msg.sender].stakedMAXXPWRD += _amount;
stakerVaultPWRD[msg.sender].stakedTill = block.timestamp + 15 days;
stakerVaultPWRD[msg.sender].PWRDDays = 15;
PWRDPoolStakers += 1;
stakerVaultPWRD[msg.sender].isStaked = true;
stakerVaultPWRD[msg.sender].stakedSince = block.timestamp;
}
if (_days == 30 && stakerVaultPWRD[msg.sender].isStaked == true) {
claimPWRDRewards();
stakerVaultPWRD[msg.sender].stakedMAXXPWRD += _amount;
stakerVaultPWRD[msg.sender].stakedTill = block.timestamp + 30 days;
stakerVaultPWRD[msg.sender].PWRDDays = 30;
stakerVaultPWRD[msg.sender].stakedSince = block.timestamp;
}
if (_days == 30 && stakerVaultPWRD[msg.sender].isStaked == false) {
stakerVaultPWRD[msg.sender].stakedMAXXPWRD += _amount;
stakerVaultPWRD[msg.sender].stakedTill = block.timestamp + 30 days;
stakerVaultPWRD[msg.sender].PWRDDays = 30;
PWRDPoolStakers += 1;
stakerVaultPWRD[msg.sender].isStaked = true;
stakerVaultPWRD[msg.sender].stakedSince = block.timestamp;
}
timeDif = block.timestamp - lastAction;
stakerVaultPWRD[msg.sender].PWRDlastClaim = block.timestamp;
PWRDPoolStaked += _amount;
lastAction = block.timestamp;
calculateRwdsPerTknPerSec();
subtractPool();
}
| 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);
if (_days == 15 && stakerVaultPWRD[msg.sender].isStaked == true) {
claimPWRDRewards();
stakerVaultPWRD[msg.sender].stakedMAXXPWRD += _amount;
stakerVaultPWRD[msg.sender].stakedTill = block.timestamp + 15 days;
stakerVaultPWRD[msg.sender].PWRDDays = 15;
stakerVaultPWRD[msg.sender].stakedSince = block.timestamp;
}
if (_days == 15 && stakerVaultPWRD[msg.sender].isStaked == false) {
stakerVaultPWRD[msg.sender].stakedMAXXPWRD += _amount;
stakerVaultPWRD[msg.sender].stakedTill = block.timestamp + 15 days;
stakerVaultPWRD[msg.sender].PWRDDays = 15;
PWRDPoolStakers += 1;
stakerVaultPWRD[msg.sender].isStaked = true;
stakerVaultPWRD[msg.sender].stakedSince = block.timestamp;
}
if (_days == 30 && stakerVaultPWRD[msg.sender].isStaked == true) {
claimPWRDRewards();
stakerVaultPWRD[msg.sender].stakedMAXXPWRD += _amount;
stakerVaultPWRD[msg.sender].stakedTill = block.timestamp + 30 days;
stakerVaultPWRD[msg.sender].PWRDDays = 30;
stakerVaultPWRD[msg.sender].stakedSince = block.timestamp;
}
if (_days == 30 && stakerVaultPWRD[msg.sender].isStaked == false) {
stakerVaultPWRD[msg.sender].stakedMAXXPWRD += _amount;
stakerVaultPWRD[msg.sender].stakedTill = block.timestamp + 30 days;
stakerVaultPWRD[msg.sender].PWRDDays = 30;
PWRDPoolStakers += 1;
stakerVaultPWRD[msg.sender].isStaked = true;
stakerVaultPWRD[msg.sender].stakedSince = block.timestamp;
}
timeDif = block.timestamp - lastAction;
stakerVaultPWRD[msg.sender].PWRDlastClaim = block.timestamp;
PWRDPoolStaked += _amount;
lastAction = block.timestamp;
calculateRwdsPerTknPerSec();
subtractPool();
}
| 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 stake slashed for indexing disputes (ppm) / | 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);
emit Transfer(_from, _to, _value);
return true;
| 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);
emit Transfer(_from, _to, _value);
return true;
| 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");
bytes32 public constant SPENDER_ROLE = keccak256("SPENDER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
bytes32 public constant ISSUER_ROLE = keccak256("ISSUER_ROLE");
ChubbyHipposNFTInterfaceUser public diamondNFT;
/***************************************
* *
* Contract Initialization *
* *
***************************************/
function init() initializer public {
__ERC20PresetMinterPauser_init("WATERMELON", "WM");
_setupRole(UPDATER_ROLE, _msgSender());
_setupRole(BURNER_ROLE, _msgSender());
_setupRole(SPENDER_ROLE, _msgSender());
_setupRole(ISSUER_ROLE, _msgSender());
// 10 tokens per day
RATE = 115740740740740;
CREATION_DATE = block.timestamp;
REVEALED = false;
}
/***************************************
* *
* Contract settings *
* *
***************************************/
function setNFTContractAddress(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to set contract address");
diamondNFT = ChubbyHipposNFTInterfaceUser(_address);
}
function setRate(uint rate) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to set the rate");
RATE = rate;
}
function reveal() external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to reveal the token");
REVEALED = true;
}
function grantUpdaterRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to grant updater role");
grantRole(UPDATER_ROLE, _address);
}
function revokeUpdaterRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to revoke updater role");
revokeRole(UPDATER_ROLE, _address);
}
function grantIssuerRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to grant issuer role");
grantRole(ISSUER_ROLE, _address);
}
function revokeIssuerRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to revoke issuer role");
revokeRole(ISSUER_ROLE, _address);
}
function grantBurnerRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to grant burner role");
grantRole(BURNER_ROLE, _address);
}
function revokeBurnerRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to revoke burner role");
revokeRole(BURNER_ROLE, _address);
}
/***************************************
* *
* Contract logic *
* *
***************************************/
/*
* Called from the main diamond to update rewards on NFT transfers.
*/
function updateRewards(address from, address to) external {
require(hasRole(UPDATER_ROLE, _msgSender()), "WatermelonToken: must have updater role update rewards");
if (from != address(0)) {
updateReward(from);
}
if (to != address(0)) {
updateReward(to);
}
}
function claimReward() external {
require(REVEALED, "WatermelonToken: Tokens are not claimable yet.");
updateReward(msg.sender);
_mint(msg.sender, rewards[msg.sender]);
rewards[msg.sender] = 0;
}
function burnTokens(address _address, uint amount) external {
require(hasRole(BURNER_ROLE, _msgSender()), "WatermelonToken: must have burner role to burn tokens");
_burn(_address, amount);
}
function burnTokensWithClaimable(address _address, uint amount) external {
require(hasRole(BURNER_ROLE, _msgSender()), "WatermelonToken: must have burner role to burn tokens");
updateReward(_address);
int leftOver = int(amount) - int(rewards[_address]);
if (leftOver <= 0) {
rewards[_address] -= amount;
} else {
rewards[_address] = 0;
_burn(_address, uint(leftOver));
}
}
function issueTokens(address _address, uint amount) external {
require(hasRole(ISSUER_ROLE, _msgSender()), "WatermelonToken: must have issuer role to issue tokens");
_mint(_address, amount);
}
function getTotalClaimable(address _address) external view returns (uint) {
return rewards[_address] + getPendingReward(_address);
}
function getPendingReward(address _address) internal view returns (uint) {
return diamondNFT.balanceOf(_address) * RATE * getElapsedTimeSinceLastUpdate(_address);
}
/***************************************
* *
* Contract utils *
* *
***************************************/
function updateReward(address _address) internal {
rewards[_address] += getPendingReward(_address);
lastUpdate[_address] = block.timestamp;
}
function getElapsedTimeSinceLastUpdate(address _address) internal view returns (uint) {
return block.timestamp - (lastUpdate[_address] >= CREATION_DATE ? lastUpdate[_address] : CREATION_DATE);
}
}
| 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");
bytes32 public constant SPENDER_ROLE = keccak256("SPENDER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
bytes32 public constant ISSUER_ROLE = keccak256("ISSUER_ROLE");
ChubbyHipposNFTInterfaceUser public diamondNFT;
/***************************************
* *
* Contract Initialization *
* *
***************************************/
function init() initializer public {
__ERC20PresetMinterPauser_init("WATERMELON", "WM");
_setupRole(UPDATER_ROLE, _msgSender());
_setupRole(BURNER_ROLE, _msgSender());
_setupRole(SPENDER_ROLE, _msgSender());
_setupRole(ISSUER_ROLE, _msgSender());
// 10 tokens per day
RATE = 115740740740740;
CREATION_DATE = block.timestamp;
REVEALED = false;
}
/***************************************
* *
* Contract settings *
* *
***************************************/
function setNFTContractAddress(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to set contract address");
diamondNFT = ChubbyHipposNFTInterfaceUser(_address);
}
function setRate(uint rate) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to set the rate");
RATE = rate;
}
function reveal() external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to reveal the token");
REVEALED = true;
}
function grantUpdaterRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to grant updater role");
grantRole(UPDATER_ROLE, _address);
}
function revokeUpdaterRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to revoke updater role");
revokeRole(UPDATER_ROLE, _address);
}
function grantIssuerRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to grant issuer role");
grantRole(ISSUER_ROLE, _address);
}
function revokeIssuerRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to revoke issuer role");
revokeRole(ISSUER_ROLE, _address);
}
function grantBurnerRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to grant burner role");
grantRole(BURNER_ROLE, _address);
}
function revokeBurnerRole(address _address) external {
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "WatermelonToken: must have admin role to revoke burner role");
revokeRole(BURNER_ROLE, _address);
}
/***************************************
* *
* Contract logic *
* *
***************************************/
/*
* Called from the main diamond to update rewards on NFT transfers.
*/
function updateRewards(address from, address to) external {
require(hasRole(UPDATER_ROLE, _msgSender()), "WatermelonToken: must have updater role update rewards");
if (from != address(0)) {
updateReward(from);
}
if (to != address(0)) {
updateReward(to);
}
}
function claimReward() external {
require(REVEALED, "WatermelonToken: Tokens are not claimable yet.");
updateReward(msg.sender);
_mint(msg.sender, rewards[msg.sender]);
rewards[msg.sender] = 0;
}
function burnTokens(address _address, uint amount) external {
require(hasRole(BURNER_ROLE, _msgSender()), "WatermelonToken: must have burner role to burn tokens");
_burn(_address, amount);
}
function burnTokensWithClaimable(address _address, uint amount) external {
require(hasRole(BURNER_ROLE, _msgSender()), "WatermelonToken: must have burner role to burn tokens");
updateReward(_address);
int leftOver = int(amount) - int(rewards[_address]);
if (leftOver <= 0) {
rewards[_address] -= amount;
} else {
rewards[_address] = 0;
_burn(_address, uint(leftOver));
}
}
function issueTokens(address _address, uint amount) external {
require(hasRole(ISSUER_ROLE, _msgSender()), "WatermelonToken: must have issuer role to issue tokens");
_mint(_address, amount);
}
function getTotalClaimable(address _address) external view returns (uint) {
return rewards[_address] + getPendingReward(_address);
}
function getPendingReward(address _address) internal view returns (uint) {
return diamondNFT.balanceOf(_address) * RATE * getElapsedTimeSinceLastUpdate(_address);
}
/***************************************
* *
* Contract utils *
* *
***************************************/
function updateReward(address _address) internal {
rewards[_address] += getPendingReward(_address);
lastUpdate[_address] = block.timestamp;
}
function getElapsedTimeSinceLastUpdate(address _address) internal view returns (uint) {
return block.timestamp - (lastUpdate[_address] >= CREATION_DATE ? lastUpdate[_address] : CREATION_DATE);
}
}
| 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 token_adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain | 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 _pairedTokenBalance.mul(UNITY).div(_total);
}
}
| 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 _pairedTokenBalance.mul(UNITY).div(_total);
}
}
| 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 proposal amount eth/token to use during execution./ return creator address of proposal creator./ return endLifetime epoch time when proposal voting ends./ return votesFor amount of votes for the proposal./ return votesAgainst amount of votes against the proposal./ return executed whether proposal has been executed or not. | 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.selector`
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from token ID to owner
mapping (uint256 => address) private _tokenOwner;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping from owner to number of owned token
mapping (address => Counters.Counter) private _ownedTokensCount;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
/*
* bytes4(keccak256('balanceOf(address)')) == 0x70a08231
* bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
* bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
* bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
* bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
* bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
*
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
* 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
constructor () public {
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
}
/**
* @dev Gets the balance of the specified address.
* @param owner address to query the balance of
* @return uint256 representing the amount owned by the passed address
*/
function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _ownedTokensCount[owner].current();
}
/**
* @dev Gets the owner of the specified token ID.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId) public view returns (address) {
address owner ; //inject UNINIT LOCAL/STATE VAR
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev Approves another address to transfer the given token ID
* The zero address indicates there is no approved address.
* There can only be one approved address per token at a given time.
* Can only be called by the token owner or an approved operator.
* @param to address to be approved for the given token ID
* @param tokenId uint256 ID of the token to be approved
*/
function approve(address to, uint256 tokenId) public {
address owner ; //inject UNINIT LOCAL/STATE VAR
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev Gets the approved address for a token ID, or zero if no address set
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to query the approval of
* @return address currently approved for the given token ID
*/
function getApproved(uint256 tokenId) public view returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev Sets or unsets the approval of a given operator
* An operator is allowed to transfer all tokens of the sender on their behalf.
* @param to operator address to set the approval
* @param approved representing the status of the approval to be set
*/
function setApprovalForAll(address to, bool approved) public {
require(to != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][to] = approved;
emit ApprovalForAll(_msgSender(), to, approved);
}
/**
* @dev Tells whether an operator is approved by a given owner.
* @param owner owner address which you want to query the approval of
* @param operator operator address which you want to query the approval of
* @return bool whether the given operator is approved by the given owner
*/
function isApprovedForAll(address owner, address operator) public view returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev Transfers the ownership of a given token ID to another address.
* Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
* Requires the msg.sender to be the owner, approved, or operator.
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function transferFrom(address from, address to, uint256 tokenId) public {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transferFrom(from, to, tokenId);
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement {IERC721Receiver-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.
* Requires the msg.sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement {IERC721Receiver-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.
* Requires the _msgSender() to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes data to send along with a safe transfer check
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransferFrom(from, to, tokenId, _data);
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If 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.
* Requires the msg.sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes data to send along with a safe transfer check
*/
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");
}
/**
* @dev Returns whether the specified token exists.
* @param tokenId uint256 ID of the token to query the existence of
* @return bool whether the token exists
*/
function _exists(uint256 tokenId) internal view returns (bool) {
address owner ; //inject UNINIT LOCAL/STATE VAR
return owner != address(0);
}
/**
* @dev Returns whether the given spender can transfer a given token ID.
* @param spender address of the spender to query
* @param tokenId uint256 ID of the token to be transferred
* @return bool whether the msg.sender is approved for the given token ID,
* is an operator of the owner, or is the owner of the token
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner ; //inject UNINIT LOCAL/STATE VAR
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Internal function to mint a new token.
* Reverts if the given token ID already exists.
* @param to The address that will own the minted token
* @param tokenId uint256 ID of the token to be minted
*/
function _addTokenTo(address to, uint256 tokenId) internal {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_tokenOwner[tokenId] = to;
_ownedTokensCount[to].increment();
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* Deprecated, use {_burn} instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned
*/
function _burn(address owner, uint256 tokenId) internal {
require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own");
_clearApproval(tokenId);
_ownedTokensCount[owner].decrement();
_tokenOwner[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* @param tokenId uint256 ID of the token being burned
*/
function _burn(uint256 tokenId) internal {
_burn(ownerOf(tokenId), tokenId);
}
/**
* @dev Internal function to transfer ownership of a given token ID to another address.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function _transferFrom(address from, address to, uint256 tokenId) internal {
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_clearApproval(tokenId);
_ownedTokensCount[from].decrement();
_ownedTokensCount[to].increment();
_tokenOwner[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* This function is deprecated.
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
internal returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes4 retval ; //inject UNINIT LOCAL/STATE VAR
return (retval == _ERC721_RECEIVED);
}
/**
* @dev Private function to clear current approval of a given token ID.
* @param tokenId uint256 ID of the token to be transferred
*/
function _clearApproval(uint256 tokenId) private {
if (_tokenApprovals[tokenId] != address(0)) {
_tokenApprovals[tokenId] = address(0);
}
}
}
| 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.selector`
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from token ID to owner
mapping (uint256 => address) private _tokenOwner;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping from owner to number of owned token
mapping (address => Counters.Counter) private _ownedTokensCount;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
/*
* bytes4(keccak256('balanceOf(address)')) == 0x70a08231
* bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
* bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
* bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
* bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
* bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
*
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
* 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
constructor () public {
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
}
/**
* @dev Gets the balance of the specified address.
* @param owner address to query the balance of
* @return uint256 representing the amount owned by the passed address
*/
function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _ownedTokensCount[owner].current();
}
/**
* @dev Gets the owner of the specified token ID.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId) public view returns (address) {
address owner ; //inject UNINIT LOCAL/STATE VAR
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev Approves another address to transfer the given token ID
* The zero address indicates there is no approved address.
* There can only be one approved address per token at a given time.
* Can only be called by the token owner or an approved operator.
* @param to address to be approved for the given token ID
* @param tokenId uint256 ID of the token to be approved
*/
function approve(address to, uint256 tokenId) public {
address owner ; //inject UNINIT LOCAL/STATE VAR
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev Gets the approved address for a token ID, or zero if no address set
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to query the approval of
* @return address currently approved for the given token ID
*/
function getApproved(uint256 tokenId) public view returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev Sets or unsets the approval of a given operator
* An operator is allowed to transfer all tokens of the sender on their behalf.
* @param to operator address to set the approval
* @param approved representing the status of the approval to be set
*/
function setApprovalForAll(address to, bool approved) public {
require(to != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][to] = approved;
emit ApprovalForAll(_msgSender(), to, approved);
}
/**
* @dev Tells whether an operator is approved by a given owner.
* @param owner owner address which you want to query the approval of
* @param operator operator address which you want to query the approval of
* @return bool whether the given operator is approved by the given owner
*/
function isApprovedForAll(address owner, address operator) public view returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev Transfers the ownership of a given token ID to another address.
* Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
* Requires the msg.sender to be the owner, approved, or operator.
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function transferFrom(address from, address to, uint256 tokenId) public {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transferFrom(from, to, tokenId);
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement {IERC721Receiver-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.
* Requires the msg.sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement {IERC721Receiver-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.
* Requires the _msgSender() to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes data to send along with a safe transfer check
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransferFrom(from, to, tokenId, _data);
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If 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.
* Requires the msg.sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes data to send along with a safe transfer check
*/
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");
}
/**
* @dev Returns whether the specified token exists.
* @param tokenId uint256 ID of the token to query the existence of
* @return bool whether the token exists
*/
function _exists(uint256 tokenId) internal view returns (bool) {
address owner ; //inject UNINIT LOCAL/STATE VAR
return owner != address(0);
}
/**
* @dev Returns whether the given spender can transfer a given token ID.
* @param spender address of the spender to query
* @param tokenId uint256 ID of the token to be transferred
* @return bool whether the msg.sender is approved for the given token ID,
* is an operator of the owner, or is the owner of the token
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner ; //inject UNINIT LOCAL/STATE VAR
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Internal function to mint a new token.
* Reverts if the given token ID already exists.
* @param to The address that will own the minted token
* @param tokenId uint256 ID of the token to be minted
*/
function _addTokenTo(address to, uint256 tokenId) internal {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_tokenOwner[tokenId] = to;
_ownedTokensCount[to].increment();
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* Deprecated, use {_burn} instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned
*/
function _burn(address owner, uint256 tokenId) internal {
require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own");
_clearApproval(tokenId);
_ownedTokensCount[owner].decrement();
_tokenOwner[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* @param tokenId uint256 ID of the token being burned
*/
function _burn(uint256 tokenId) internal {
_burn(ownerOf(tokenId), tokenId);
}
/**
* @dev Internal function to transfer ownership of a given token ID to another address.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function _transferFrom(address from, address to, uint256 tokenId) internal {
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_clearApproval(tokenId);
_ownedTokensCount[from].decrement();
_ownedTokensCount[to].increment();
_tokenOwner[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* This function is deprecated.
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
internal returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes4 retval ; //inject UNINIT LOCAL/STATE VAR
return (retval == _ERC721_RECEIVED);
}
/**
* @dev Private function to clear current approval of a given token ID.
* @param tokenId uint256 ID of the token to be transferred
*/
function _clearApproval(uint256 tokenId) private {
if (_tokenApprovals[tokenId] != address(0)) {
_tokenApprovals[tokenId] = address(0);
}
}
}
| 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 The identifier of the NFT/ | 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 doesn't have enough $BSTICK for this claim");
for(uint256 i = 0; i < receivers.length; i++) {
address receiver = receivers[i];
_claim(true, bsticksPerBreadstick, breadstickIds[i], receiver);
}
}
| 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 doesn't have enough $BSTICK for this claim");
for(uint256 i = 0; i < receivers.length; i++) {
address receiver = receivers[i];
_claim(true, bsticksPerBreadstick, breadstickIds[i], receiver);
}
}
| 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 = _verifier;
emit InsiderListVerifierUpdated(address(_verifier));
}
| 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 = _verifier;
emit InsiderListVerifierUpdated(address(_verifier));
}
| 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 target contract (encoded method name and arguments). / | 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_ADDRESS = 0xBD100d061E120b2c67A24453CF6368E63f1Be056;
address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;
| 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_ADDRESS = 0xBD100d061E120b2c67A24453CF6368E63f1Be056;
address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;
| 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.