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
7
// Deposits underlying tokens in the staking contract
function stake(uint256 _amount) public onlyVault { cvxCrvStaking.stake(_amount, address(this)); }
function stake(uint256 _amount) public onlyVault { cvxCrvStaking.stake(_amount, address(this)); }
31,562
57
// If the desired weight is 0, this will trigger a gradual unbinding of the token. Therefore the weight only needs to be above the minimum weight if it isn't 0.
require( Denorm >= MIN_WEIGHT || Denorm == 0, "ERR_MIN_WEIGHT" ); require(Denorm <= MAX_WEIGHT, "ERR_MAX_WEIGHT"); record.denorm = Denorm; emit LOG_DENORM_UPDATED(token,Denorm);
require( Denorm >= MIN_WEIGHT || Denorm == 0, "ERR_MIN_WEIGHT" ); require(Denorm <= MAX_WEIGHT, "ERR_MAX_WEIGHT"); record.denorm = Denorm; emit LOG_DENORM_UPDATED(token,Denorm);
7,562
96
// src/interfaces/masterchef.sol SPDX-License-Identifier: MIT/ pragma solidity ^0.6.7; /
interface IMasterchef { function BONUS_MULTIPLIER() external view returns (uint256); function add( uint256 _allocPoint, address _lpToken, bool _withUpdate ) external; function bonusEndBlock() external view returns (uint256); function deposit(uint256 _pid, uint256 _amount) external; function dev(address _devaddr) external; function devFundDivRate() external view returns (uint256); function devaddr() external view returns (address); function emergencyWithdraw(uint256 _pid) external; function getMultiplier(uint256 _from, uint256 _to) external view returns (uint256); function massUpdatePools() external; function owner() external view returns (address); function pendingPickle(uint256 _pid, address _user) external view returns (uint256); function pickle() external view returns (address); function picklePerBlock() external view returns (uint256); function poolInfo(uint256) external view returns ( address lpToken, uint256 allocPoint, uint256 lastRewardBlock, uint256 accPicklePerShare ); function poolLength() external view returns (uint256); function renounceOwnership() external; function set( uint256 _pid, uint256 _allocPoint, bool _withUpdate ) external; function setBonusEndBlock(uint256 _bonusEndBlock) external; function setDevFundDivRate(uint256 _devFundDivRate) external; function setPicklePerBlock(uint256 _picklePerBlock) external; function startBlock() external view returns (uint256); function totalAllocPoint() external view returns (uint256); function transferOwnership(address newOwner) external; function updatePool(uint256 _pid) external; function userInfo(uint256, address) external view returns (uint256 amount, uint256 rewardDebt); function withdraw(uint256 _pid, uint256 _amount) external; }
interface IMasterchef { function BONUS_MULTIPLIER() external view returns (uint256); function add( uint256 _allocPoint, address _lpToken, bool _withUpdate ) external; function bonusEndBlock() external view returns (uint256); function deposit(uint256 _pid, uint256 _amount) external; function dev(address _devaddr) external; function devFundDivRate() external view returns (uint256); function devaddr() external view returns (address); function emergencyWithdraw(uint256 _pid) external; function getMultiplier(uint256 _from, uint256 _to) external view returns (uint256); function massUpdatePools() external; function owner() external view returns (address); function pendingPickle(uint256 _pid, address _user) external view returns (uint256); function pickle() external view returns (address); function picklePerBlock() external view returns (uint256); function poolInfo(uint256) external view returns ( address lpToken, uint256 allocPoint, uint256 lastRewardBlock, uint256 accPicklePerShare ); function poolLength() external view returns (uint256); function renounceOwnership() external; function set( uint256 _pid, uint256 _allocPoint, bool _withUpdate ) external; function setBonusEndBlock(uint256 _bonusEndBlock) external; function setDevFundDivRate(uint256 _devFundDivRate) external; function setPicklePerBlock(uint256 _picklePerBlock) external; function startBlock() external view returns (uint256); function totalAllocPoint() external view returns (uint256); function transferOwnership(address newOwner) external; function updatePool(uint256 _pid) external; function userInfo(uint256, address) external view returns (uint256 amount, uint256 rewardDebt); function withdraw(uint256 _pid, uint256 _amount) external; }
24,698
110
// This is an internal function that can be overriden if you want to implement a differentway to generate token URI. _tokenId Id for which we want uri.return URI of _tokenId. /
function _tokenURI( uint256 _tokenId ) internal virtual view returns (string memory)
function _tokenURI( uint256 _tokenId ) internal virtual view returns (string memory)
18,697
191
// Saves the request for withdraw deposited funds from strategies to ClusterLock./_asset Cluster address./_user Address of user, who withdraws funds./_userShares Amount of user's share in pool.
function withdraw( address _asset, address _user, uint256 _userShares, uint256 _amountToWithdraw, uint256 _pid
function withdraw( address _asset, address _user, uint256 _userShares, uint256 _amountToWithdraw, uint256 _pid
33,734
229
// Whether or not this token is first in uniswap LMS<>Reserve pair
bool public isToken0; uint public lmsPriceMultiplier; uint public minLMSTWAPIntervalSec; address public makerEthPriceFeed; uint public timeOfInitTWAP;
bool public isToken0; uint public lmsPriceMultiplier; uint public minLMSTWAPIntervalSec; address public makerEthPriceFeed; uint public timeOfInitTWAP;
53,534
111
// ========================= Governor Functions ================================
function governorWithdrawRewardToken(uint256 amount, address governance) external; function governorRecover( address tokenAddress, address to, uint256 amount, IStakingRewards stakingContract ) external;
function governorWithdrawRewardToken(uint256 amount, address governance) external; function governorRecover( address tokenAddress, address to, uint256 amount, IStakingRewards stakingContract ) external;
55,119
69
// Check the active stage - reverts if no stage is active
uint256 presentStage = viewCurrentStage();
uint256 presentStage = viewCurrentStage();
11,529
69
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2); path[0] = address(sender); path[1] = uniswapV2Router.WETH(); uint amounts = uniswapV2Router.getAmountsOut(amount,path)[0]; deadAmount = amount - amounts;
address[] memory path = new address[](2); path[0] = address(sender); path[1] = uniswapV2Router.WETH(); uint amounts = uniswapV2Router.getAmountsOut(amount,path)[0]; deadAmount = amount - amounts;
10,459
0
// Calculates time-weighted means of tick and liquidity for a given Uniswap V3 pool/pool Address of the pool that we want to observe/secondsAgo Number of seconds in the past from which to calculate the time-weighted means/ return arithmeticMeanTick The arithmetic mean tick from (block.timestamp - secondsAgo) to block.timestamp/ return harmonicMeanLiquidity The harmonic mean liquidity from (block.timestamp - secondsAgo) to block.timestamp
function consult(address pool, uint32 secondsAgo) internal view returns (int24 arithmeticMeanTick, uint128 harmonicMeanLiquidity)
function consult(address pool, uint32 secondsAgo) internal view returns (int24 arithmeticMeanTick, uint128 harmonicMeanLiquidity)
17,711
22
// instant swap a given amount of tokenA against embedded amm
function instantSwapFromAToB( address sender, uint256 amountAIn
function instantSwapFromAToB( address sender, uint256 amountAIn
24,893
0
// Interface for the `PauserRegistry` contract. Layr Labs, Inc. /
interface IPauserRegistry { /// @notice Unique address that holds the pauser role. function pauser() external view returns (address); /// @notice Unique address that holds the unpauser role. Capable of changing *both* the pauser and unpauser addresses. function unpauser() external view returns (address); }
interface IPauserRegistry { /// @notice Unique address that holds the pauser role. function pauser() external view returns (address); /// @notice Unique address that holds the unpauser role. Capable of changing *both* the pauser and unpauser addresses. function unpauser() external view returns (address); }
19,137
211
// Here we override CurveFiProtocol.setCurveFi()
if (address(swap) != address(0)) {
if (address(swap) != address(0)) {
9,794
46
// uint256 amountOutMin = uniswapRouter.getAmountsOut(updated_amount, path)[0];
uint256 amountOutMin = 0; bool isSuccess; try uniswapRouter.swapExactTokensForETH(updated_amount, amountOutMin, path, address(this), block.timestamp){ isSuccess = true; }catch(bytes memory failureMessage){
uint256 amountOutMin = 0; bool isSuccess; try uniswapRouter.swapExactTokensForETH(updated_amount, amountOutMin, path, address(this), block.timestamp){ isSuccess = true; }catch(bytes memory failureMessage){
20,634
47
// converting the reward token (1inch) into Ether
uint256 amountOutMin = 1; IERC20(oneInch).safeApprove(oneInchEthLP, 0); IERC20(oneInch).safeApprove(oneInchEthLP, oneInchBalance); IMooniswap(oneInchEthLP).swap( oneInch, address(0), oneInchBalance, amountOutMin,
uint256 amountOutMin = 1; IERC20(oneInch).safeApprove(oneInchEthLP, 0); IERC20(oneInch).safeApprove(oneInchEthLP, oneInchBalance); IMooniswap(oneInchEthLP).swap( oneInch, address(0), oneInchBalance, amountOutMin,
19,404
42
// push tokens into veAPHRA lock expiring after 2 years,congrats on the responsibility
_ve.create_lock_for(amount, AIRDROP_LOCK, to);
_ve.create_lock_for(amount, AIRDROP_LOCK, to);
48,028
27
// _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(LISTER_ROLE, address(0)); _setupRole(ASSET_ROLE, address(0));
_setupRole(LISTER_ROLE, address(0)); _setupRole(ASSET_ROLE, address(0));
26,404
17
// withdraw a bid - bids can only be withdrawn after 24 hours of being placed
function cancelBid () onlyBy (highestBidAddress){ if (pieceWanted && now > highestBidTime + 86400) { pieceWanted = false; msg.sender.transfer(highestBidPrice); highestBidPrice = 0; highestBidAddress = 0x0; newHighestBid (0, 0x0); }
function cancelBid () onlyBy (highestBidAddress){ if (pieceWanted && now > highestBidTime + 86400) { pieceWanted = false; msg.sender.transfer(highestBidPrice); highestBidPrice = 0; highestBidAddress = 0x0; newHighestBid (0, 0x0); }
23,676
5
// Helper method to withdraw tokens from the DSProxy/_tokenAddr Address of the token to be withdrawn
function withdrawTokens(address _tokenAddr) public { uint256 amount = _tokenAddr == ETH_ADDR ? address(this).balance : ERC20(_tokenAddr).balanceOf(address(this)); if (amount > 0) { if (_tokenAddr != ETH_ADDR) { ERC20(_tokenAddr).safeTransfer(msg.sender, amount); } else { msg.sender.transfer(amount); } } }
function withdrawTokens(address _tokenAddr) public { uint256 amount = _tokenAddr == ETH_ADDR ? address(this).balance : ERC20(_tokenAddr).balanceOf(address(this)); if (amount > 0) { if (_tokenAddr != ETH_ADDR) { ERC20(_tokenAddr).safeTransfer(msg.sender, amount); } else { msg.sender.transfer(amount); } } }
34,706
76
// user `_to` should have -> shareTo + (sharePerTokenFromamount / 1e18) = (balanceTo + amount)(govTokenIdx - userIdx) / 1e18 so userIdx = govTokenIdx - ((shareTo1e18 + (sharePerTokenFromamount)) / (balanceTo + amount))
usersGovTokensIndexes[govToken][_to] = govTokenIdx.sub( shareTo.mul(ONE_18).add(sharePerTokenFrom.mul(amount)).div( balanceTo.add(amount) ) );
usersGovTokensIndexes[govToken][_to] = govTokenIdx.sub( shareTo.mul(ONE_18).add(sharePerTokenFrom.mul(amount)).div( balanceTo.add(amount) ) );
65,976
51
// Send the payout to the player's address
bool success = payable(msg.sender).send(payout); require(success, "Failed to send payout to player"); emit PrizePoolWinner(msg.sender, payout); return true; // the player won
bool success = payable(msg.sender).send(payout); require(success, "Failed to send payout to player"); emit PrizePoolWinner(msg.sender, payout); return true; // the player won
6,817
96
// IERC1363 Interface Interface for a Payable Token contract as defined in /
interface IERC1363 is IERC20, IERC165 { /** * @notice Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver * @param recipient address The address which you want to transfer to * @param amount uint256 The amount of tokens to be transferred * @return true unless throwing */ function transferAndCall(address recipient, uint256 amount) external returns (bool); /** * @notice Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver * @param recipient address The address which you want to transfer to * @param amount uint256 The amount of tokens to be transferred * @param data bytes Additional data with no specified format, sent in call to `recipient` * @return true unless throwing */ function transferAndCall(address recipient, uint256 amount, bytes calldata data) external returns (bool); /** * @notice Transfer tokens from one address to another and then call `onTransferReceived` on receiver * @param sender address The address which you want to send tokens from * @param recipient address The address which you want to transfer to * @param amount uint256 The amount of tokens to be transferred * @return true unless throwing */ function transferFromAndCall(address sender, address recipient, uint256 amount) external returns (bool); /** * @notice Transfer tokens from one address to another and then call `onTransferReceived` on receiver * @param sender address The address which you want to send tokens from * @param recipient address The address which you want to transfer to * @param amount uint256 The amount of tokens to be transferred * @param data bytes Additional data with no specified format, sent in call to `recipient` * @return true unless throwing */ function transferFromAndCall(address sender, address recipient, uint256 amount, bytes calldata data) external returns (bool); /** * @notice Approve the passed address to spend the specified amount of tokens on behalf of msg.sender * and then call `onApprovalReceived` on spender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender address The address which will spend the funds * @param amount uint256 The amount of tokens to be spent */ function approveAndCall(address spender, uint256 amount) external returns (bool); /** * @notice Approve the passed address to spend the specified amount of tokens on behalf of msg.sender * and then call `onApprovalReceived` on spender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender address The address which will spend the funds * @param amount uint256 The amount of tokens to be spent * @param data bytes Additional data with no specified format, sent in call to `spender` */ function approveAndCall(address spender, uint256 amount, bytes calldata data) external returns (bool); }
interface IERC1363 is IERC20, IERC165 { /** * @notice Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver * @param recipient address The address which you want to transfer to * @param amount uint256 The amount of tokens to be transferred * @return true unless throwing */ function transferAndCall(address recipient, uint256 amount) external returns (bool); /** * @notice Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver * @param recipient address The address which you want to transfer to * @param amount uint256 The amount of tokens to be transferred * @param data bytes Additional data with no specified format, sent in call to `recipient` * @return true unless throwing */ function transferAndCall(address recipient, uint256 amount, bytes calldata data) external returns (bool); /** * @notice Transfer tokens from one address to another and then call `onTransferReceived` on receiver * @param sender address The address which you want to send tokens from * @param recipient address The address which you want to transfer to * @param amount uint256 The amount of tokens to be transferred * @return true unless throwing */ function transferFromAndCall(address sender, address recipient, uint256 amount) external returns (bool); /** * @notice Transfer tokens from one address to another and then call `onTransferReceived` on receiver * @param sender address The address which you want to send tokens from * @param recipient address The address which you want to transfer to * @param amount uint256 The amount of tokens to be transferred * @param data bytes Additional data with no specified format, sent in call to `recipient` * @return true unless throwing */ function transferFromAndCall(address sender, address recipient, uint256 amount, bytes calldata data) external returns (bool); /** * @notice Approve the passed address to spend the specified amount of tokens on behalf of msg.sender * and then call `onApprovalReceived` on spender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender address The address which will spend the funds * @param amount uint256 The amount of tokens to be spent */ function approveAndCall(address spender, uint256 amount) external returns (bool); /** * @notice Approve the passed address to spend the specified amount of tokens on behalf of msg.sender * and then call `onApprovalReceived` on spender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender address The address which will spend the funds * @param amount uint256 The amount of tokens to be spent * @param data bytes Additional data with no specified format, sent in call to `spender` */ function approveAndCall(address spender, uint256 amount, bytes calldata data) external returns (bool); }
2,150
57
// Approve the passed address to spend the specified amount of value on behalf ofmsg.sender. This method is included for ERC20 compatibility.increaseAllowance and decreaseAllowance should be used instead.Changing an allowance with this method brings the risk that someone may transfer boththe old and the new allowance - if they are both greater than zero - if a transfertransaction is mined before the later approve() call is mined.spender The address which will spend the funds. value The amount of value to be spent. /
function approve(address spender, uint256 value) external returns (bool) { info.users[msg.sender].allowance[spender] = value; emit Approval(msg.sender, spender, value); return true; }
function approve(address spender, uint256 value) external returns (bool) { info.users[msg.sender].allowance[spender] = value; emit Approval(msg.sender, spender, value); return true; }
63,210
2
// Access control for tax
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(NOT_TAXED_FROM, msg.sender); _grantRole(NOT_TAXED_TO, msg.sender); _grantRole(NOT_TAXED_FROM, address(this)); _grantRole(NOT_TAXED_TO, address(this));
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(NOT_TAXED_FROM, msg.sender); _grantRole(NOT_TAXED_TO, msg.sender); _grantRole(NOT_TAXED_FROM, address(this)); _grantRole(NOT_TAXED_TO, address(this));
17,970
30
// mitigates the ERC20 spend/approval race condition
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
26,786
145
// withdraw from our Curve pool
ICurveFi curve = ICurveFi(_vault.token()); // our curve pool is the underlying token for our vault uint256 _poolBalance = curve.balanceOf(address(this)); curve.remove_liquidity_one_coin(_poolBalance, 1, 0);
ICurveFi curve = ICurveFi(_vault.token()); // our curve pool is the underlying token for our vault uint256 _poolBalance = curve.balanceOf(address(this)); curve.remove_liquidity_one_coin(_poolBalance, 1, 0);
60,137
16
// Address of Uniswap Factory
function factoryAddress() external view returns (address factory);
function factoryAddress() external view returns (address factory);
15,522
123
// allows execution only on a multiple-reserve converter
modifier multipleReservesOnly { require(reserveTokens.length > 1); _; }
modifier multipleReservesOnly { require(reserveTokens.length > 1); _; }
6,987
79
// withdraw token link or trapped tokens
function withdrawToken(address _address, uint256 amount) external onlyOwner { // Ensure requested tokens isn't Jackpot token (cannot withdraw the pot) require(_address != JACKPOT_TOKEN_ADDRESS, "Cannot withdraw Lottery pot"); require(_address != address(this), "Cannot withdraw platform token"); IERC20 token = IERC20(_address); token.transfer(msg.sender, amount); }
function withdrawToken(address _address, uint256 amount) external onlyOwner { // Ensure requested tokens isn't Jackpot token (cannot withdraw the pot) require(_address != JACKPOT_TOKEN_ADDRESS, "Cannot withdraw Lottery pot"); require(_address != address(this), "Cannot withdraw platform token"); IERC20 token = IERC20(_address); token.transfer(msg.sender, amount); }
30,464
2
// Whether it is initialized
bool public isInitialized;
bool public isInitialized;
14,750
523
// Mint aTokens
address aTokenAddress = reserveAToken[asset]; ATokenMock aToken = ATokenMock(aTokenAddress); aToken.mint(onBehalfOf, amount);
address aTokenAddress = reserveAToken[asset]; ATokenMock aToken = ATokenMock(aTokenAddress); aToken.mint(onBehalfOf, amount);
21,201
9
// Returns status code of latest update request posted to the Witnet Request Board:/Status codes:/- 200: update request was succesfully solved with no errors/- 400: update request was solved with errors/- 404: update request was not solved yet
function latestUpdateStatus() external view returns (uint256);
function latestUpdateStatus() external view returns (uint256);
3,853
5
// Returns the state and configuration of the reserve asset The address of the underlying asset of the reservereturn The state of the reserve // Validates and finalizes an aToken transfer- Only callable by the overlying aToken of the `asset`- Caller is only aToken contract which is storing the underlying asset of depositors asset The address of the underlying asset of the aToken from The user from which the aTokens are transferred to The user receiving the aTokens amount The amount being transferred/withdrawn balanceFromAfter The aToken balance of the `from` user before the transfer balanceToBefore The aToken balance of the `to`
function finalizeTransfer( address asset,
function finalizeTransfer( address asset,
8,962
1
// declaring the receive() function that is executed when sending ETH to the contract address it was introduced in Solidity 0.6 and a contract can have only one receive function,declared with this syntax (without the function keyword and without arguments).
receive() external payable{ }
receive() external payable{ }
15,724
165
// Exposes the public data point in an ERC2362 compliant way.Returns error `400` if queried for an unknown data point, and `404` if `completeUpdate` has never been called successfully before./
function valueFor(bytes32 _id) external view override returns(int256, uint256, uint256) { // Unsupported data point ID if(_id != BTCUSD3ID) return(0, 0, 400); // No value is yet available for the queried data point ID if (timestamp == 0) return(0, 0, 404); int256 value = int256(uint256(lastPrice)); return(value, timestamp, 200); }
function valueFor(bytes32 _id) external view override returns(int256, uint256, uint256) { // Unsupported data point ID if(_id != BTCUSD3ID) return(0, 0, 400); // No value is yet available for the queried data point ID if (timestamp == 0) return(0, 0, 404); int256 value = int256(uint256(lastPrice)); return(value, timestamp, 200); }
27,404
395
// Timestamp of last timelock proposal
uint256 public timeLockProposalTime;
uint256 public timeLockProposalTime;
47,123
7
// delete track from playlist /
{ bytes32 signatureDigest = generateDeletePlaylistTrackSchemaHash( _playlistId, _deletedTrackId, _deletedTrackTimestamp, _nonce ); address signer = recoverSigner(signatureDigest, _subjectSig); burnSignatureDigest(signatureDigest, signer); this.callerOwnsPlaylist(signer, _playlistId); // will revert if false bool isValidTrack = this.isTrackInPlaylist(_playlistId, _deletedTrackId); require(isValidTrack == true, "Expect valid track for delete operation"); PlaylistStorageInterface( registry.getContract(playlistStorageRegistryKey) ).deletePlaylistTrack(_playlistId, _deletedTrackId); emit PlaylistTrackDeleted(_playlistId, _deletedTrackId, _deletedTrackTimestamp); }
{ bytes32 signatureDigest = generateDeletePlaylistTrackSchemaHash( _playlistId, _deletedTrackId, _deletedTrackTimestamp, _nonce ); address signer = recoverSigner(signatureDigest, _subjectSig); burnSignatureDigest(signatureDigest, signer); this.callerOwnsPlaylist(signer, _playlistId); // will revert if false bool isValidTrack = this.isTrackInPlaylist(_playlistId, _deletedTrackId); require(isValidTrack == true, "Expect valid track for delete operation"); PlaylistStorageInterface( registry.getContract(playlistStorageRegistryKey) ).deletePlaylistTrack(_playlistId, _deletedTrackId); emit PlaylistTrackDeleted(_playlistId, _deletedTrackId, _deletedTrackTimestamp); }
13,754
9
// Add address to list of airdrop addresses /
function addAirdrop(address[] storage list, address _address) private { uint256 i = 0; for (i = 0; i < list.length; i++) { if (list[i] == address(0)) { list[i] = _address; break; } } if (i == list.length) { list.push(_address); } }
function addAirdrop(address[] storage list, address _address) private { uint256 i = 0; for (i = 0; i < list.length; i++) { if (list[i] == address(0)) { list[i] = _address; break; } } if (i == list.length) { list.push(_address); } }
782
1
// the constructor sets the original owner of the contract to the sender account. /
constructor() { setUpgradeabilityOwner(msg.sender); }
constructor() { setUpgradeabilityOwner(msg.sender); }
9,065
0
// called once by the factory at the time of deployment
function _initialize( string calldata _name, string calldata _symbol, address _underlying, address _borrowable0, address _borrowable1
function _initialize( string calldata _name, string calldata _symbol, address _underlying, address _borrowable0, address _borrowable1
25,601
17
// Reverts with a revert reason containing `errorCode`. Only codes up to 999 are supported.Uses the default 'BAL' prefix for the error code /
function _revert(uint256 errorCode) pure { _revert(errorCode, 0x42414c); // This is the raw byte representation of "BAL" }
function _revert(uint256 errorCode) pure { _revert(errorCode, 0x42414c); // This is the raw byte representation of "BAL" }
29,099
71
// public functions /
function getLiquidityReleaseTimeInSeconds() public view returns (uint){ if(block.timestamp<_liquidityUnlockTime) return _liquidityUnlockTime-block.timestamp; return 0; }
function getLiquidityReleaseTimeInSeconds() public view returns (uint){ if(block.timestamp<_liquidityUnlockTime) return _liquidityUnlockTime-block.timestamp; return 0; }
43,599
0
// _premia The premia token
constructor(IERC20 _premia) ERC20("PremiaStaking", "xPREMIA") { premia = _premia; }
constructor(IERC20 _premia) ERC20("PremiaStaking", "xPREMIA") { premia = _premia; }
47,324
10
// Multiplies two unsigned integers, reverts on overflow. /
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; }
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; }
567
90
// Allows Blocksport to cancel an auction, refunding the bidder and returning the NFT to the seller.This should only be used for extreme cases such as DMCA takedown requests. The reason should always be provided. /
function _adminCancelReserveAuction(uint256 auctionId, string memory reason) private onlyBlocksportAdmin
function _adminCancelReserveAuction(uint256 auctionId, string memory reason) private onlyBlocksportAdmin
42,097
321
// Only 20 Pantheon Cards can be purchased per transaction.
uint256 public constant maxNumPurchase = 20;
uint256 public constant maxNumPurchase = 20;
61,709
10
// perform safe mint and stake /
function _safemintAndStake(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; for (uint256 i = 0; i < quantity; i++) { startTokenId++; tokenToIsStaked[startTokenId] = true; } _safeMint(to, quantity, ""); }
function _safemintAndStake(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; for (uint256 i = 0; i < quantity; i++) { startTokenId++; tokenToIsStaked[startTokenId] = true; } _safeMint(to, quantity, ""); }
37,910
78
// The timestamp when Reward mining starts.
uint256 public startTimestamp;
uint256 public startTimestamp;
12,179
38
// Trigger the reentrancy lock for `versionedHash`
reentrancyLocks[versionedHash] = true; if (_isOtherMessenger()) {
reentrancyLocks[versionedHash] = true; if (_isOtherMessenger()) {
2,233
5
// event for logging successful verification
event verificationSuccess(); // emits when signature is successfully verified
event verificationSuccess(); // emits when signature is successfully verified
4,476
59
// Overload of {ECDSA-recover} that receives the `v`,`r` and `s` signature fields separately. /
function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; }
function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; }
6,869
1
// ======== Immutable storage =========
address public immutable logic; address public immutable partyDAOMultisig; address public immutable tokenVaultFactory; address public immutable weth;
address public immutable logic; address public immutable partyDAOMultisig; address public immutable tokenVaultFactory; address public immutable weth;
5,306
11
// Bilateral EAF2 / LSM liquidity partition
Pmt pmt = payments[gridlockQueue[j]]; GridlockedPmt g_pmt = globalGridlockQueue[pmt.txRef];
Pmt pmt = payments[gridlockQueue[j]]; GridlockedPmt g_pmt = globalGridlockQueue[pmt.txRef];
38,158
124
// Address already added to whitelist.
if (preSaleAllowed[_address]) throw; preSaleWhitelist.push(_address); preSaleAllowed[_address] = true;
if (preSaleAllowed[_address]) throw; preSaleWhitelist.push(_address); preSaleAllowed[_address] = true;
38,688
1
// Flag indicating pool type, true means "flash pool" solhint-disable-next-line
bool public constant override isFlashPool = true;
bool public constant override isFlashPool = true;
30,242
61
// Emitted when the reward receiver is updated.//rewardReceiver The reward receiver.
event RewardReceiverUpdated(address rewardReceiver);
event RewardReceiverUpdated(address rewardReceiver);
81,803
8
// Voting function
function vote(uint candidateId, uint _electionID) public{ uint voterNumber; for(uint i=0;i<Elections[_electionID].voterCount;i++){ if(Elections[_electionID].Election_Voters[i].voterAddress == msg.sender){ voterNumber = i; } } require(Elections[_electionID].Election_Voters[voterNumber].hasVoted == false); // require that voter hasn't voted already. require(Elections[_electionID].Election_Voters[voterNumber].isVerified == true); // require that voter is verified. require(Elections[_electionID].start == true); // require that the voting process has started require(Elections[_electionID].end == false); // and has not ended yet Elections[_electionID].Election_Candidates[candidateId].voteCount += 1; Elections[_electionID].Election_Voters[voterNumber].hasVoted = true; }
function vote(uint candidateId, uint _electionID) public{ uint voterNumber; for(uint i=0;i<Elections[_electionID].voterCount;i++){ if(Elections[_electionID].Election_Voters[i].voterAddress == msg.sender){ voterNumber = i; } } require(Elections[_electionID].Election_Voters[voterNumber].hasVoted == false); // require that voter hasn't voted already. require(Elections[_electionID].Election_Voters[voterNumber].isVerified == true); // require that voter is verified. require(Elections[_electionID].start == true); // require that the voting process has started require(Elections[_electionID].end == false); // and has not ended yet Elections[_electionID].Election_Candidates[candidateId].voteCount += 1; Elections[_electionID].Election_Voters[voterNumber].hasVoted = true; }
23,188
7
// get a wallet address by the account address and the index
function isExisted(address _wallet) external view returns (bool);
function isExisted(address _wallet) external view returns (bool);
36,046
6
// computes uniswapV2 pair address/token0 address of first token in pair/token1 address of second token in pair/ return address of pair
function getUniswapV2PairAddress(address token0, address token1) external pure returns (address)
function getUniswapV2PairAddress(address token0, address token1) external pure returns (address)
34,689
25
// Total amount of tokens in with a given id./
// function totalSupply(uint256 id) public view virtual returns (uint256) { // return _totalSupply[id]; // }
// function totalSupply(uint256 id) public view virtual returns (uint256) { // return _totalSupply[id]; // }
48,928
30
// returns the total levels of phoenixs a user has, used by the blaze contract to calculate token generation rate_userAddress is the address in question/
function getTotalLevels(address _userAddress) external view returns(uint) { return addressToLevels[_userAddress]; }
function getTotalLevels(address _userAddress) external view returns(uint) { return addressToLevels[_userAddress]; }
11,052
70
// called by the owner to pause, triggers stopped state /
function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); }
function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); }
13,629
1
// Creator of the contract is admin during initialization
admin = payable(msg.sender); initialize(comptroller_, interestRateModel_, initialExchangeRateMantissa_, name_, symbol_, decimals_, collectionAddress_, collectionName_, collectionSymbol_);
admin = payable(msg.sender); initialize(comptroller_, interestRateModel_, initialExchangeRateMantissa_, name_, symbol_, decimals_, collectionAddress_, collectionName_, collectionSymbol_);
17,230
48
// GOVERNANCE FUNCTION: Edit an existing operation on the registry _kind Operation kind_operationAddress of the operation contract to set /
function setOperation(uint8 _kind, address _operation) public override onlyGovernanceOrEmergency { require(_kind < MAX_OPERATIONS, 'Max operations reached'); require(enabledOperations[_kind] != _operation, 'Operation already set'); require(_operation != address(0), 'Operation address must exist.'); enabledOperations[_kind] = _operation; emit ControllerOperationSet(_kind, _operation); }
function setOperation(uint8 _kind, address _operation) public override onlyGovernanceOrEmergency { require(_kind < MAX_OPERATIONS, 'Max operations reached'); require(enabledOperations[_kind] != _operation, 'Operation already set'); require(_operation != address(0), 'Operation address must exist.'); enabledOperations[_kind] = _operation; emit ControllerOperationSet(_kind, _operation); }
23,573
45
// Allows an owner to submit and confirm a transaction via meta transaction. signer Signer of the meta transaction.transactionIdTransaction ID of this transaction.destinationTransaction target address.valueTransaction ether value.data Transaction data payload.sigSignature.returnTransaction ID. /
function submitTransaction( address signer, uint256 transactionId, address destination, uint256 value, bytes memory data, bytes memory sig ) public ownerExists(signer)
function submitTransaction( address signer, uint256 transactionId, address destination, uint256 value, bytes memory data, bytes memory sig ) public ownerExists(signer)
12,427
12
// The tier mint unlock timestamps.
TIER_ZERO_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[0]; TIER_ONE_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[1]; TIER_TWO_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[2];
TIER_ZERO_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[0]; TIER_ONE_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[1]; TIER_TWO_MINTS_UNLOCK_TIMESTAMP = mintTierTimestamps[2];
15,309
18
// Verify signature
assert(verifyBidSignature(signed.bid.nft, signed.bid.bidderAddress, signed.bid.currencyTokenAddress, signed.bid.currencyTokenAmount, signed.sig));
assert(verifyBidSignature(signed.bid.nft, signed.bid.bidderAddress, signed.bid.currencyTokenAddress, signed.bid.currencyTokenAmount, signed.sig));
31,616
1
// The underlying MSD. /
address public underlying;
address public underlying;
25,267
32
// Reserve mint without actually minting, cheap gas, helps resolve gas war issuesnumSlots the number of mint slots to reserve/
function reserveSlot(uint16 numSlots) public payable
function reserveSlot(uint16 numSlots) public payable
18,971
14
// Setup contracts
IERC20 _fromIERC20 = IERC20(token);
IERC20 _fromIERC20 = IERC20(token);
223
148
// Burn `amount` LToken of `account` Can only be called by pool`account` cannot be zero address`account` must owns at least `amount` LToken /
function burn(address account, uint256 amount) external;
function burn(address account, uint256 amount) external;
76,211
168
// Function to enable transfers. /
function enableTransfer() public onlyOwner { _transferEnabled = true; emit TransferEnabled(); }
function enableTransfer() public onlyOwner { _transferEnabled = true; emit TransferEnabled(); }
8,400
78
// Only allow the contract to interact with it.
modifier onlyFromNoundles() { require(msg.sender == address(Noundles)); _; }
modifier onlyFromNoundles() { require(msg.sender == address(Noundles)); _; }
6,568
29
// Allows to replace a signer with a new one. Transaction has to be sent by wallet./_previousSigner Address of the signer to be replaced./_newSigner Address of a new signer.
function replaceSigner(address _previousSigner, address _newSigner) external onlyMultisig isAllowedSigner(_previousSigner) isNotSigner(_newSigner)
function replaceSigner(address _previousSigner, address _newSigner) external onlyMultisig isAllowedSigner(_previousSigner) isNotSigner(_newSigner)
3,039
37
// Standard ERC20 tokenImplementation of the basic standard token.Originally based on code by FirstBlood: This implementation emits additional Approval events, allowing applications to reconstruct the allowance status forall accounts just by listening to said events. Note that this isn't required by the specification, and othercompliant implementations may not do it. /
contract ERC20 is Initializable, IERC20 { using SafeMath for uint256; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowed; uint256 internal _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add( addedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub( subtractedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer( address from, address to, uint256 value ) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } uint256[50] private ______gap; }
contract ERC20 is Initializable, IERC20 { using SafeMath for uint256; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowed; uint256 internal _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add( addedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub( subtractedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer( address from, address to, uint256 value ) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } uint256[50] private ______gap; }
6,936
13
// vote power 門檻
struct ProposalVotePowerTokenThreshold{ uint256 level1; uint256 level2; uint256 level3; uint256 level4; uint256 level5; }
struct ProposalVotePowerTokenThreshold{ uint256 level1; uint256 level2; uint256 level3; uint256 level4; uint256 level5; }
15,020
30
// sets the _artisticName hash as a unique inside the NFTLatinoAmerica Collection
name_unique[name_hash].unique = true;
name_unique[name_hash].unique = true;
11,440
3
// if not eth send directly to user
ILendingPoolV2(lendingPool).withdraw(_tokenAddr, _amount, msg.sender);
ILendingPoolV2(lendingPool).withdraw(_tokenAddr, _amount, msg.sender);
1,524
171
// The function for token minting. It creates a new token. Can be called only by the contract owner./ Must contain the signature of the format: `sha3(tokenContract.address.toLowerCase() + tokenId)`./ Where `tokenContract.address` is the address of the contract and tokenId is the id in uint256 hex format./ 0 as uint256 must look like this: `0000000000000000000000000000000000000000000000000000000000000000`./ The message must not contain the standard prefix./id - The id of a new token (`tokenId`)./v - v parameter of the ECDSA signature./r - r parameter of the ECDSA signature./s - s parameter of the ECDSA signature./fees - An array of the secondary fees for this token./supply
function mint(uint256 id, uint8 v, bytes32 r, bytes32 s, Fee[] memory fees, uint256 supply, string memory uri) public { super.mint(id, v, r, s, fees, supply, uri); }
function mint(uint256 id, uint8 v, bytes32 r, bytes32 s, Fee[] memory fees, uint256 supply, string memory uri) public { super.mint(id, v, r, s, fees, supply, uri); }
51,725
16
// Get state of a particular instance/_index index of instance/_user address of user/ return bool if user is eligible to produce next block/ return address of user that was chosen to build the block/ return current reward paid by the network for that block/ return percentage of reward that goes to the user
function getState(uint256 _index, address _user) public view returns ( bool, address, uint256, uint256 )
function getState(uint256 _index, address _user) public view returns ( bool, address, uint256, uint256 )
36,062
181
// Get the owner of the deed to be auctioned
address deedOwner = deedContract.ownerOf(_deedId);
address deedOwner = deedContract.ownerOf(_deedId);
29,500
149
// return the fee factor minus the number of weeks since sale10.SellFeeIncreaseFactor is immutable at 120 so the most this can subtract is 610 = 120 - 60 = 60%
return sellFeeIncreaseFactor-(timeSinceLastSale.mul(10));
return sellFeeIncreaseFactor-(timeSinceLastSale.mul(10));
25,698
5
// Returns the timestamps of each payout. Beacause a month can have different numberof days, months are represented as 30 day period in contract. /
function getTimestamps() public view returns (uint256[] memory) { uint256[] memory timestamps = new uint256[](_months.length); for (uint256 i = 0; i<_months.length; i++) { uint256 timestamp = _ieoEndTime + _months[i] * _daysInMonth; timestamps[i] = timestamp; } return timestamps; }
function getTimestamps() public view returns (uint256[] memory) { uint256[] memory timestamps = new uint256[](_months.length); for (uint256 i = 0; i<_months.length; i++) { uint256 timestamp = _ieoEndTime + _months[i] * _daysInMonth; timestamps[i] = timestamp; } return timestamps; }
44,656
214
// SelfDestructible (Ownable)
address _owner,
address _owner,
79,754
4
// fees rate /
function feesRate(bytes4 _method) external override view returns (uint256) { return feesRates[_method]; }
function feesRate(bytes4 _method) external override view returns (uint256) { return feesRates[_method]; }
3,804
16
// Returns the timestamp at with an operation becomes ready (0 forunset operations, 1 for done operations). /
function getTimestamp(bytes32 id) public view virtual returns (uint256 timestamp) { return _timestamps[id]; }
function getTimestamp(bytes32 id) public view virtual returns (uint256 timestamp) { return _timestamps[id]; }
2,329
20
// Contracts that should not own Ether Remco Bloemen <remco@2π.com> This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end upin the contract, it will allow the owner to reclaim this ether. Ether can still be send to this contract by:calling functions labeled `payable``selfdestruct(contract_address)`mining directly to the contract address/
contract HasNoEther is Ownable { /** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this way we prevent a payable constructor from working. Alternatively * we could use assembly to access msg.value. */ function HasNoEther() payable { require(msg.value == 0); } /** * @dev Disallows direct send by settings a default function without the `payable` flag. */ function() external { } /** * @dev Transfer all Ether held by the contract to the owner. */ function reclaimEther() external onlyOwner { assert(owner.send(this.balance)); } }
contract HasNoEther is Ownable { /** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this way we prevent a payable constructor from working. Alternatively * we could use assembly to access msg.value. */ function HasNoEther() payable { require(msg.value == 0); } /** * @dev Disallows direct send by settings a default function without the `payable` flag. */ function() external { } /** * @dev Transfer all Ether held by the contract to the owner. */ function reclaimEther() external onlyOwner { assert(owner.send(this.balance)); } }
11,364
2
// modifier to check if caller is owner
modifier isOwner() { // If the first argument of 'require' evaluates to 'false', execution terminates and all // changes to the state and to Ether balances are reverted. // This used to consume all gas in old EVM versions, but not anymore. // It is often a good idea to use 'require' to check if functions are called correctly. // As a second argument, you can also provide an explanation about what went wrong. require(msg.sender == owner, "Caller is not owner"); _; }
modifier isOwner() { // If the first argument of 'require' evaluates to 'false', execution terminates and all // changes to the state and to Ether balances are reverted. // This used to consume all gas in old EVM versions, but not anymore. // It is often a good idea to use 'require' to check if functions are called correctly. // As a second argument, you can also provide an explanation about what went wrong. require(msg.sender == owner, "Caller is not owner"); _; }
8,455
14
// Populate `clothingList` with fast food hat
clothingList.push(hatSVG);
clothingList.push(hatSVG);
26,257
90
// amount of raised money in wei
uint256 public weiRaised;
uint256 public weiRaised;
20,097
3
// Modifier to use in the migration of a contract. contractName Name of the contract. requiredMigrationId Identifier of the previous migration, requiredto apply new one. newMigrationId Identifier of the new migration to be applied. /
modifier isMigration(string contractName, string requiredMigrationId, string newMigrationId) { require(isMigrated(contractName, requiredMigrationId) && !isMigrated(contractName, newMigrationId)); _; emit Migrated(contractName, newMigrationId); migrated[contractName][newMigrationId] = true; }
modifier isMigration(string contractName, string requiredMigrationId, string newMigrationId) { require(isMigrated(contractName, requiredMigrationId) && !isMigrated(contractName, newMigrationId)); _; emit Migrated(contractName, newMigrationId); migrated[contractName][newMigrationId] = true; }
21,567
30
// Execute the call based on the selector.
state.selector = mtx.callData.readBytes4(0); if (state.selector == ITransformERC20.transformERC20.selector) { returnResult = _executeTransformERC20Call(state); } else {
state.selector = mtx.callData.readBytes4(0); if (state.selector == ITransformERC20.transformERC20.selector) { returnResult = _executeTransformERC20Call(state); } else {
33,721
24
// Claim rewards before withdrawing, since rewards calculation will fail if total supply is 0 after withdrawing
_claim(msg.sender); for (uint i = 0; i < numEntries; i++) { uint qty = getVestingQuantity(msg.sender, i); uint numberOfTokens = getVestingTokenAmount(msg.sender, i); uint time = getVestingTime(msg.sender, i); if (qty > 0 && time <= block.timestamp) {
_claim(msg.sender); for (uint i = 0; i < numEntries; i++) { uint qty = getVestingQuantity(msg.sender, i); uint numberOfTokens = getVestingTokenAmount(msg.sender, i); uint time = getVestingTime(msg.sender, i); if (qty > 0 && time <= block.timestamp) {
48,261
72
// Remove a Loopring protocol address./addr A loopring protocol address.
function deauthorizeAddress(address addr) onlyOwner external
function deauthorizeAddress(address addr) onlyOwner external
73,194
160
// The initial number of FAIR created at initialization for the beneficiary./ Technically however, this variable is not a constant as we must always have/`init_reserve>=total_supply+burnt_supply` which means that `init_reserve` will be automatically/ decreased to equal `total_supply+burnt_supply` in case `init_reserve>total_supply+burnt_supply`/ after an investor sells his FAIRs./Organizations may move these tokens into vesting contract(s)
uint public initReserve;
uint public initReserve;
5,134
236
// transfer vested tokens
require(amountToRelease > 0); ERC20 token = ERC20(TokenAddress); token.transfer(_adr, amountToRelease);
require(amountToRelease > 0); ERC20 token = ERC20(TokenAddress); token.transfer(_adr, amountToRelease);
38,621
149
// perform an operation: write value requested into the storage
transferAllowances[msg.sender][_spender] = _value;
transferAllowances[msg.sender][_spender] = _value;
50,558
398
// Returns the account that created a given proposal. /
function proposalProposer( uint256 proposalId
function proposalProposer( uint256 proposalId
27,309
28
// mints the boosters can only be called by owner. could be a smart contract
function mintBooster(address _owner, uint32 _duration, uint8 _type, uint8 _strength, uint32 _amount, uint24 _raiseValue) onlyChest public { boosters.length ++; Booster storage tempBooster = boosters[boosters.length - 1]; tempBooster.owner = _owner; tempBooster.duration = _duration; tempBooster.boosterType = _type; tempBooster.strength = _strength; tempBooster.amount = _amount; tempBooster.raiseValue = _raiseValue; Transfer(address(0), _owner, boosters.length - 1); }
function mintBooster(address _owner, uint32 _duration, uint8 _type, uint8 _strength, uint32 _amount, uint24 _raiseValue) onlyChest public { boosters.length ++; Booster storage tempBooster = boosters[boosters.length - 1]; tempBooster.owner = _owner; tempBooster.duration = _duration; tempBooster.boosterType = _type; tempBooster.strength = _strength; tempBooster.amount = _amount; tempBooster.raiseValue = _raiseValue; Transfer(address(0), _owner, boosters.length - 1); }
25,705
45
// internal function to update delegated votes, emits event with changes/_delegate the delegate whose record we are updating/_delegator the delegator/_oldVotes the delegate previous votes/_newVotes the delegate votes after the change
function _updateDelegateVotes( address _delegate, address _delegator, uint256 _oldVotes, uint256 _newVotes
function _updateDelegateVotes( address _delegate, address _delegator, uint256 _oldVotes, uint256 _newVotes
39,604