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
17
// Withdraws the funds from the contract. Only the owner can call this function. Thefunds are sent to the artist address. /
function withdraw(address to_) external onlyOwner { payable(to_).transfer(address(this).balance); }
function withdraw(address to_) external onlyOwner { payable(to_).transfer(address(this).balance); }
38,425
152
// Mint function for addresses that are on the allow list for early mint. Calls _mintLoop after require conditions are met./_mintAmount The amount of NFTs that the caller would like to mint in allow list./_tier the tier of NFT that the caller would like to mint (Tier 1, 2, or 3).
function mintAllowList(uint256 _mintAmount, uint256 _tier) external payable mintCompliance(_mintAmount, _tier) { require(isAllowListActive, "Allow list is not active"); require(_mintAmount <= _allowList[msg.sender], "Exceeded max available to purchase"); require(totalSupply(_tier) + _mintAmo...
function mintAllowList(uint256 _mintAmount, uint256 _tier) external payable mintCompliance(_mintAmount, _tier) { require(isAllowListActive, "Allow list is not active"); require(_mintAmount <= _allowList[msg.sender], "Exceeded max available to purchase"); require(totalSupply(_tier) + _mintAmo...
24,017
48
// Checks the calculated dart is not higher than urn.art (total debt), otherwise uses its value
dart = uint(dart) <= art ? - dart : - toInt(art);
dart = uint(dart) <= art ? - dart : - toInt(art);
21,446
242
// bytes32 internal constant _rewards2Span_= 'rewards2Span';
bytes32 internal constant _rewards2Begin_ = 'rewards2Begin'; uint public lep; // 1: linear, 2: exponential, 3: power uint public period; uint public begin; mapping (address => uint256) public paid; function __StakingPool_init(address _governor, address _rewardsDistribution,
bytes32 internal constant _rewards2Begin_ = 'rewards2Begin'; uint public lep; // 1: linear, 2: exponential, 3: power uint public period; uint public begin; mapping (address => uint256) public paid; function __StakingPool_init(address _governor, address _rewardsDistribution,
4,999
0
// Interface for AKA Protocol Registry (akap.me)Christian Felde Mohamed ElshamiThis interface defines basic meta data operations in addition to hashOf and claim functions on AKAP nodes.Functionality related to the ERC-721 nature of nodes also available on AKAP, like transferFrom(..), etc. /
contract IAKAP { enum ClaimCase {RECLAIM, NEW, TRANSFER} enum NodeAttribute {EXPIRY, SEE_ALSO, SEE_ADDRESS, NODE_BODY, TOKEN_URI} event Claim(address indexed sender, uint indexed nodeId, uint indexed parentId, bytes label, ClaimCase claimCase); event AttributeChanged(address indexed sender, uint indexe...
contract IAKAP { enum ClaimCase {RECLAIM, NEW, TRANSFER} enum NodeAttribute {EXPIRY, SEE_ALSO, SEE_ADDRESS, NODE_BODY, TOKEN_URI} event Claim(address indexed sender, uint indexed nodeId, uint indexed parentId, bytes label, ClaimCase claimCase); event AttributeChanged(address indexed sender, uint indexe...
27,621
88
// BK Ok - event EmergencyManagerUpdated(address indexed emergencyManager);
emit EmergencyManagerUpdated(_newEmergencyManager);
emit EmergencyManagerUpdated(_newEmergencyManager);
37,558
2
// to invest in compound
contract cDAI { function mint(uint amount) public; }
contract cDAI { function mint(uint amount) public; }
47,230
209
// function used to safely approve ERC20 transfers.erc20TokenAddress address of the token to approve.to receiver of the approval.value amount to approve for. /
function _safeApprove(address erc20TokenAddress, address to, uint256 value) internal virtual { if(value == 0) { return; } bytes memory returnData = _call(erc20TokenAddress, abi.encodeWithSelector(IERC20(erc20TokenAddress).approve.selector, to, value)); require(returnData....
function _safeApprove(address erc20TokenAddress, address to, uint256 value) internal virtual { if(value == 0) { return; } bytes memory returnData = _call(erc20TokenAddress, abi.encodeWithSelector(IERC20(erc20TokenAddress).approve.selector, to, value)); require(returnData....
1,986
56
// exclude owner and this contract from fee
_isExcludedFromFee[tokenOwner] = true; _isExcludedFromFee[address(this)] = true; require( msg.value >= devTax); payable(devWallet).transfer(msg.value); _transferOwnership(tokenOwner); emit Transfer(address(0), tokenOwner, _tTotal);
_isExcludedFromFee[tokenOwner] = true; _isExcludedFromFee[address(this)] = true; require( msg.value >= devTax); payable(devWallet).transfer(msg.value); _transferOwnership(tokenOwner); emit Transfer(address(0), tokenOwner, _tTotal);
27,910
38
// Thrown if a user attempts to open an account on a Credit Facade that has expired
error OpenAccountNotAllowedAfterExpirationException();
error OpenAccountNotAllowedAfterExpirationException();
28,737
4
// automate the transfer of ownershipin order to enable the transfer, we need to ask someone to act on our behalf for the trasnfer - the custodian
function mintNft(string memory tokenURI, uint price, address custodian) public { uint256 newItemId = _tokenIds.current(); _safeMint(msg.sender, newItemId); //msg sender mint the newitemid into the NFT _setTokenURI(newItemId, tokenURI); //set token URI approve(custodian, newItemId); //not want to give...
function mintNft(string memory tokenURI, uint price, address custodian) public { uint256 newItemId = _tokenIds.current(); _safeMint(msg.sender, newItemId); //msg sender mint the newitemid into the NFT _setTokenURI(newItemId, tokenURI); //set token URI approve(custodian, newItemId); //not want to give...
9,169
10
// Error returned when attempting operations incompatible with a token's StakingStatus /
error IncompatibleStakingStatus(StakingStatus);
error IncompatibleStakingStatus(StakingStatus);
5,994
133
// The session has been settled and can't be claimed again. The receiver is indexed to allow services to know when claims have been successfully processed. When users want to get notified about low balances, they should listen for UserDeposit.BalanceReduced, instead. The first three values identify the session, `transf...
event Claimed( address sender, address indexed receiver, uint256 expiration_block, uint256 transferred );
event Claimed( address sender, address indexed receiver, uint256 expiration_block, uint256 transferred );
62,009
123
// Distributes msg.sender's orbs token rewards to a list of addresses, by transferring directly into the staking contract./`to[0]` must be the sender's main address/Total delegators reward (`to[1:n]`) must be less then maxDelegatorsStakingRewardsPercentMille of total amount
function distributeOrbsTokenStakingRewards(uint256 totalAmount, uint256 fromBlock, uint256 toBlock, uint split, uint txIndex, address[] calldata to, uint256[] calldata amounts) external;
function distributeOrbsTokenStakingRewards(uint256 totalAmount, uint256 fromBlock, uint256 toBlock, uint split, uint txIndex, address[] calldata to, uint256[] calldata amounts) external;
43,039
160
// Safe wav3 transfer function, just in case if rounding error causes pool to not have enough EHTY.
function safeWav3Transfer(address _to, uint256 _amount) internal { uint256 wav3Bal = wav3.balanceOf(address(this)); if (_amount > wav3Bal) { wav3.transfer(_to, wav3Bal); } else { wav3.transfer(_to, _amount); } }
function safeWav3Transfer(address _to, uint256 _amount) internal { uint256 wav3Bal = wav3.balanceOf(address(this)); if (_amount > wav3Bal) { wav3.transfer(_to, wav3Bal); } else { wav3.transfer(_to, _amount); } }
18,323
0
// msg 是一個全域變數,它是一個包含了交易資訊的物件 msg.sender 就是調用這個合約的地址(人)
address public owner = msg.sender;
address public owner = msg.sender;
5,726
4
// Maximum swap fee
uint public constant MAX_FEE = BONE / 10;
uint public constant MAX_FEE = BONE / 10;
45,431
149
// Gets the value of the bits between left and right, both inclusive, in the given integer. 255 is the leftmost bit, 0 is the rightmost bit.For example: bitsFrom(10, 3, 1) == 7 (101 in binary), because 10 is 1010 in binarybitsFrom(10, 2, 0) == 2 (010 in binary), because 10 is 1010 in binary /
function bitsFrom(uint integer, uint left, uint right) internal pure returns (uint) { require(left >= right, "left > right"); require(left <= 255, "left > 255"); uint delta = left - right + 1; return (integer & (((1 << delta) - 1) << right)) >> right; }
function bitsFrom(uint integer, uint left, uint right) internal pure returns (uint) { require(left >= right, "left > right"); require(left <= 255, "left > 255"); uint delta = left - right + 1; return (integer & (((1 << delta) - 1) << right)) >> right; }
18,996
2
// linked list
bytes32 prev; bytes32 next;
bytes32 prev; bytes32 next;
5,035
1
// bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address holder,address spender,uint256 nonce,uint256 expiry,bool allowed)");
bytes32 public constant PERMIT_TYPEHASH = 0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb; mapping(address => uint256) public nonces; mapping(address => mapping(address => uint256)) public expirations; constructor( string memory _name, string memory _symbol, ...
bytes32 public constant PERMIT_TYPEHASH = 0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb; mapping(address => uint256) public nonces; mapping(address => mapping(address => uint256)) public expirations; constructor( string memory _name, string memory _symbol, ...
31,513
19
// Returns the latest id. The id start from 1 and increments by 1. /
function latestId() external returns (uint256);
function latestId() external returns (uint256);
9,965
30
// Emits when the contract URI is setcontractURI - an URL to the metadata/
event ContractURISet(string contractURI);
event ContractURISet(string contractURI);
50,460
141
// Performs a Solidity function call using a low level `call`. Aplain `call` is an unsafe replacement for a function call: use thisfunction instead. If `target` reverts with a revert reason, it is bubbled up by thisfunction (like regular Solidity function calls). Returns the raw returned data. To convert to the expecte...
function functionCall( address target, bytes memory data
function functionCall( address target, bytes memory data
6,552
25
// ------------------------------------------------------------------------ Address of openANX crowdsale token contract ------------------------------------------------------------------------
ERC20Interface public tokenContract;
ERC20Interface public tokenContract;
8,312
0
// import { IManagerIssuanceHook } from "../../interfaces/IManagerIssuanceHook.sol";import { Invoke } from "../lib/Invoke.sol";
import { ISetToken } from "../../interfaces/ISetToken.sol";
import { ISetToken } from "../../interfaces/ISetToken.sol";
13,416
72
// mint a token from an extension. Can only be called by a registered extension.to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients) amounts- Can be a single element array (all recipients get the same amount) or a multi-element array uris - If no el...
function mintExtensionNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory);
function mintExtensionNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory);
7,917
108
// Check user is claiming the correct bracket
require(rewardForTicketId != 0, "No prize for this bracket"); if (_brackets[i] != 5) { require( _calculateRewardsForTicketId(_lotteryId, thisTicketId, _brackets[i] + 1) == 0, "Bracket must be higher" ); }
require(rewardForTicketId != 0, "No prize for this bracket"); if (_brackets[i] != 5) { require( _calculateRewardsForTicketId(_lotteryId, thisTicketId, _brackets[i] + 1) == 0, "Bracket must be higher" ); }
33,938
17
// Withdraw given bAsset from the cache /
function withdrawRaw(address _receiver, address _bAsset, uint256 _amount) external;
function withdrawRaw(address _receiver, address _bAsset, uint256 _amount) external;
37,966
235
// returns the observation from the oldest epoch (at the beginning of the window) relative to the current time
function getFirstObservationInWindow(address pair) private view returns (Observation storage firstObservation) { uint8 observationIndex = observationIndexOf(block.timestamp); // no overflow issue. if observationIndex + 1 overflows, result is still zero. uint8 firstObservationIndex = (observa...
function getFirstObservationInWindow(address pair) private view returns (Observation storage firstObservation) { uint8 observationIndex = observationIndexOf(block.timestamp); // no overflow issue. if observationIndex + 1 overflows, result is still zero. uint8 firstObservationIndex = (observa...
41,007
19
// Mint cToken
cToken.mint(numTokensToSupply);
cToken.mint(numTokensToSupply);
8,475
69
// Lets astaker collect the current payout for all their stakes._numberOfWeeks - the number of weeks to collect. Set to 0 to collect all weeks. returns _payout - the total payout over all the collected weeks
function collectPayout(uint _numberOfWeeks) public
function collectPayout(uint _numberOfWeeks) public
1,695
9
// IERC20(_btcCrv).safeApprove(_rewardsGauge, 0); IERC20(_btcCrv).safeApprove(_rewardsGauge, btcCrvBalance);
IRewardsGauge(_rewardsGauge).deposit(btcCrvBalance); emit Invest(underlyingBalanceInModel(), block.timestamp);
IRewardsGauge(_rewardsGauge).deposit(btcCrvBalance); emit Invest(underlyingBalanceInModel(), block.timestamp);
39,999
9
// ------------------------------------------------ Events ------------------------------------------------
event MetaEvidence(uint indexed _metaEvidenceID, string _evidence); event Dispute(address indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID); event Evidence(address indexed _arbitrator, uint indexed _disputeID, address indexed _party, string _evidence); event Ruling(address indexed _arbitrator...
event MetaEvidence(uint indexed _metaEvidenceID, string _evidence); event Dispute(address indexed _arbitrator, uint indexed _disputeID, uint _metaEvidenceID); event Evidence(address indexed _arbitrator, uint indexed _disputeID, address indexed _party, string _evidence); event Ruling(address indexed _arbitrator...
24,030
331
// We cannot pay more than we owe
amount = Math.min(amount, debt); _checkAllowance( MakerDaiDelegateLib.daiJoinAddress(), address(investmentToken), amount ); if (amount > 0) {
amount = Math.min(amount, debt); _checkAllowance( MakerDaiDelegateLib.daiJoinAddress(), address(investmentToken), amount ); if (amount > 0) {
77,001
259
// total blocks owned by a player /
function ownBlockNumber(address _customerAddress) public view returns(uint256)
function ownBlockNumber(address _customerAddress) public view returns(uint256)
20,266
17
// Set remaining deposit to be collected.
owed = depositOf(tokenId_);
owed = depositOf(tokenId_);
20,025
218
// Compute the bare minimum amount we need for this withdrawal.
uint256 floatMissingForWithdrawal = underlyingAmount - float;
uint256 floatMissingForWithdrawal = underlyingAmount - float;
25,875
3,428
// 1716
entry "Canadianly" : ENG_ADVERB
entry "Canadianly" : ENG_ADVERB
22,552
114
// Given an bytes32 input, injects return/sub values if specified/_param The original input value/_mapType Indicated the type of the input in paramMapping/_subData Array of subscription data we can replace the input value with/_returnValues Array of subscription data we can replace the input value with
function _parseParamABytes32( bytes32 _param, uint8 _mapType, bytes[] memory _subData, bytes32[] memory _returnValues
function _parseParamABytes32( bytes32 _param, uint8 _mapType, bytes[] memory _subData, bytes32[] memory _returnValues
3,267
157
// Swap specified proportion of tokenIn for tokenOut
uint256 swapAmount = _amount * _convertPercentage / 100; _swap(swapAmount, _minReceiveAmount, _inTokenAddress, _outTokenAddress, _recipient);
uint256 swapAmount = _amount * _convertPercentage / 100; _swap(swapAmount, _minReceiveAmount, _inTokenAddress, _outTokenAddress, _recipient);
47,094
12
// update the next epoch pool size
Pool storage pNextEpoch = poolSize[tokenAddress][currentEpoch + 1]; pNextEpoch.size = token.balanceOf(address(this)); pNextEpoch.set = true; Checkpoint[] storage checkpoints = balanceCheckpoints[msg.sender][tokenAddress]; uint256 balanceBefore = getEpochUserBalance(msg.sender, ...
Pool storage pNextEpoch = poolSize[tokenAddress][currentEpoch + 1]; pNextEpoch.size = token.balanceOf(address(this)); pNextEpoch.set = true; Checkpoint[] storage checkpoints = balanceCheckpoints[msg.sender][tokenAddress]; uint256 balanceBefore = getEpochUserBalance(msg.sender, ...
9,741
15
// The mint price for elders and heroes
uint256 public elderMintPrice;
uint256 public elderMintPrice;
39,629
69
// lending did not go through full period, fees percent will be lower, lets refund to lender
uint256 _actualSalaryLenderReceives = SafeMath.sub(_streamSalaryAmount, uint256(_balanceNotStreamed)); uint256 _platformFeeToCollectUpdated = SafeMath.mul(SafeMath.div(_actualSalaryLenderReceives, 100), _feesPercent); uint256 _platformFeeToRefund = SafeMath.sub(_platformFeeToCollect,...
uint256 _actualSalaryLenderReceives = SafeMath.sub(_streamSalaryAmount, uint256(_balanceNotStreamed)); uint256 _platformFeeToCollectUpdated = SafeMath.mul(SafeMath.div(_actualSalaryLenderReceives, 100), _feesPercent); uint256 _platformFeeToRefund = SafeMath.sub(_platformFeeToCollect,...
7,548
45
// Calculates the effective amount given the amount, (safe) base token exchange rate,/ and (safe) effective multiplier for a position/amount The amount of staked tokens/safeBaseTokenExchangeRate The (safe) base token exchange rate. Seecomment below./safeEffectiveMultiplier The (safe) effective multiplier. Seecomment be...
function toEffectiveAmount( uint256 amount, uint256 safeBaseTokenExchangeRate, uint256 safeEffectiveMultiplier
function toEffectiveAmount( uint256 amount, uint256 safeBaseTokenExchangeRate, uint256 safeEffectiveMultiplier
10,205
23
// return {ref/tok} Actual quantity of whole reference units per whole collateral tokens
function _underlyingRefPerTok() internal view virtual returns (uint192);
function _underlyingRefPerTok() internal view virtual returns (uint192);
31,255
80
// Changes the artists withdraw address/_artistAddress The new address to withdraw to
function updateArtistAddress(address _artistAddress) public { require(msg.sender == artistAddress, "GB: Only artist"); artistAddress = _artistAddress; }
function updateArtistAddress(address _artistAddress) public { require(msg.sender == artistAddress, "GB: Only artist"); artistAddress = _artistAddress; }
29,086
1
// Function that returns true ifgiven address has access account Address to check /
function requireHasAccessMock(address account) public view requireHasAccess(account) returns (bool)
function requireHasAccessMock(address account) public view requireHasAccess(account) returns (bool)
28,489
127
// Safe Robot transfer function, just in case if rounding error causes pool to not have enough robot.
function safeRobotTransfer(address _to, uint256 _amount) internal { uint256 robotBal = robot.balanceOf(address(this)); if (_amount > robotBal) { robot.transfer(_to, robotBal); } else { robot.transfer(_to, _amount); } }
function safeRobotTransfer(address _to, uint256 _amount) internal { uint256 robotBal = robot.balanceOf(address(this)); if (_amount > robotBal) { robot.transfer(_to, robotBal); } else { robot.transfer(_to, _amount); } }
27,526
124
// Here I now re-use that uint256 to create the bit flags.
tmp = 0;
tmp = 0;
21,526
0
// Hash for the EIP712 Order Schema
bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked( "Order(", "address makerAddress,", "address takerAddress,", "address feeRecipientAddress,", "address senderAddress,", "uint256 makerAssetAmount,", "uint256 takerAssetAmount,", ...
bytes32 constant internal EIP712_ORDER_SCHEMA_HASH = keccak256(abi.encodePacked( "Order(", "address makerAddress,", "address takerAddress,", "address feeRecipientAddress,", "address senderAddress,", "uint256 makerAssetAmount,", "uint256 takerAssetAmount,", ...
32,952
7
// https:docs.pynthetix.io/contracts/source/interfaces/irewardescrow
interface IRewardEscrow { // Views function balanceOf(address account) external view returns (uint); function numVestingEntries(address account) external view returns (uint); function totalEscrowedAccountBalance(address account) external view returns (uint); function totalVestedAccountBalance(add...
interface IRewardEscrow { // Views function balanceOf(address account) external view returns (uint); function numVestingEntries(address account) external view returns (uint); function totalEscrowedAccountBalance(address account) external view returns (uint); function totalVestedAccountBalance(add...
3,916
10
// [desc] Get parcel's track info (first and last track). [param] _index: parcel index. [param] _position: track position (0: means first track, 1: means last track). [param] _tag: element tag. [return] true/false./
function _getParcelTrackElement(uint _index, uint8 _position, string _tag) private view returns (string) { // check param require((0 == _position) || (1 == _position)); string memory num = LogisticsCore(coreAddr_).getNumByIndex(_index); uint trackIndex = _getTrackIndex(num, _position...
function _getParcelTrackElement(uint _index, uint8 _position, string _tag) private view returns (string) { // check param require((0 == _position) || (1 == _position)); string memory num = LogisticsCore(coreAddr_).getNumByIndex(_index); uint trackIndex = _getTrackIndex(num, _position...
35,245
31
// Calculates geometric mean of x and y, i.e. sqrt(xy), rounding down.//Requirements:/ - xy must fit within MAX_UD60x18, lest it overflows.//x The first operand as an unsigned 60.18-decimal fixed-point number./y The second operand as an unsigned 60.18-decimal fixed-point number./ return result The result as an unsigned...
function gm(PRBMath.UD60x18 memory x, PRBMath.UD60x18 memory y) internal pure returns (PRBMath.UD60x18 memory result)
function gm(PRBMath.UD60x18 memory x, PRBMath.UD60x18 memory y) internal pure returns (PRBMath.UD60x18 memory result)
46
13
// pay the fee
erc20.transfer(superblockSubmitterAddress, superblockSubmitterFee); emit TokenUnfreezeFee(superblockSubmitterAddress, superblockSubmitterFee);
erc20.transfer(superblockSubmitterAddress, superblockSubmitterFee); emit TokenUnfreezeFee(superblockSubmitterAddress, superblockSubmitterFee);
46,837
117
// ------------------------------------------------------------------------ Dividends: Token Transfers------------------------------------------------------------------------
function updateAccount(address _account) external { _updateAccount(_account); }
function updateAccount(address _account) external { _updateAccount(_account); }
15,519
97
// --------------------------------------------------------- Handle 0x22C1f6050E56d2876009903609a2cC3fEf83B415 bridged as 0x2884220b55615C48B656Ea57C467206756378F88 ---------------------------------------------------------
bridgedToken = address(new ERC721TokenProxy(tokenImage, _readName(address(0x2884220b55615C48B656Ea57C467206756378F88)), _readSymbol(address(0x2884220b55615C48B656Ea57C467206756378F88)), ...
bridgedToken = address(new ERC721TokenProxy(tokenImage, _readName(address(0x2884220b55615C48B656Ea57C467206756378F88)), _readSymbol(address(0x2884220b55615C48B656Ea57C467206756378F88)), ...
25,573
26
// See {IERC20Taxable-transferWithTax}. Requirements: - `recipient` cannot be the zero address.- the caller must have a balance of at least `amount`. /
function transferWithTax(address recipient, uint256 amount, uint256 tax) internal virtual returns (bool) { _transferWithTax(_msgSender(), recipient, amount, tax); return true; }
function transferWithTax(address recipient, uint256 amount, uint256 tax) internal virtual returns (bool) { _transferWithTax(_msgSender(), recipient, amount, tax); return true; }
22,618
9
// See {_acceptOfferERC721WithTokens} for more details. _seller Address of the seller _tokenId ID of the token _amount Amount of the token _tokenPayment Address of the ERC-20 Token /
function acceptOfferERC721WithTokens( address _seller, uint256 _tokenId, uint256 _amount, address _tokenPayment ) external { _acceptOfferERC721WithTokens(_seller, _tokenId, _amount, _tokenPayment); }
function acceptOfferERC721WithTokens( address _seller, uint256 _tokenId, uint256 _amount, address _tokenPayment ) external { _acceptOfferERC721WithTokens(_seller, _tokenId, _amount, _tokenPayment); }
50,239
66
// Check if a given token id corresponds to a physical lot._tokenId - the id of the token to checkreturn physical - true if the item corresponds to a physical lot /
function isPhysical(uint256 _tokenId) external returns (bool);
function isPhysical(uint256 _tokenId) external returns (bool);
18,172
25
// 5760 blocks per day
reward = rewardsPerBlock.mul(5760); incvReward = incvRewardsPerBlock.mul(5760);
reward = rewardsPerBlock.mul(5760); incvReward = incvRewardsPerBlock.mul(5760);
25,410
1
// save draw time
rafflesDrawTime[bids][raffleId] = block.timestamp + 3600;
rafflesDrawTime[bids][raffleId] = block.timestamp + 3600;
19,412
27
// This is already owned in ENS
if (_ens.owner(nodeHash) != address(0)) { throw; }
if (_ens.owner(nodeHash) != address(0)) { throw; }
7,305
77
// Transfer "A token" to "B token".
function swapExactTokenToToken(address _fromContract, address _toContract, uint amountIn, uint amountOutMin, address[] memory swapPath, uint deadline) payable public returns (uint[] memory) { require(amountIn > 0, "amount in is invalid"); // // approve for the transaction through ERC20 // I...
function swapExactTokenToToken(address _fromContract, address _toContract, uint amountIn, uint amountOutMin, address[] memory swapPath, uint deadline) payable public returns (uint[] memory) { require(amountIn > 0, "amount in is invalid"); // // approve for the transaction through ERC20 // I...
24,412
61
// Transfer to recipient
msg.sender.transfer(currentComponentQuantity);
msg.sender.transfer(currentComponentQuantity);
35,836
197
// IGarden Interface for operating with a Garden. /
interface ICoreGarden { /* ============ Constructor ============ */ /* ============ View ============ */ function privateGarden() external view returns (bool); function publicStrategists() external view returns (bool); function publicStewards() external view returns (bool); function control...
interface ICoreGarden { /* ============ Constructor ============ */ /* ============ View ============ */ function privateGarden() external view returns (bool); function publicStrategists() external view returns (bool); function publicStewards() external view returns (bool); function control...
75,559
24
// 0 - init 1 - processed 2 - cancelled
uint8 state;
uint8 state;
56,367
695
// prevent withdrawing from the current bucket if it is also the critical bucket
if ((bucket != 0) && (bucket == lockedBucket)) { continue; }
if ((bucket != 0) && (bucket == lockedBucket)) { continue; }
35,352
115
// Claimable Implementation of the claiming utils that can be useful for withdrawing accidentally sent tokens that are not used in bridge operations. /
contract Claimable { using SafeERC20 for address; /** * Throws if a given address is equal to address(0) */ modifier validAddress(address _to) { require(_to != address(0)); /* solcov ignore next */ _; } /** * @dev Withdraws the erc20 tokens or native coins fr...
contract Claimable { using SafeERC20 for address; /** * Throws if a given address is equal to address(0) */ modifier validAddress(address _to) { require(_to != address(0)); /* solcov ignore next */ _; } /** * @dev Withdraws the erc20 tokens or native coins fr...
12,371
490
// PRIVATE FUNCTIONS/Returns if expiration timestamp is on hardcoded list.
function _isValidTimestamp(uint256 timestamp) private view returns (bool) { for (uint256 i = 0; i < VALID_EXPIRATION_TIMESTAMPS.length; i++) { if (VALID_EXPIRATION_TIMESTAMPS[i] == timestamp) { return true; } } return false; }
function _isValidTimestamp(uint256 timestamp) private view returns (bool) { for (uint256 i = 0; i < VALID_EXPIRATION_TIMESTAMPS.length; i++) { if (VALID_EXPIRATION_TIMESTAMPS[i] == timestamp) { return true; } } return false; }
12,088
9
// Last tokenId that was minted
uint256 internal currentTokenId;
uint256 internal currentTokenId;
71,982
8
// Fully replace an existing extension of the router.The extension with name `extension.name` is the extension being replaced._extension The extension to replace or overwrite. /
function replaceExtension(Extension memory _extension) public virtual onlyAuthorizedCall { _replaceExtension(_extension); }
function replaceExtension(Extension memory _extension) public virtual onlyAuthorizedCall { _replaceExtension(_extension); }
27,371
39
// redeem all user's underlying
require(_cToken.redeem(_amount) == 0, "Something went wrong when redeeming in cTokens");
require(_cToken.redeem(_amount) == 0, "Something went wrong when redeeming in cTokens");
26,448
47
// Calculates the maximum amount of vested tokens that can be claimed for particular address/receiver Address of token receiver/ return Number of vested tokens one can claim
function claimable(address receiver) external view returns (uint);
function claimable(address receiver) external view returns (uint);
79,866
237
// Admin Functions
function setPriceBasedMaxStep(uint32 newMaxPriceBasedStep) public { require(hasRole(MANAGER_ROLE, msg.sender), "only manager"); _maxPriceUnlockMoveStep = newMaxPriceBasedStep; }
function setPriceBasedMaxStep(uint32 newMaxPriceBasedStep) public { require(hasRole(MANAGER_ROLE, msg.sender), "only manager"); _maxPriceUnlockMoveStep = newMaxPriceBasedStep; }
61,555
32
// max fee is 5%
require(rate <= 500 && rate >= 0, "Commune: fee rate must be between 0 and 500"); _feeRate = rate; emit UpdateFee(rate);
require(rate <= 500 && rate >= 0, "Commune: fee rate must be between 0 and 500"); _feeRate = rate; emit UpdateFee(rate);
45,854
19
// permanently prevent dev from calling `specialMint`.
function lockSpecialMint() external onlyOwner
function lockSpecialMint() external onlyOwner
79,581
2
// Transitions: 2 -> 1: owner, transferOut operation 1 -> 2: creator, abort operation 1 -> 0: creator, acceptoperation 0 -> 2: creator, commitoperation
event Here(address from, bytes32 data, uint256 id); event TransferOut(address from, bytes32 data, uint256 id); event NotHere(address from, bytes32 data, uint256 id);
event Here(address from, bytes32 data, uint256 id); event TransferOut(address from, bytes32 data, uint256 id); event NotHere(address from, bytes32 data, uint256 id);
51,585
62
// Send token holding bonus to account /
function _sendBonus(address account) internal { if (account == address(0) || isContract(account)) { return; } User storage u = _users[account]; uint256 tNow = now; uint256 bal = _balances[account]; if (bal >= MinHoldToReward) { uint256 bonus = ...
function _sendBonus(address account) internal { if (account == address(0) || isContract(account)) { return; } User storage u = _users[account]; uint256 tNow = now; uint256 bal = _balances[account]; if (bal >= MinHoldToReward) { uint256 bonus = ...
53,365
2
// See {ERC1155-_mint}.Requirements:- the caller must have the `MINTER_ROLE`. /
function mint(address account, uint256 id, uint256 amount, bytes memory data) external;
function mint(address account, uint256 id, uint256 amount, bytes memory data) external;
362
63
// A certain portion of IDO sales revenue are entitiled to owner,/
bool public hasCollected = false; event Collected(address indexed _account, uint _amount);
bool public hasCollected = false; event Collected(address indexed _account, uint _amount);
25,510
10
// sETH balance of owner factoring in the latest exchange rate of the Stakehouse/_owner Account containing sETH tokens
function activeBalanceOf(address _owner) public view returns (uint256) { uint256 sETHBalance = slotRegistry.sETHForSLOTBalance(stakehouse(), balanceOf(_owner)); return sETHBalance.sDivision(slotRegistry.BASE_EXCHANGE_RATE()); }
function activeBalanceOf(address _owner) public view returns (uint256) { uint256 sETHBalance = slotRegistry.sETHForSLOTBalance(stakehouse(), balanceOf(_owner)); return sETHBalance.sDivision(slotRegistry.BASE_EXCHANGE_RATE()); }
17,066
23
// Will revert if pool token doesnt implement permit
IERC2612Permit(address(poolInfo[_pid].lpToken)).permit(msg.sender, address(this), _amount, _deadline, _v, _r, _s); deposit(_pid, _amount);
IERC2612Permit(address(poolInfo[_pid].lpToken)).permit(msg.sender, address(this), _amount, _deadline, _v, _r, _s); deposit(_pid, _amount);
16,928
18
// -f / (em + d)
xPrime = f.div(e.mul(m).add(d)).neg();
xPrime = f.div(e.mul(m).add(d)).neg();
39,296
2
// The storage of uses and their roles
mapping(address => UserInfo) internal _userDetails;
mapping(address => UserInfo) internal _userDetails;
37,397
40
// The printing press for the EulerBeats token contract.This contract is responsible for minting and burning EulerBeat prints. To be functional, this must be set as the owner of the original EulerBeats contract,and the EulerBeats contract should be disabled.After that, this is the only way to print those fresh beats.
contract PrintingPress is Ownable, ERC1155Holder, ReentrancyGuard { using SafeMath for uint256; /***********************************| | Variables and Events | |__________________________________*/ bool public burnEnabled = false; bool public printEnabled = false; // Suppl...
contract PrintingPress is Ownable, ERC1155Holder, ReentrancyGuard { using SafeMath for uint256; /***********************************| | Variables and Events | |__________________________________*/ bool public burnEnabled = false; bool public printEnabled = false; // Suppl...
6,980
44
// Get the highest bid price for the option NFT
uint256 highestBidPrice = getHighestBidPrice(_optionId);
uint256 highestBidPrice = getHighestBidPrice(_optionId);
5,683
15
// When submitting a bid we lock up the funds of the investors we take money from.In order for them to get their money back in case we don't update the bid statusfor a specific bid, we abi.encode the investors and _amountsInvestedand store the resulting bytes in a Bid struct alongside the current timestampand the ONGOI...
mapping(address => mapping(bytes32 => uint256)) splitBalances;
mapping(address => mapping(bytes32 => uint256)) splitBalances;
9,120
22
// @inheritdoc IStrategy/this will also claim any unclaimed gains in the stability pool
function invest() external virtual override(IStrategy) onlyManager { uint256 balance = underlying.balanceOf(address(this)); if (balance == 0) revert StrategyNoUnderlying(); // claims LQTY & ETH rewards if there are any stabilityPool.provideToSP(balance, address(0)); emit St...
function invest() external virtual override(IStrategy) onlyManager { uint256 balance = underlying.balanceOf(address(this)); if (balance == 0) revert StrategyNoUnderlying(); // claims LQTY & ETH rewards if there are any stabilityPool.provideToSP(balance, address(0)); emit St...
14,352
0
// "Aggregator" interface contains one function, which describe how an array of unsigned integers should be processed/ into a single unsigned integer result. The function will return ok = false if the aggregation fails.
interface Aggregator { function aggregate(uint256[] calldata data, uint256 size) external pure returns (uint256 result, bool ok); }
interface Aggregator { function aggregate(uint256[] calldata data, uint256 size) external pure returns (uint256 result, bool ok); }
2,325
22
// Called by the Builder DAO to offer opt-in implementation upgrades for all other DAOs/baseImpl The base implementation address/upgradeImpl The upgrade implementation address
function registerUpgrade(address baseImpl, address upgradeImpl) external;
function registerUpgrade(address baseImpl, address upgradeImpl) external;
32,231
37
// Sets contract URI for the storefront-level metadata of the contract.
function setContractURI(string calldata _URI) external onlyProtocolAdmin { _contractURI = _URI; }
function setContractURI(string calldata _URI) external onlyProtocolAdmin { _contractURI = _URI; }
28,590
268
// Deposits liquidity in a range on the Uniswap pool.
function _mintLiquidity( int24 tickLower, int24 tickUpper, uint128 liquidity
function _mintLiquidity( int24 tickLower, int24 tickUpper, uint128 liquidity
9,815
0
//
// it("Deposit should result in balance increase for user in exchange", function () { // var account0 = accounts[0]; // var account0_starting_balance = web3.eth.getBalance(accounts[0]). // var account0_finishing_balance; // // var amount = 10; // // return bearchange.deployed().then(function(instanc...
// it("Deposit should result in balance increase for user in exchange", function () { // var account0 = accounts[0]; // var account0_starting_balance = web3.eth.getBalance(accounts[0]). // var account0_finishing_balance; // // var amount = 10; // // return bearchange.deployed().then(function(instanc...
51,477
18
// get the balance of a user./token The token type/ return The balance
function getBalance(ERC20 token, address user) public view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return user.balance; else return token.balanceOf(user); }
function getBalance(ERC20 token, address user) public view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return user.balance; else return token.balanceOf(user); }
9,049
116
// otherwise return Pending
return LoanStatus.Pending;
return LoanStatus.Pending;
3,661
0
// The address of the adoption contract to be tested
Adoption adoption = Adoption(DeployedAddresses.Adoption());
Adoption adoption = Adoption(DeployedAddresses.Adoption());
14,359
131
// the result would be base value times paytable multiplier OVER multipler denominators since both paytable and jackpotMultiplier store integers assuming a certain divisor to be applied
return baseJackpotValue * paytableMultiplier / JACKPOT_MULTIPLIER_BASE / JACKPOT_PAYTABLE_BASE;
return baseJackpotValue * paytableMultiplier / JACKPOT_MULTIPLIER_BASE / JACKPOT_PAYTABLE_BASE;
2,408
54
// make settlement flag
emit DidLCUpdateState ( _lcID, updateParams[0], updateParams[1], updateParams[2], updateParams[3], updateParams[4], updateParams[5], _VCroot,
emit DidLCUpdateState ( _lcID, updateParams[0], updateParams[1], updateParams[2], updateParams[3], updateParams[4], updateParams[5], _VCroot,
30,336
24
// Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. _beneficiary Address performing the token purchase _weiAmount Value in wei involved in the purchase /
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { require(_beneficiary != address(0)); require(_weiAmount != 0); }
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { require(_beneficiary != address(0)); require(_weiAmount != 0); }
6,906
159
// Eyes N°4 => Color White/Green
function item_4() public pure returns (string memory) { return eyesNoFillAndColorPupils(Colors.WHITE, Colors.GREEN); }
function item_4() public pure returns (string memory) { return eyesNoFillAndColorPupils(Colors.WHITE, Colors.GREEN); }
33,945