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
4
// Dequeues a deposit subtree for submission to the rollup /
function dequeueToSubmit()
function dequeueToSubmit()
21,479
967
// Packs an uint value into a "floating point" storage slot. Used for storinglastClaimIntegralSupply values in balance storage. For these values, we don't needto maintain exact precision but we don't want to be limited by storage size overflows. A floating point value is defined by the 48 most significant bits and an 8...
library FloatingPoint56 { function packTo56Bits(uint256 value) internal pure returns (uint56) { uint256 bitShift; // If the value is over the uint48 max value then we will shift it down // given the index of the most significant bit. We store this bit shift // in the least signific...
library FloatingPoint56 { function packTo56Bits(uint256 value) internal pure returns (uint56) { uint256 bitShift; // If the value is over the uint48 max value then we will shift it down // given the index of the most significant bit. We store this bit shift // in the least signific...
6,398
5
// Need to transfer before minting or ERC777s could reenter.
asset.safeTransferFrom(msg.sender, address(this), assets); _mint(receiver, shares); emit Deposit(msg.sender, receiver, assets, shares); afterDeposit(assets, shares);
asset.safeTransferFrom(msg.sender, address(this), assets); _mint(receiver, shares); emit Deposit(msg.sender, receiver, assets, shares); afterDeposit(assets, shares);
24,482
149
// Amount of wei raised
uint256 private _weiRaised;
uint256 private _weiRaised;
76,080
47
// Gets the current votes balance for `account`./account The address to get votes balance./ return The number of current votes for `account`.
function getCurrentVotes(address account) external view returns (uint256) { unchecked {uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;} }
function getCurrentVotes(address account) external view returns (uint256) { unchecked {uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;} }
40,262
120
// Not block locked by setts
if (_mintIbbtc && (_amounts[1] > 0 || _amounts[2] > 0)) { require( RENCRV_VAULT.blockLock(address(this)) < block.number, "blockLocked" ); }
if (_mintIbbtc && (_amounts[1] > 0 || _amounts[2] > 0)) { require( RENCRV_VAULT.blockLock(address(this)) < block.number, "blockLocked" ); }
49,627
37
// if silo was able to handle solvency calculations, then we can handle quoteAmount without safe math
quoteAmount += _swapForQuote(_assets[i], _receivedCollaterals[i]);
quoteAmount += _swapForQuote(_assets[i], _receivedCollaterals[i]);
11,016
83
// vesting token
IERC20 private token;
IERC20 private token;
67,784
259
// _Available since v3.1._ /
interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,ad...
interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,ad...
1,439
24
// Override for extensions that require an internal state to check for validity (current user contributions,etc.) beneficiary Address receiving the tokens weiAmount Value in wei involved in the purchase /
function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal
function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal
16,936
147
// Safely mints `quantity` tokens and transfers them to `to`. Requirements: - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId ...
* {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId ...
8,253
2
// Revert with an error when a fulfillment is provided that does not declare at least one offer component and at least one consideration component. /
error OfferAndConsiderationRequiredOnFulfillment();
error OfferAndConsiderationRequiredOnFulfillment();
19,912
3
// Methods to mock data on the chain
function storeData(uint256 data) public
function storeData(uint256 data) public
31,211
60
// Payout Function 1 --> Distribute Shares to Affiliates and Payees (DSAP) In addition to including this, we also modified the PaymentSplitter release() function to make it minAdmin2 (to ensure that affiliate fundswill always be paid out prior to defined shares).
function distributeSharesAffilsAndPayees() external minAdmin2 noReentrant { // A. Payout affiliates: for (uint i = 0; i < affiliateDistro.length; i++) { // The ref name -- eg. jim, etc. string memory affiliateRef = affiliateDistro[i]; // The wallet addr to be paid for t...
function distributeSharesAffilsAndPayees() external minAdmin2 noReentrant { // A. Payout affiliates: for (uint i = 0; i < affiliateDistro.length; i++) { // The ref name -- eg. jim, etc. string memory affiliateRef = affiliateDistro[i]; // The wallet addr to be paid for t...
30,774
16
// Aave v2 Helpers
interface AaveV2Interface { function deposit(address _asset, uint256 _amount, address _onBehalfOf, uint16 _referralCode) external; function withdraw(address _asset, uint256 _amount, address _to) external; function borrow( address _asset, uint256 _amount, uint256 _interestRateMode, ...
interface AaveV2Interface { function deposit(address _asset, uint256 _amount, address _onBehalfOf, uint16 _referralCode) external; function withdraw(address _asset, uint256 _amount, address _to) external; function borrow( address _asset, uint256 _amount, uint256 _interestRateMode, ...
51,614
22
// view function doesn't write to blockchain.
function getLockPeriods() external view returns(uint[] memory) { return lockPeriods; }
function getLockPeriods() external view returns(uint[] memory) { return lockPeriods; }
17,693
1,026
// https:etherscan.io/address/0x5b1b5fEa1b99D83aD479dF0C222F0492385381dD
LegacyTokenState public constant tokenstatesynthetix_i = LegacyTokenState(0x5b1b5fEa1b99D83aD479dF0C222F0492385381dD);
LegacyTokenState public constant tokenstatesynthetix_i = LegacyTokenState(0x5b1b5fEa1b99D83aD479dF0C222F0492385381dD);
3,981
1,064
// Ensure the ExchangeRates contract has the feed for sADA;
exchangerates_i.addAggregator("sADA", 0xAE48c91dF1fE419994FFDa27da09D5aC69c30f55);
exchangerates_i.addAggregator("sADA", 0xAE48c91dF1fE419994FFDa27da09D5aC69c30f55);
34,511
129
// Se nem from nem to são o Banco, eh transferencia normal
require(registry.isValidatedClient(from), "O endereço não pertence a um cliente ou não está validada"); require(registry.isValidatedSupplier(to), "A conta do endereço não pertence a um fornecedor ou não está validada"); _transfer(msg.sender, to, value); ...
require(registry.isValidatedClient(from), "O endereço não pertence a um cliente ou não está validada"); require(registry.isValidatedSupplier(to), "A conta do endereço não pertence a um fornecedor ou não está validada"); _transfer(msg.sender, to, value); ...
40,105
23
// Allows to update the number of required confirmations by Safe owners./This can only be done via a Safe transaction./Changes the threshold of the Safe to `_threshold`./_threshold New threshold.
function changeThreshold(uint256 _threshold) public authorized
function changeThreshold(uint256 _threshold) public authorized
21,948
75
// UserContract This contracts creates for easy integration to the Tellor System by allowing smart contracts to read data off Tellor/
contract UsingTellor{ ITellor tellor; /*Constructor*/ /** * @dev the constructor sets the storage address and owner * @param _tellor is the TellorMaster address */ constructor(address payable _tellor) public { tellor = ITellor(_tellor); } /** * @dev Retreive value from ...
contract UsingTellor{ ITellor tellor; /*Constructor*/ /** * @dev the constructor sets the storage address and owner * @param _tellor is the TellorMaster address */ constructor(address payable _tellor) public { tellor = ITellor(_tellor); } /** * @dev Retreive value from ...
22,894
79
// Add tokens to this contract.
function join(address user, uint128 wad) external returns (uint128);
function join(address user, uint128 wad) external returns (uint128);
43,635
70
// Transfer from recipient to this contract Emits a transfer event if successful
function _pull(address sender, uint amount) internal { _move(sender, address(this), amount); }
function _pull(address sender, uint amount) internal { _move(sender, address(this), amount); }
30,683
35
// Can be called by any address to update a block header can only upload new block data or the same block data with more confirmations
function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _data) external override { // this function may revert with a default message if the oracle address is not an ILayerZeroOracle BlockData storage bd = hashLookup[msg.sender][_srcChainId][_lookupHash]; //...
function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _data) external override { // this function may revert with a default message if the oracle address is not an ILayerZeroOracle BlockData storage bd = hashLookup[msg.sender][_srcChainId][_lookupHash]; //...
36,183
476
// Emit the query success event.
emit RequestedUpdate(sym.toString(), queryID);
emit RequestedUpdate(sym.toString(), queryID);
43,867
145
// Lets someone stake a given amount of `stakingTokens`/amount Amount of ERC20 staking token that the `msg.sender` wants to stake
function stake(uint256 amount) external nonReentrant updateReward(msg.sender) { _stake(amount, msg.sender); }
function stake(uint256 amount) external nonReentrant updateReward(msg.sender) { _stake(amount, msg.sender); }
58,719
235
// Get the address of the Node contract for the given node nodeNum Index of the nodereturn Address of the Node contract /
function getNode(uint256 nodeNum) public view override returns (INode) { return _nodes[nodeNum]; }
function getNode(uint256 nodeNum) public view override returns (INode) { return _nodes[nodeNum]; }
66,817
269
// Transfer all ETH to governance in case of emergency. Cannot be calledif already finalized /
function emergencyWithdraw() external onlyGovernanceOrGuardian { require(!finalized, "Finalized"); payable(governance).transfer(address(this).balance); }
function emergencyWithdraw() external onlyGovernanceOrGuardian { require(!finalized, "Finalized"); payable(governance).transfer(address(this).balance); }
4,995
132
// Returns the count of all existing NFTokens.return Total supply of NFTs. /
function totalSupply() external override view returns (uint256)
function totalSupply() external override view returns (uint256)
75,395
0
// an interface to interact with the base contracts
interface IContracts { function initialize(bytes memory data, address owner_) external; }
interface IContracts { function initialize(bytes memory data, address owner_) external; }
8,839
41
// Interface of the ERC3156 FlashLender, as defined in _Available since v4.1._ /
interface IERC3156FlashLenderUpgradeable { /** * @dev The amount of currency available to be lended. * @param token The loan currency. * @return The amount of `token` that can be borrowed. */ function maxFlashLoan(address token) external view returns (uint256); /** * @dev The fee t...
interface IERC3156FlashLenderUpgradeable { /** * @dev The amount of currency available to be lended. * @param token The loan currency. * @return The amount of `token` that can be borrowed. */ function maxFlashLoan(address token) external view returns (uint256); /** * @dev The fee t...
4,497
13
// LP allocation points. Must be the sum of all allocation points in all lp pools.
uint256 public lpAllocPoints = 0;
uint256 public lpAllocPoints = 0;
5,227
50
// Ensure the order is not already canceled.
require(makerOrderStatus[_order.maker.wallet][_order.nonce] != CANCELED, "ORDER_ALREADY_CANCELED");
require(makerOrderStatus[_order.maker.wallet][_order.nonce] != CANCELED, "ORDER_ALREADY_CANCELED");
50,670
122
// Any user can transfer to another user.
function transfer(address _to, uint256 _amount) public override returns (bool) { uint256 balance = balanceOf(_msgSender()); require(lockedAmount[_msgSender()] + _amount <= balance, "transfer: <= balance"); _transfer(_msgSender(), _to, _amount); return true; }
function transfer(address _to, uint256 _amount) public override returns (bool) { uint256 balance = balanceOf(_msgSender()); require(lockedAmount[_msgSender()] + _amount <= balance, "transfer: <= balance"); _transfer(_msgSender(), _to, _amount); return true; }
4,719
7
// second 32 bytes
s := mload(add(sig, 64))
s := mload(add(sig, 64))
18,484
80
// Mint tokens and refund not used ethers in case when max amount reached during this minting
uint256 excess = appendContribution(_beneficiary, tokens); uint256 refund = (excess > 0 ? excess.mul(100).div(100+_bonus).mul(conversionRate).div(rate) : 0); weiAmount = weiAmount.sub(refund); satoshiRaised = satoshiRaised.add(satoshiAmount);
uint256 excess = appendContribution(_beneficiary, tokens); uint256 refund = (excess > 0 ? excess.mul(100).div(100+_bonus).mul(conversionRate).div(rate) : 0); weiAmount = weiAmount.sub(refund); satoshiRaised = satoshiRaised.add(satoshiAmount);
47,286
22
// not delegated to anyone, default to yourself
return staker;
return staker;
27,105
2
// Delegates the current call to the StakingExtension implementation. This function does not return to its internal call site, it will return directly to theexternal caller. / solhint-disable-next-line payable-fallback, no-complex-fallback
fallback() external { require(_implementation() != address(0), "only through proxy");
fallback() external { require(_implementation() != address(0), "only through proxy");
25,538
80
// update lock data
lockInfo[lockId].lockAmount -= amount; lockInfo[lockId].rewardPointsAssigned -= rewardPointsToRemove;
lockInfo[lockId].lockAmount -= amount; lockInfo[lockId].rewardPointsAssigned -= rewardPointsToRemove;
8,081
256
// Keep in sync with ComptrollerInterface080.sol.
contract ComptrollerInterface { /// @notice Indicator that this is a Comptroller contract (for inspection) bool public constant isComptroller = true; /*** Assets You Are In ***/ function enterMarkets(address[] calldata cTokens) external returns (uint[] memory); function exitMarket(address cToken) ...
contract ComptrollerInterface { /// @notice Indicator that this is a Comptroller contract (for inspection) bool public constant isComptroller = true; /*** Assets You Are In ***/ function enterMarkets(address[] calldata cTokens) external returns (uint[] memory); function exitMarket(address cToken) ...
50,554
155
// function to calculate the interest using a linear interest rate formula _rate the interest rate, in ray _lastUpdateTimestamp the timestamp of the last update of the interestreturn the interest rate linearly accumulated during the timeDelta, in ray /
{ //solium-disable-next-line uint256 timeDifference = block.timestamp.sub( uint256(_lastUpdateTimestamp) ); uint256 timeDelta = timeDifference.wadToRay().rayDiv( SECONDS_PER_YEAR.wadToRay() ); return _rate.rayMul(timeDelta).add(WadRayMath.ray...
{ //solium-disable-next-line uint256 timeDifference = block.timestamp.sub( uint256(_lastUpdateTimestamp) ); uint256 timeDelta = timeDifference.wadToRay().rayDiv( SECONDS_PER_YEAR.wadToRay() ); return _rate.rayMul(timeDelta).add(WadRayMath.ray...
30,799
1
// Query if a contract implements an interface _interfaceId The interface identifier, as specified in ERC-165 Interface identification is specified in ERC-165. /
function supportsInterface(bytes4 _interfaceId) external view returns (bool);
function supportsInterface(bytes4 _interfaceId) external view returns (bool);
5,068
49
// Multiplies value a by value b (result is rounded towards zero). It's assumed that the value b is thesignificand of a number with 18 decimals precision. /
function preciseMul(int256 a, int256 b) internal pure returns (int256) { return a.mul(b).div(PRECISE_UNIT_INT); }
function preciseMul(int256 a, int256 b) internal pure returns (int256) { return a.mul(b).div(PRECISE_UNIT_INT); }
21,887
0
// Event emitted when setting/updating royalty info/fees. This is used by Rarible V1. Emits event in order to comply with Rarible V1 royalty spec. tokenId Specific token id for which royalty info is being set, set as 0 for all tokens inside of the smart contract. recipients Address array of wallets that will receive th...
event SecondarySaleFees(uint256 tokenId, address[] recipients, uint256[] bps);
event SecondarySaleFees(uint256 tokenId, address[] recipients, uint256[] bps);
54,918
11
// gets a quote in source native gas, for the amount that send() requires to pay for message delivery_dstChainId - the destination chain identifier_userApplication - the user app address on this EVM chain_payload - the custom message to send over LayerZero_payInZRO - if false, user app pays the protocol fee in native t...
function estimateFees( uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam ) external view returns (uint256 nativeFee, uint256 zroFee);
function estimateFees( uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam ) external view returns (uint256 nativeFee, uint256 zroFee);
55,197
6
// Sell some ETH and get refund
function ethToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) external payable returns (uint256); function ethToTokenTransferOutput( uint256 tokens_bought, uint256 deadline, address recipient ) external payable returns (uint256);
function ethToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) external payable returns (uint256); function ethToTokenTransferOutput( uint256 tokens_bought, uint256 deadline, address recipient ) external payable returns (uint256);
45,333
82
// Used to set the token URI configuration. tokenId ID of the token to set the metadata URI for tokenURI_ Metadata URI to apply to all tokens, either as base or as full URI for every token /
function _setTokenURI( uint256 tokenId, string memory tokenURI_
function _setTokenURI( uint256 tokenId, string memory tokenURI_
17,471
231
// evaluate the role and reassign it
userRoles[operator] = evaluateBy(msg.sender, userRoles[operator], role);
userRoles[operator] = evaluateBy(msg.sender, userRoles[operator], role);
17,877
115
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
mapping(uint256 => address) private _tokenApprovals;
829
401
// Check stage supply if applicable
if (stage.maxStageSupply > 0) { if (_stageMintedCounts[activeStage] + qty > stage.maxStageSupply) revert StageSupplyExceeded(); }
if (stage.maxStageSupply > 0) { if (_stageMintedCounts[activeStage] + qty > stage.maxStageSupply) revert StageSupplyExceeded(); }
31,106
1
// Internal function to pay interest of a loan. Calls _payInterestTransfer internal function to transfer tokens. lender The account address of the lender. interestToken The token address to pay interest with./
function _payInterest(address lender, address interestToken) internal { LenderInterest storage lenderInterestLocal = lenderInterest[lender][interestToken]; uint256 interestOwedNow = 0; if (lenderInterestLocal.owedPerDay != 0 && lenderInterestLocal.updatedTimestamp != 0) { interestOwedNow = block.timestamp.su...
function _payInterest(address lender, address interestToken) internal { LenderInterest storage lenderInterestLocal = lenderInterest[lender][interestToken]; uint256 interestOwedNow = 0; if (lenderInterestLocal.owedPerDay != 0 && lenderInterestLocal.updatedTimestamp != 0) { interestOwedNow = block.timestamp.su...
48,747
9
// A账户存在B账户资金
mapping(address => mapping(address => uint256)) public allowance;
mapping(address => mapping(address => uint256)) public allowance;
23,771
7
// Our render is upgradeable. This lets us point to a different renderer.
function updateRenderer(address a) external onlyOwner { rendererAddress = a; }
function updateRenderer(address a) external onlyOwner { rendererAddress = a; }
12,580
81
// Swap contract tokens, add liquidity, then distribute
if (swapEnabled && !_isSwapLocked && balanceOf(address(this)) > swapTokensAmount && from != dexPair && !isExcludedFromFees(from) && !isExcludedFromFees(to)) { _swapLiquify(swapTokensAmount); }
if (swapEnabled && !_isSwapLocked && balanceOf(address(this)) > swapTokensAmount && from != dexPair && !isExcludedFromFees(from) && !isExcludedFromFees(to)) { _swapLiquify(swapTokensAmount); }
80,272
857
// Since _startingMultiplier and _endingMultiplier are in 6 decimalsNeed to divide multiplier by _MULTIPLIER_DIVISOR /
return multiplier.div(_MULTIPLIER_DIVISOR);
return multiplier.div(_MULTIPLIER_DIVISOR);
32,893
21
// Emitted when RSR is staked/era The era at time of staking/staker The address of the staker
/// @param rsrAmount {qRSR} How much RSR was staked /// @param stRSRAmount {qStRSR} How much stRSR was minted by this staking event Staked( uint256 indexed era, address indexed staker, uint256 rsrAmount, uint256 stRSRAmount ); /// Emitted when an unstaking is started...
/// @param rsrAmount {qRSR} How much RSR was staked /// @param stRSRAmount {qStRSR} How much stRSR was minted by this staking event Staked( uint256 indexed era, address indexed staker, uint256 rsrAmount, uint256 stRSRAmount ); /// Emitted when an unstaking is started...
31,160
9
// Sends the deposit back to the Bridger if his claim is not successfully challenged. Includes a portion of the Challenger's deposit if unsuccessfully challenged. _ticketID The ticket identifier referring to a message going through the bridge. /
function withdrawClaimDeposit(uint256 _ticketID) external;
function withdrawClaimDeposit(uint256 _ticketID) external;
29,312
44
// set the rest of the contract variables
dexRouter = _dexRouter;
dexRouter = _dexRouter;
899
143
// sender transfers 99% of the bear
return super.transfer(recipient, amount.sub(burnAmount));
return super.transfer(recipient, amount.sub(burnAmount));
3,695
23
// Trim the { and } from the parameters
uint256 tokenID = Bytes.toUint(blob[1:uint256(index) - 1]); uint256 blueprintLength = blob.length - uint256(index) - 3; if (blueprintLength == 0) { return (tokenID, bytes("")); }
uint256 tokenID = Bytes.toUint(blob[1:uint256(index) - 1]); uint256 blueprintLength = blob.length - uint256(index) - 3; if (blueprintLength == 0) { return (tokenID, bytes("")); }
29,257
13
// emit an event that the order has been reset
emit OrderReset(orderId, block.timestamp);
emit OrderReset(orderId, block.timestamp);
13,584
10
// myft.mint(alice, expected);
uint256 result = myft.balanceOf(bob); Assert.equal(expected, result, "error msg");
uint256 result = myft.balanceOf(bob); Assert.equal(expected, result, "error msg");
28,543
24
// To change amount of tokens allowed tobuy in a single transaction _maxTokensToBuy amount of tokens in 'ether' format /
function changeMaxTokensToBuy(uint256 _maxTokensToBuy) external onlyOwner { require(_maxTokensToBuy > 0, "Zero max tokens to buy value"); uint256 prevValue = maxTokensToBuy; maxTokensToBuy = _maxTokensToBuy; emit MaxTokensUpdated(prevValue, _maxTokensToBuy, block.timestamp); }
function changeMaxTokensToBuy(uint256 _maxTokensToBuy) external onlyOwner { require(_maxTokensToBuy > 0, "Zero max tokens to buy value"); uint256 prevValue = maxTokensToBuy; maxTokensToBuy = _maxTokensToBuy; emit MaxTokensUpdated(prevValue, _maxTokensToBuy, block.timestamp); }
30,292
8
// A structure for Feral File artwork
struct Artwork { string title; string artistName; string fingerprint; uint256 editionSize; uint256 AEAmount; uint256 PPAmount; }
struct Artwork { string title; string artistName; string fingerprint; uint256 editionSize; uint256 AEAmount; uint256 PPAmount; }
8,255
94
// Sets admin address Only callable by the contract owner. /
function setAdmin(address _admin) external onlyOwner { require(_admin != address(0), "Cannot be zero address"); admin = _admin; }
function setAdmin(address _admin) external onlyOwner { require(_admin != address(0), "Cannot be zero address"); admin = _admin; }
45,810
129
// Transfer from recipient to this contract Emits a transfer event if successful
function _pull(address sender, uint256 amount) internal { _move(sender, address(this), amount); }
function _pull(address sender, uint256 amount) internal { _move(sender, address(this), amount); }
23,326
12
// update total shares
totalShares += amount;
totalShares += amount;
32,207
2
// ============ Public Storage ============
mapping(address => uint256) public nonces;
mapping(address => uint256) public nonces;
19,999
179
// Read a ring buffer cardinalityreturn Ring buffer cardinality /
function getBufferCardinality() external view returns (uint32);
function getBufferCardinality() external view returns (uint32);
25,425
472
// A PRNG based upon a Lehmer (Park-Miller) method/https:en.wikipedia.org/wiki/Lehmer_random_number_generator
function _prng(uint32 seed) internal view returns (uint32) { uint64 nonce = seed == 0 ? uint32(block.timestamp) : seed; uint64 product = uint64(nonce) * 48271; uint32 x = uint32((product % 0x7fffffff) + (product >> 31)); return (x & 0x7fffffff) + (x >> 31); }
function _prng(uint32 seed) internal view returns (uint32) { uint64 nonce = seed == 0 ? uint32(block.timestamp) : seed; uint64 product = uint64(nonce) * 48271; uint32 x = uint32((product % 0x7fffffff) + (product >> 31)); return (x & 0x7fffffff) + (x >> 31); }
69,797
11
// RESTRICTED FUNCTIONS /
function setRewardBooster(address _rewardBooster) external onlyOwner { require(_rewardBooster != address(0), "Zero address detected"); rewardBooster = _rewardBooster; }
function setRewardBooster(address _rewardBooster) external onlyOwner { require(_rewardBooster != address(0), "Zero address detected"); rewardBooster = _rewardBooster; }
26,518
3
// Gets the address of a registered PresaleGenerator at specified index /
function presaleGeneratorAtIndex(uint256 _index) external view returns (address) { return presaleGenerators.at(_index); }
function presaleGeneratorAtIndex(uint256 _index) external view returns (address) { return presaleGenerators.at(_index); }
27,185
23
// Update best token address
bestToken = newBestTokenAddr;
bestToken = newBestTokenAddr;
26,438
32
// Internal minting function for Baal `loot`.
function _mintLoot(address to, uint96 loot) private { members[to].loot += loot; /*add `loot` for `to` account*/ totalLoot += loot; /*add to total Baal `loot`*/ emit TransferLoot(address(0), to, loot); /*emit event reflecting mint of `loot`*/ }
function _mintLoot(address to, uint96 loot) private { members[to].loot += loot; /*add `loot` for `to` account*/ totalLoot += loot; /*add to total Baal `loot`*/ emit TransferLoot(address(0), to, loot); /*emit event reflecting mint of `loot`*/ }
29,463
642
// Add synths to the Issuer contract - batch 1;
issuer_addSynths_37();
issuer_addSynths_37();
24,783
355
// getDocumentProposalCount(): get the number of unique proposed upgrades
function getDocumentProposalCount() external view returns (uint256 count)
function getDocumentProposalCount() external view returns (uint256 count)
39,195
74
// lottery Active
bool active;
bool active;
34,805
0
// @inheritdoc IERC1155SupplyExtension /
function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply(id); }
function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply(id); }
31,437
0
// Storage slot with the address of the gremlins contract
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
48,286
13
// /Internal Functions //
function getMsgForSign( address _user, uint256 _pid, uint256 _amount, bool _type, address _rewardToken ) internal pure returns(bytes32)
function getMsgForSign( address _user, uint256 _pid, uint256 _amount, bool _type, address _rewardToken ) internal pure returns(bytes32)
35,903
182
// This pauses or unpauses sales.If paused, no NFTs can be minted, including by whitelisted users.Must be set to false for NFTs to be minted.
function pause(bool _state) public onlyOwner { paused = _state; }
function pause(bool _state) public onlyOwner { paused = _state; }
12,720
15
// are we on ethereum main net
bool isMainNet;
bool isMainNet;
18,476
518
// update the vault state to as the owed amont fo the vampire was removed// What this does:// - Calculate and return the current amount owed to a vampire/ - Reset the vampire stake info to as if they were staked now// What the controller should do after this function returns:// - Transfer the `owed` amount of $BLOODBAG...
function claimBloodBags(address sender, uint16 tokenId) external returns (uint256 owed);
function claimBloodBags(address sender, uint16 tokenId) external returns (uint256 owed);
28,469
3
// Mint functions requirements
require(supply < maxSupply, "Currently sold out"); require(mintIsActive, "Sale must be active to mint tokens"); require(supply + numberOfTokens <= maxSupply, "Purchase would exceed max tokens"); uint256 totalNumberMinted = _numberMinted(msg.sender); require(num...
require(supply < maxSupply, "Currently sold out"); require(mintIsActive, "Sale must be active to mint tokens"); require(supply + numberOfTokens <= maxSupply, "Purchase would exceed max tokens"); uint256 totalNumberMinted = _numberMinted(msg.sender); require(num...
39,506
86
// We assume that the proof they supplied is for the child-adjacent reputation, not the child reputation. So use the key and value for the child-adjacent reputation, but uid, branchmask and siblings that were supplied.
bytes memory childAdjacentReputationValueBytes = abi.encodePacked(u[U_CHILD_ADJACENT_REPUTATION_VALUE], u[U_CHILD_REPUTATION_UID]);
bytes memory childAdjacentReputationValueBytes = abi.encodePacked(u[U_CHILD_ADJACENT_REPUTATION_VALUE], u[U_CHILD_REPUTATION_UID]);
23,661
256
// BaseENSManager Implementation of an ENS manager that orchestrates the completeregistration of subdomains for a single root (e.g. argent.eth).The contract defines a manager role who is the only role that can trigger the registration ofa new subdomain. Julien Niset - <julien@argent.im> /
contract BaseENSManager is IENSManager, OwnerManagable, ENSConsumer { using strings for *; using BytesUtil for bytes; using MathUint for uint; // The managed root name string public rootName; // The managed root node bytes32 public immutable rootNode; // The address of the ENS...
contract BaseENSManager is IENSManager, OwnerManagable, ENSConsumer { using strings for *; using BytesUtil for bytes; using MathUint for uint; // The managed root name string public rootName; // The managed root node bytes32 public immutable rootNode; // The address of the ENS...
47,127
76
// Owner can modify discount configuration.newConfig A data blob representing the new discount config. Details on format above. /
function changeDiscountConfig(bytes32 newConfig) external onlyOwner { discountConfig = newConfig; }
function changeDiscountConfig(bytes32 newConfig) external onlyOwner { discountConfig = newConfig; }
13,667
4
// Reads the slot loc of contract c
function load(address c, bytes32 loc) public virtual returns (bytes32 val);
function load(address c, bytes32 loc) public virtual returns (bytes32 val);
49,260
646
// Address of Audius ServiceProvider contract, used to permission Governance method calls
address private serviceProviderFactoryAddress;
address private serviceProviderFactoryAddress;
41,470
114
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) { takeFee = false; }
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) { takeFee = false; }
18,700
28
// Interface to the RoyaltyRegistry responsible for looking payout addresses /
abstract contract RoyaltyRegistryInterface { function getAddress(address custodial) external view virtual returns (address); function getMediaCustomPercentage(uint256 mediaId, address tokenAddress) external view virtual returns(uint16); function getExternalTokenPercentage(uint256 tokenId, address tokenAddre...
abstract contract RoyaltyRegistryInterface { function getAddress(address custodial) external view virtual returns (address); function getMediaCustomPercentage(uint256 mediaId, address tokenAddress) external view virtual returns(uint16); function getExternalTokenPercentage(uint256 tokenId, address tokenAddre...
81,524
8
// voucher => saleId
mapping(address => EnumerableSetUpgradeable.UintSet) internal _voucherSales; mapping(address => EnumerableSetUpgradeable.AddressSet) internal _allowAddresses; ISolver public solver; uint24 public nextSaleId; uint24 public nextTradeId;
mapping(address => EnumerableSetUpgradeable.UintSet) internal _voucherSales; mapping(address => EnumerableSetUpgradeable.AddressSet) internal _allowAddresses; ISolver public solver; uint24 public nextSaleId; uint24 public nextTradeId;
16,502
16
// Loop through each address
for (uint256 i = 0; i < numModules; ) {
for (uint256 i = 0; i < numModules; ) {
11,840
190
// _amount = 100000000000 (mints 10M tokens right away)
constructor( address _vestingBeneficiary, uint256 _amount
constructor( address _vestingBeneficiary, uint256 _amount
39,762
8
// Allow the contract owner to update the mint fee
function setMintFee(uint256 _newFee) external onlyOwner { mintFee = _newFee; }
function setMintFee(uint256 _newFee) external onlyOwner { mintFee = _newFee; }
2,858
5
// UpgradeabilityProxy This contract represents a proxy where the implementation address to which it will delegate can be upgraded /
contract UpgradeabilityProxy is Proxy { /** * @dev This event will be emitted every time the implementation gets upgraded * @param implementation representing the address of the upgraded implementation */ event Upgraded(address indexed implementation); /// @dev Storage position of the addres...
contract UpgradeabilityProxy is Proxy { /** * @dev This event will be emitted every time the implementation gets upgraded * @param implementation representing the address of the upgraded implementation */ event Upgraded(address indexed implementation); /// @dev Storage position of the addres...
27,529
8
// first check status extract the status field:
slResult.find("\"".toSlice()).beyond("\"".toSlice()); slResult.until(slResult.copy().find("\"".toSlice())); bytes1 status = bytes(slResult.toString())[0]; // s = L if (status == "C") {
slResult.find("\"".toSlice()).beyond("\"".toSlice()); slResult.until(slResult.copy().find("\"".toSlice())); bytes1 status = bytes(slResult.toString())[0]; // s = L if (status == "C") {
3,023
6
// view the amount of ETH spent by a user _user, address of the user /
function getETHSpent(address _user) external view returns (uint256);
function getETHSpent(address _user) external view returns (uint256);
6,533
106
// The logic of finalization. Internal @ Do I have to use the functionno @ When it is possible to call- @ When it is launched automaticallyafter end of round @ Who can call the function-
function finalization() internal { // If the goal of the achievement if (goalReached()) { financialStrategy.setup(wallets[uint8(Roles.beneficiary)], weiRaised(), 0, 1);//Для контракта Buz деньги не возвращает. // if there is anything to give ...
function finalization() internal { // If the goal of the achievement if (goalReached()) { financialStrategy.setup(wallets[uint8(Roles.beneficiary)], weiRaised(), 0, 1);//Для контракта Buz деньги не возвращает. // if there is anything to give ...
78,486
18
// balance mapping and transfer allowance array
mapping(address => uint256) balances; mapping(address => mapping (address => uint256)) allowed; event Buy(address indexed _sender, uint256 _eth, uint256 _ARX); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Burn(address _from, uint256 _value); event Approval(ad...
mapping(address => uint256) balances; mapping(address => mapping (address => uint256)) allowed; event Buy(address indexed _sender, uint256 _eth, uint256 _ARX); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Burn(address _from, uint256 _value); event Approval(ad...
11,993