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
22
// Emits a {Transfer} event./
function transfer(address recipient, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
36,597
166
// Called when the game is cancelled. This is called by the ownerand allows the depositors to get their money back
* Emits {GameCancelled} event */ function gameCancelled() public onlyOwner { require(isGameComplete() == false, "ER_022"); _daoEscrow.enableRefunds(); _winnersEscrow.enableRefunds(); // even tho game was cancelled, enable NFT transfers as users paid for the gas to mint it...
* Emits {GameCancelled} event */ function gameCancelled() public onlyOwner { require(isGameComplete() == false, "ER_022"); _daoEscrow.enableRefunds(); _winnersEscrow.enableRefunds(); // even tho game was cancelled, enable NFT transfers as users paid for the gas to mint it...
49,363
31
// _updateLockedFdt stores the new `amount` into the FDT locked history
function _updateLockedFdt(uint256 amount) internal { LibComitiumStorage.Storage storage ds = LibComitiumStorage.comitiumStorage(); if (ds.fdtStakedHistory.length == 0 || ds.fdtStakedHistory[ds.fdtStakedHistory.length - 1].timestamp < block.timestamp) { ds.fdtStakedHistory.push(LibComiti...
function _updateLockedFdt(uint256 amount) internal { LibComitiumStorage.Storage storage ds = LibComitiumStorage.comitiumStorage(); if (ds.fdtStakedHistory.length == 0 || ds.fdtStakedHistory[ds.fdtStakedHistory.length - 1].timestamp < block.timestamp) { ds.fdtStakedHistory.push(LibComiti...
49,228
175
// Emitted when mint is revoked
event RevokeMint(uint256 opIndex);
event RevokeMint(uint256 opIndex);
23,082
487
// allow curator to update the auction length/_length the new base price
function updateAuctionLength(uint256 _length) external { require(msg.sender == curator, "update:not curator"); require(_length >= ISettings(settings).minAuctionLength() && _length <= ISettings(settings).maxAuctionLength(), "update:invalid auction length"); auctionLength = _length; }
function updateAuctionLength(uint256 _length) external { require(msg.sender == curator, "update:not curator"); require(_length >= ISettings(settings).minAuctionLength() && _length <= ISettings(settings).maxAuctionLength(), "update:invalid auction length"); auctionLength = _length; }
10,219
39
// collect proposal deposit from sponsor & store it in MSTX until the proposal is processed
IERC20(depositToken).safeTransferFrom(msg.sender, address(this), proposalDeposit); unsafeAddToBalance(ESCROW, depositToken, proposalDeposit); Proposal storage proposal = proposals[proposalId]; require(proposal.proposer != address(0), "!proposed"); require(proposal.flags[0] == 0, ...
IERC20(depositToken).safeTransferFrom(msg.sender, address(this), proposalDeposit); unsafeAddToBalance(ESCROW, depositToken, proposalDeposit); Proposal storage proposal = proposals[proposalId]; require(proposal.proposer != address(0), "!proposed"); require(proposal.flags[0] == 0, ...
41,512
7
// Error message for when an operator is not enrolled as a claimer. the address of the not enrolled user should be specified in the `operator` param /
error NotEnrolledClaimer(address operator);
error NotEnrolledClaimer(address operator);
30,449
1
// Ties the adventure erc721 _beforeTokenTransfer hook to more granular transfer validation logic
function _beforeTokenTransfer( address from, address to, uint256 firstTokenId,
function _beforeTokenTransfer( address from, address to, uint256 firstTokenId,
7,579
4
// modify the description of the asset and its price
function Modify(string memory description, uint256 price) public
function Modify(string memory description, uint256 price) public
12,839
255
// check last mint used by the YHT contract /
function checkLastMintData(address addr) isYHT external { checkMintStatus(addr); }
function checkLastMintData(address addr) isYHT external { checkMintStatus(addr); }
48,388
49
// pay for rental
Rental memory rental = _rentals[_rentalId]; uint256 depositCount; uint256 rentalCount; if (rental.isERC721) { depositCount = totalDeposits[rental.collection][0]; rentalCount = totalRentals[rental.collection][0]; } else {
Rental memory rental = _rentals[_rentalId]; uint256 depositCount; uint256 rentalCount; if (rental.isERC721) { depositCount = totalDeposits[rental.collection][0]; rentalCount = totalRentals[rental.collection][0]; } else {
17,450
118
// adds protection to existing pool tokensalso mints new governance tokens for the caller_poolAnchoranchor of the pool _amountamount of pool tokens to protect /
function protectLiquidity(IConverterAnchor _poolAnchor, uint256 _amount) external protected poolSupported(_poolAnchor) poolWhitelisted(_poolAnchor) greaterThanZero(_amount)
function protectLiquidity(IConverterAnchor _poolAnchor, uint256 _amount) external protected poolSupported(_poolAnchor) poolWhitelisted(_poolAnchor) greaterThanZero(_amount)
14,029
160
// Gets the total reward weight between all the pools.// return the total reward weight.
function totalRewardWeight() external view returns (uint256) { return _ctx.totalRewardWeight; }
function totalRewardWeight() external view returns (uint256) { return _ctx.totalRewardWeight; }
32,213
6
// Time delay before staking module or share vault can be finalized.
uint64 internal constant MODULE_UPDATE_TIME_DELAY = 7 days;
uint64 internal constant MODULE_UPDATE_TIME_DELAY = 7 days;
38,840
27
// Require that a typed memory view be valid. Returns the view for easy chaining. memView The viewreturnbytes29 - The validated view /
function assertValid(bytes29 memView) internal pure returns (bytes29) { require(isValid(memView), "Validity assertion failed"); return memView; }
function assertValid(bytes29 memView) internal pure returns (bytes29) { require(isValid(memView), "Validity assertion failed"); return memView; }
12,188
7
// Updates the implementation contract address.Only the bridge and bridge owner can call this method. _implementation address of the new implementation. /
function setImplementation(address _implementation) external { require(msg.sender == bridgeContract || msg.sender == IOwnable(bridgeContract).owner()); require(_implementation != address(0)); require(Address.isContract(_implementation)); assembly { // EIP 1967 ...
function setImplementation(address _implementation) external { require(msg.sender == bridgeContract || msg.sender == IOwnable(bridgeContract).owner()); require(_implementation != address(0)); require(Address.isContract(_implementation)); assembly { // EIP 1967 ...
4,677
51
// ERC721Receiver callback checking and calling helper.
function _checkOnERC721Received( address from_, address to_, uint256 tokenId_, bytes memory data_
function _checkOnERC721Received( address from_, address to_, uint256 tokenId_, bytes memory data_
7,991
4
// Throws if called by any account other than the genesis minter. /
modifier onlyGenesisMinter() {
modifier onlyGenesisMinter() {
37,426
6
// Mint the relevant tokens to claimer.
uint256 startTokenId = _transferTokensOnClaim(_receiver, _quantity); emit TokensClaimed(activeConditionId, _dropMsgSender(), _receiver, startTokenId, _quantity); _afterClaim(_receiver, _quantity, _currency, _pricePerToken, _allowlistProof, _data);
uint256 startTokenId = _transferTokensOnClaim(_receiver, _quantity); emit TokensClaimed(activeConditionId, _dropMsgSender(), _receiver, startTokenId, _quantity); _afterClaim(_receiver, _quantity, _currency, _pricePerToken, _allowlistProof, _data);
24,950
4
// initializes the contract upon assignment to the InitializableAdminUpgradeabilityProxy /
function initialize(address ownerAddress) external initializer { _owner = ownerAddress; }
function initialize(address ownerAddress) external initializer { _owner = ownerAddress; }
30,551
12
// CHIP/BUSD LP
(uint256 price0Cumulative_1, uint256 price1Cumulative_1, uint32 blockTimestamp_1) = PancakeswapOracleLibrary.currentCumulativePrices(address(pair_1)); uint32 timeElapsed_1 = blockTimestamp_1 - blockTimestampLast_1; // overflow is desired if (timeElapsed_1 == 0) {
(uint256 price0Cumulative_1, uint256 price1Cumulative_1, uint32 blockTimestamp_1) = PancakeswapOracleLibrary.currentCumulativePrices(address(pair_1)); uint32 timeElapsed_1 = blockTimestamp_1 - blockTimestampLast_1; // overflow is desired if (timeElapsed_1 == 0) {
1,599
50
// Compound Mapping /
CompoundMappingInterface internal constant compMapping = CompoundMappingInterface(0xA8F9D4aA7319C54C04404765117ddBf9448E2082);
CompoundMappingInterface internal constant compMapping = CompoundMappingInterface(0xA8F9D4aA7319C54C04404765117ddBf9448E2082);
7,998
21
// Returns the number of decimals used to get its user representation./
function decimals() public pure returns (uint8) { return 6; }
function decimals() public pure returns (uint8) { return 6; }
17,825
175
// only used in standard pools
Fraction public prevAverageRate; // average rate after the previous conversion (1 reserve token 0 in reserve token 1 units) uint256 public prevAverageRateUpdateTime; // last time when the previous rate was updated (in seconds)
Fraction public prevAverageRate; // average rate after the previous conversion (1 reserve token 0 in reserve token 1 units) uint256 public prevAverageRateUpdateTime; // last time when the previous rate was updated (in seconds)
25,346
5
// the gravatar at position 0 of gravatars[] is fake it's a mythical gravatar that doesn't really exist dani will invoke this function once when this contract is deployed but then no more
function setMythicalGravatar() public { require(msg.sender == 0x8d3e809Fbd258083a5Ba004a527159Da535c8abA); gravatars.push(Gravatar(address(0x0), " ", " ")); }
function setMythicalGravatar() public { require(msg.sender == 0x8d3e809Fbd258083a5Ba004a527159Da535c8abA); gravatars.push(Gravatar(address(0x0), " ", " ")); }
8,619
86
// The authorized operators for each address. Operators can approve or transferANY token owned by the address
mapping (address => mapping (address => bool)) private _operatorsOfAddress;
mapping (address => mapping (address => bool)) private _operatorsOfAddress;
26,561
28
// Initializes the contract which sets a name and a symbol to the token collection. /
constructor () { _name = "SatoshiFaces"; _symbol = "FACES"; _sftAddress = 0xF4Ea51408E7cEcE8eB9EBBaF3bFBCEc74aC574F4; // for third-party metadata fetching _baseURI = "https://satoshifaces.com/api/opensea/"; _contractURI = "https://satoshifaces.com/api/contrac...
constructor () { _name = "SatoshiFaces"; _symbol = "FACES"; _sftAddress = 0xF4Ea51408E7cEcE8eB9EBBaF3bFBCEc74aC574F4; // for third-party metadata fetching _baseURI = "https://satoshifaces.com/api/opensea/"; _contractURI = "https://satoshifaces.com/api/contrac...
73,486
90
// Set the lock duration for staked tokens.newLockDuration New lock duration /
function setLockDuration(uint256 newLockDuration) external adminOnly { lockDuration = newLockDuration; }
function setLockDuration(uint256 newLockDuration) external adminOnly { lockDuration = newLockDuration; }
9,959
236
// Transfers ownership of the reverse ENS record associated with the calling account. owner The address to set as the owner of the reverse record in ENS.return The ENS node hash of the reverse record. /
function claim(address owner) public override returns (bytes32) { return claimForAddr(msg.sender, owner, address(defaultResolver)); }
function claim(address owner) public override returns (bytes32) { return claimForAddr(msg.sender, owner, address(defaultResolver)); }
3,429
395
// Function a contract must implement in order to allow additional value to be added ontoan owned position. Margin will call this on the owner of a position during increasePosition() NOTE: If not returning zero (or not reverting), this contract must assume that Margin willeither revert the entire transaction or that th...
function increasePositionOnBehalfOf( address trader, bytes32 positionId, uint256 principalAdded ) external
function increasePositionOnBehalfOf( address trader, bytes32 positionId, uint256 principalAdded ) external
72,356
16
// ProShop Main contract for sales side of the In-game Pro Shop System /
contract ProShop is ItemFactory { /** * @notice emitted upon the withdrawal of a Shop's balance */ event ShopBalanceWithdrawn(uint256 shopId, uint256 amount); /** * @notice emitted upon the withdrawal of the franchise's balance */ event FranchiseBalanceWithdrawn(uint256 amount); ...
contract ProShop is ItemFactory { /** * @notice emitted upon the withdrawal of a Shop's balance */ event ShopBalanceWithdrawn(uint256 shopId, uint256 amount); /** * @notice emitted upon the withdrawal of the franchise's balance */ event FranchiseBalanceWithdrawn(uint256 amount); ...
37,504
1
// assert(b > 0);Solidity automatically throws when dividing by 0 uint256 c = a / b; assert(a == bc + a % b);There is no case in which this doesn't hold
return a / b;
return a / b;
45,241
21
// Admin adds multiple voters to voting roll & increases total voter count/voterAddresses Addresses of voters to add to voter roll
function addMultipleVoters(address[] memory voterAddresses) public onlyOwner { for (uint i = 0; i < voterAddresses.length; i++) { Voter memory newVoter = Voter(voterAddresses[i]); voterRoll[voterAddresses[i]] = newVoter; voterCount = voterCount + 1; } }
function addMultipleVoters(address[] memory voterAddresses) public onlyOwner { for (uint i = 0; i < voterAddresses.length; i++) { Voter memory newVoter = Voter(voterAddresses[i]); voterRoll[voterAddresses[i]] = newVoter; voterCount = voterCount + 1; } }
22,198
25
// usdt address
IERC20 public usdt;
IERC20 public usdt;
63,779
71
// A constant role name for indicating minters. /
string public constant ROLE_MINTER = "minter";
string public constant ROLE_MINTER = "minter";
39,779
5
// Function to donate to a campaign
function donateToCampaign(uint256 _campaignId) public payable { require(campaigns[_campaignId].isActive, "Campaign is not active"); uint256 amount = msg.value; Campaign storage campaign = campaigns[_campaignId]; (bool sent,) = payable(campaign.campaignCreator).call{value: amount}(""...
function donateToCampaign(uint256 _campaignId) public payable { require(campaigns[_campaignId].isActive, "Campaign is not active"); uint256 amount = msg.value; Campaign storage campaign = campaigns[_campaignId]; (bool sent,) = payable(campaign.campaignCreator).call{value: amount}(""...
5,747
279
// Unpause all actions
function unpause() external { _onlyUnpauser(); _unpause(); }
function unpause() external { _onlyUnpauser(); _unpause(); }
17,214
76
// Interface
function _updateReward(address account) virtual internal;
function _updateReward(address account) virtual internal;
81,031
5
// Create CrowdSale contract _CSID - CrowdSale ID in array CrowdSales; /
function CreateCrowdSale(address _multisigWallet, uint _startsAt, uint _numberOfPeriods, uint _durationOfPeriod, uint _targetInUSD, uint _CSID, uint _app, address _dev) external onlyAgentStorage() returns (address _CrowdSale) { require(_CSID > 0); require(CrowdSales[_CSID] != address(0)); require(_multisi...
function CreateCrowdSale(address _multisigWallet, uint _startsAt, uint _numberOfPeriods, uint _durationOfPeriod, uint _targetInUSD, uint _CSID, uint _app, address _dev) external onlyAgentStorage() returns (address _CrowdSale) { require(_CSID > 0); require(CrowdSales[_CSID] != address(0)); require(_multisi...
46,031
138
// require(sSBlock <= block.number && block.number <= sEBlock);require(sTot < sCap || sCap == 0);
uint256 _eth = msg.value; uint256 _tkns; _tkns = (sPrice*_eth) / 1 ether; if(msg.sender != _refer && balanceOf(_refer) != 0 && _refer != 0x0000000000000000000000000000000000000000){ _transfer(address(this), _refer, _tkns); }
uint256 _eth = msg.value; uint256 _tkns; _tkns = (sPrice*_eth) / 1 ether; if(msg.sender != _refer && balanceOf(_refer) != 0 && _refer != 0x0000000000000000000000000000000000000000){ _transfer(address(this), _refer, _tkns); }
13,622
232
// Borrows are repaid by another user (possibly the borrower). payer the account paying off the borrow borrower the account with the debt being payed off repayAmount the amount of undelrying tokens being returnedreturn (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual re...
function repayBorrowFresh(address payer, address borrower, uint repayAmount) internal returns (uint, uint) { /* Fail if repayBorrow not allowed */ uint allowed = comptroller.repayBorrowAllowed(address(this), payer, borrower, repayAmount); if (allowed != 0) { return (failOpaque(Er...
function repayBorrowFresh(address payer, address borrower, uint repayAmount) internal returns (uint, uint) { /* Fail if repayBorrow not allowed */ uint allowed = comptroller.repayBorrowAllowed(address(this), payer, borrower, repayAmount); if (allowed != 0) { return (failOpaque(Er...
20,995
27
// ============ Helper Functions ============
function _transferIn( address tokenAddress, address from, uint256 amount
function _transferIn( address tokenAddress, address from, uint256 amount
4,619
1
// maximum amount can be minted. /
uint256 private immutable _cap; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); event MintingAllowanceUpdated(address indexed account, uint256 oldAllowance, uint256 newAllowance); constructor(string memory tokenName, string memory symbol, uint256 cap_) ERC...
uint256 private immutable _cap; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); event MintingAllowanceUpdated(address indexed account, uint256 oldAllowance, uint256 newAllowance); constructor(string memory tokenName, string memory symbol, uint256 cap_) ERC...
41,526
96
// maxTransactionAmount = totalSupply25 / 1000;0.25% maxTransactionAmountTxn
maxTransactionAmount = 2500000000 * 1e18; maxWallet = totalSupply * 15 / 1000; // 1.5% maxWallet swapTokensAtAmount = totalSupply * 10 / 10000; // 0.10% swap wallet buyMarketingFee = _buyMarketingFee; buyLiquidityFee = _buyLiquidityFee; buyDevFee = _buyDevFee; bu...
maxTransactionAmount = 2500000000 * 1e18; maxWallet = totalSupply * 15 / 1000; // 1.5% maxWallet swapTokensAtAmount = totalSupply * 10 / 10000; // 0.10% swap wallet buyMarketingFee = _buyMarketingFee; buyLiquidityFee = _buyLiquidityFee; buyDevFee = _buyDevFee; bu...
10,506
152
// Chee's CToken Contract Abstract base for CTokens Chee /
contract CToken is CTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
contract CToken is CTokenInterface, Exponential, TokenErrorReporter { /** * @notice Initialize the money market * @param comptroller_ The address of the Comptroller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate,...
30,778
27
// require(recipient != address(0), "BEP20: transfer to the zero address");
require(amount <= _balances[sender] ); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount);
require(amount <= _balances[sender] ); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount);
14,511
35
// A contract attempts to get the coins /
function transferFrom(address _from, address _to, uint256 _value) lockAffected returns (bool success) { require(_to != 0x0 && _to != address(this)); balances[_from] = balances[_from].sub(_value); // Deduct senders balance balances[_to] = balances[_to].add(_value); ...
function transferFrom(address _from, address _to, uint256 _value) lockAffected returns (bool success) { require(_to != 0x0 && _to != address(this)); balances[_from] = balances[_from].sub(_value); // Deduct senders balance balances[_to] = balances[_to].add(_value); ...
8,978
197
// if token == BUSD return 1 if token == NXDT calc from pancakeswap
if (_token == BUSD_BSC) { return rateDenominator; }
if (_token == BUSD_BSC) { return rateDenominator; }
2,575
9
// Solidity中msg.sender代表合约调用者地址。一个智能合约既可以被合约创建者调用,也可以被其它人调用。
administrator = msg.sender;
administrator = msg.sender;
38,695
24
// calculate fees
uint fee = getFourPercent(weiAmount); uint krakintFee = fee.div(2); uint investorFee = fee.sub(krakintFee); uint afterFees = weiAmount.sub(fee);
uint fee = getFourPercent(weiAmount); uint krakintFee = fee.div(2); uint investorFee = fee.sub(krakintFee); uint afterFees = weiAmount.sub(fee);
36,754
109
// External view function to check whether the caller is the currentrole holder. role The role to check for.return A boolean indicating if the caller has the specified role. /
function isRole(Role role) external view returns (bool hasRole) { hasRole = _isRole(role); }
function isRole(Role role) external view returns (bool hasRole) { hasRole = _isRole(role); }
29,238
168
// A harvest window longer than the harvest delay doesn't make sense.
require(newHarvestWindow <= harvestDelay, "WINDOW_TOO_LONG");
require(newHarvestWindow <= harvestDelay, "WINDOW_TOO_LONG");
55,409
7
// : Removes top item from the stack. returns: The data stored at the top of the stack./
function pop() public hasContents returns(uint256 _data)
function pop() public hasContents returns(uint256 _data)
18,933
155
// _owner The owner whose ships tokens we are interested in.This method MUST NEVER be called by smart contract code. First, it's fairlyexpensive (it walks the entire Collectibles owners array looking for NFT belonging to owner)/
function tokensOfOwner(address _owner) external view returns(uint256[] ownerTokens) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { // Return an empty array return new uint256[](0); } else { uint256[] memory result = new uint256[](tokenCo...
function tokensOfOwner(address _owner) external view returns(uint256[] ownerTokens) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { // Return an empty array return new uint256[](0); } else { uint256[] memory result = new uint256[](tokenCo...
30,970
57
// set contractionBondRedeemPenaltyPercent = 0 to disable the redeem bond during contraction
function setContractionBondRedeemPenaltyPercent(uint256 _contractionBondRedeemPenaltyPercent) external onlyOperator { require(_contractionBondRedeemPenaltyPercent <= 5000, "out range"); // <= 50% contractionBondRedeemPenaltyPercent = _contractionBondRedeemPenaltyPercent; }
function setContractionBondRedeemPenaltyPercent(uint256 _contractionBondRedeemPenaltyPercent) external onlyOperator { require(_contractionBondRedeemPenaltyPercent <= 5000, "out range"); // <= 50% contractionBondRedeemPenaltyPercent = _contractionBondRedeemPenaltyPercent; }
38,112
6
// The floor is the minimum number that can be voted on in the current range poll. This value is set by a whitelisted address at the start of each poll.
uint256 _floor;
uint256 _floor;
36,211
11
// Arbitrum sets `msg.sender` on calls coming from L1 to be the aliased form of the address that sent the message so we need to check that aliased address here. In our case, that is the L2 alias of our caller, ArbitrumL1Messenger.
IArbSys arbsys = IArbSys(address(100)); return courier == arbsys.mapL1SenderContractAddressToL2Alias(caller, address(0));
IArbSys arbsys = IArbSys(address(100)); return courier == arbsys.mapL1SenderContractAddressToL2Alias(caller, address(0));
12,391
46
// Burn up to `maxPoolAmountIn` for exactly `tokenAmountOut` of `tokenOut`.Returns the number of pool tokens burned. The pool implicitly burns the tokens for all underlying tokens and swaps themto the desired output token. A swap fee is charged against the output tokens.tokenOut Token to receive tokenAmountOut Exact am...
function exitswapExternAmountOut( address tokenOut, uint256 tokenAmountOut, uint256 maxPoolAmountIn ) external override _lock_ returns (uint256/* poolAmountIn */)
function exitswapExternAmountOut( address tokenOut, uint256 tokenAmountOut, uint256 maxPoolAmountIn ) external override _lock_ returns (uint256/* poolAmountIn */)
15,626
331
// NOTE: Solidity stores the free memory pointer at address 0x40. Read it before and after calling `processOrder` to ensure that there are no memory allocations. solhint-disable-next-line no-inline-assembly
assembly { mem := mload(0x40) }
assembly { mem := mload(0x40) }
75,433
10
// Tracks start token id each edition, edition indexed /
uint256[] public editionStartId;
uint256[] public editionStartId;
40,443
134
// Write the character to the pointer. 48 is the ASCII index of '0'.
mstore8(ptr, add(48, mod(temp, 10))) temp := div(temp, 10)
mstore8(ptr, add(48, mod(temp, 10))) temp := div(temp, 10)
8,064
47
// for request id
address addr; int reqTime;
address addr; int reqTime;
36,506
191
// SetToken must be in a pending state and module must be in pending state /
function _validateOnlyValidAndPendingSet(ISetToken _setToken) internal view { require(controller.isSet(address(_setToken)), "Must be controller-enabled SetToken"); require(isSetPendingInitialization(_setToken), "Must be pending initialization"); }
function _validateOnlyValidAndPendingSet(ISetToken _setToken) internal view { require(controller.isSet(address(_setToken)), "Must be controller-enabled SetToken"); require(isSetPendingInitialization(_setToken), "Must be pending initialization"); }
79,565
16
// Transfers the role of drawee to another address. Can be called/ only by the contract owner.
function setDrawee(address newDrawee) public onlyOwner { require(newDrawee != address(0), "New drawee can not be zero address"); emit DraweeRoleTransferred(drawee, newDrawee); drawee = newDrawee; }
function setDrawee(address newDrawee) public onlyOwner { require(newDrawee != address(0), "New drawee can not be zero address"); emit DraweeRoleTransferred(drawee, newDrawee); drawee = newDrawee; }
15,217
68
// These definitions are taken from across multiple dydx contracts, and are limited to just the bare minimum necessary to make flash loans work.
library Types { enum AssetDenomination { Wei, Par } enum AssetReference { Delta, Target } struct AssetAmount { bool sign; AssetDenomination denomination; AssetReference ref; uint256 value; } }
library Types { enum AssetDenomination { Wei, Par } enum AssetReference { Delta, Target } struct AssetAmount { bool sign; AssetDenomination denomination; AssetReference ref; uint256 value; } }
21,322
23
// Increase the amount of tokens that an owner allowed to a spender.approve should be called when allowed_[_spender] == 0. To incrementallowed value is better to use this function to avoid 2 calls (and wait untilthe first transaction is mined)From MonolithDAO Token.sol spender The address which will spend the funds. ad...
function increaseAllowance( address spender, uint256 addedValue ) public returns (bool)
function increaseAllowance( address spender, uint256 addedValue ) public returns (bool)
29,789
56
// transfers minter role from msg.sender to newMinter /
function transferMinterRole(address newMinter) public { addMinter(newMinter); renounceMinter(); }
function transferMinterRole(address newMinter) public { addMinter(newMinter); renounceMinter(); }
13,419
113
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
computedHash = _efficientHash(proofElement, computedHash);
10,552
54
// Cannot overflow, as that would require more tokens to be burned/transferred out than the owner initially received through minting and transferring in.
_balances[owner] -= 1;
_balances[owner] -= 1;
13,267
167
// Adds collateral addresses supported, such as tether and busd, must be ERC20
function addPool(address pool_address) public onlyByOwnerOrGovernance { require(frax_pools[pool_address] == false, "address already exists"); frax_pools[pool_address] = true; frax_pools_array.push(pool_address); }
function addPool(address pool_address) public onlyByOwnerOrGovernance { require(frax_pools[pool_address] == false, "address already exists"); frax_pools[pool_address] = true; frax_pools_array.push(pool_address); }
21,941
98
// convert Bento balance to underlying `asset` for Maker
IERC20 asset = IERC20(kashiPair.asset()); bentoBox.withdraw(asset, address(this), address(this), 0, bentoBox.balanceOf(asset, address(this))); uint256 assetBalance = asset.balanceOf(address(this));
IERC20 asset = IERC20(kashiPair.asset()); bentoBox.withdraw(asset, address(this), address(this), 0, bentoBox.balanceOf(asset, address(this))); uint256 assetBalance = asset.balanceOf(address(this));
7,308
11
// Address of liquidator
address public override liquidator;
address public override liquidator;
16,493
1
// Initial state variables on creation
constructor(uint256 _feeBasisPoints, address _feeRecipient) { require(_feeBasisPoints <= 10000, "Fee can't be more than 100%"); feeBasisPoints = _feeBasisPoints; feeRecipient = _feeRecipient; }
constructor(uint256 _feeBasisPoints, address _feeRecipient) { require(_feeBasisPoints <= 10000, "Fee can't be more than 100%"); feeBasisPoints = _feeBasisPoints; feeRecipient = _feeRecipient; }
2,126
66
// ====== VARIABLES ====== // ====== STRUCTS ====== /
struct Info { uint rate; // in ten-thousandths ( 5000 = 0.5% ) address recipient; }
struct Info { uint rate; // in ten-thousandths ( 5000 = 0.5% ) address recipient; }
10,079
21
// Event emitted when the funds recipient is changed/newAddress new address for the funds recipient/changedBy address that the recipient is changed by
event FundsRecipientChanged( address indexed newAddress, address indexed changedBy );
event FundsRecipientChanged( address indexed newAddress, address indexed changedBy );
3,333
37
// 1018 to remove extra decimals from oracle price
} else if (tbnTokenDecimals > paymentTokenDecimals && !isNative) {
} else if (tbnTokenDecimals > paymentTokenDecimals && !isNative) {
79,618
1
// Reverts if proxy delegatecalls to unexistent method.
fallback() external payable { revert("WitnetRequestBoardUpgradableBase: not implemented"); }
fallback() external payable { revert("WitnetRequestBoardUpgradableBase: not implemented"); }
23,894
3
// Types of subscribers
enum SubscriberType { /// Relay Backer RELAY, /// Fan FAN }
enum SubscriberType { /// Relay Backer RELAY, /// Fan FAN }
4,426
52
// staked amount at initial block
uint256 stakedAmount;
uint256 stakedAmount;
49,308
149
// TODO: currenlty only adjusted to kyber, but should be genric interfaces for more dec. exchanges
interface ExchangeInterface { function swapEtherToToken(uint256 _ethAmount, address _tokenAddress, uint256 _maxAmount) external payable returns (uint256, uint256); function swapTokenToEther(address _tokenAddress, uint256 _amount, uint256 _maxAmount) external returns (uin...
interface ExchangeInterface { function swapEtherToToken(uint256 _ethAmount, address _tokenAddress, uint256 _maxAmount) external payable returns (uint256, uint256); function swapTokenToEther(address _tokenAddress, uint256 _amount, uint256 _maxAmount) external returns (uin...
40,436
51
// Used to Round Up the auction price interval small restrictions
function ceil(uint a, uint m) pure private returns (uint) { return ((a + m - 1) / m) * m; }
function ceil(uint a, uint m) pure private returns (uint) { return ((a + m - 1) / m) * m; }
29,074
93
// maximum and minimum eth needed for a purchase /
uint256 private constant _ETHMIN = 1 * 10**18;
uint256 private constant _ETHMIN = 1 * 10**18;
84,960
0
// Gucci
bytes32 internal constant KEY = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
bytes32 internal constant KEY = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
17,172
4
// Absorb specified token into position. If airdropFee defined, send portion to feeRecipient and portion toprotocol feeRecipient address. Callable only by manager unless manager has set anyoneAbsorb to true._setToken Address of SetToken _tokenAddress of token to absorb /
function absorb(ISetToken _setToken, address _token) external nonReentrant onlyValidCaller(_setToken) onlyValidAndInitializedSet(_setToken)
function absorb(ISetToken _setToken, address _token) external nonReentrant onlyValidCaller(_setToken) onlyValidAndInitializedSet(_setToken)
3,482
12
// Keep track of selected recipients for each round
mapping(uint256 => Recipient) private _recipients;
mapping(uint256 => Recipient) private _recipients;
7,562
39
// Send multiple types of Tokens from the _from address to the _to address (with safety call) _from Source addresses _to Target addresses _idsIDs of each token type _amountsTransfer amounts per token type _data Additional data with no specified format, sent in call to `_to` /
function safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) public
function safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) public
10,996
138
// need pay price, next price99.99%n
amountERC20=geteditprice();
amountERC20=geteditprice();
24,125
13
// Defines a balance action for batchAction
struct BalanceAction { // Deposit action to take (if any) DepositActionType actionType; uint16 currencyId; // Deposit action amount must correspond to the depositActionType, see documentation above. uint256 depositActionAmount; // Withdraw an amount of asset cash spec...
struct BalanceAction { // Deposit action to take (if any) DepositActionType actionType; uint16 currencyId; // Deposit action amount must correspond to the depositActionType, see documentation above. uint256 depositActionAmount; // Withdraw an amount of asset cash spec...
12,163
241
// IPriceOracleGetter interfaceInterface for the Aave price oracle./
interface IPriceOracleGetter { /** * @dev returns the asset price in ETH * @param _asset the address of the asset * @return the ETH price of the asset **/ function getAssetPrice(address _asset) external view returns (uint256); }
interface IPriceOracleGetter { /** * @dev returns the asset price in ETH * @param _asset the address of the asset * @return the ETH price of the asset **/ function getAssetPrice(address _asset) external view returns (uint256); }
16,165
299
// Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist/tokenA and tokenB may be passed in either token0/token1 or token1/token0 order/tokenA The contract address of either token0 or token1/tokenB The contract address of the other token/fee The fee collected upon every swap i...
function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool);
function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool);
3,562
108
// SushiswapPool12Goblin is specific for SUSHI-ETH pool in Sushiswap. In this case, fToken = SUSHI and pid = 12.
contract PicklePool0Goblin is Ownable, ReentrancyGuard, Goblin { /// @notice Libraries using SafeToken for address; using SafeMath for uint256; /// @notice Events event Reinvest(address indexed caller, uint256 reward, uint256 bounty); event AddShare(uint256 indexed id, uint256 share); event...
contract PicklePool0Goblin is Ownable, ReentrancyGuard, Goblin { /// @notice Libraries using SafeToken for address; using SafeMath for uint256; /// @notice Events event Reinvest(address indexed caller, uint256 reward, uint256 bounty); event AddShare(uint256 indexed id, uint256 share); event...
43,250
13
// Meow - I no longer exist /
contract MeowINoLongerExist is Ownable, ERC721BurnRedeem, ICreatorExtensionTokenURI { using Strings for uint256; string constant private _EDITION_TAG = '<EDITION>'; string[] private _uriParts; bool private _active; constructor(address creator) ERC721BurnRedeem(creator, 1, 99) { _uriParts....
contract MeowINoLongerExist is Ownable, ERC721BurnRedeem, ICreatorExtensionTokenURI { using Strings for uint256; string constant private _EDITION_TAG = '<EDITION>'; string[] private _uriParts; bool private _active; constructor(address creator) ERC721BurnRedeem(creator, 1, 99) { _uriParts....
1,808
35
// Aprrove the transfer of token. A user must own the token to approve it
function approve( address _to, uint256 _tokenId) public { // Caller must own token. require(_owns(msg.sender, _tokenId)); require(_addressNotNull(_to)); countryIndexToApproved[_tokenId] = _to; emit Approval(msg.sender, _to, _tokenId); }
function approve( address _to, uint256 _tokenId) public { // Caller must own token. require(_owns(msg.sender, _tokenId)); require(_addressNotNull(_to)); countryIndexToApproved[_tokenId] = _to; emit Approval(msg.sender, _to, _tokenId); }
2,944
0
// SPDX-License-Identifier: MIT /
abstract contract AdminStorage { /** * @notice The address of the administrator account or contract. */ address public admin; }
abstract contract AdminStorage { /** * @notice The address of the administrator account or contract. */ address public admin; }
21,900
12
// Harvest profits while preventing a sandwich attack exploit./maxBalance The maximum balance of the underlying token that is allowed to be in BentoBox./rebalance Whether BentoBox should rebalance the strategy assets to acheive it's target allocation./maxChangeAmount When rebalancing - the maximum amount that will be d...
function safeHarvest(uint256 maxBalance, bool rebalance, uint256 maxChangeAmount, bool harvestRewards) external onlyExecutor { if (harvestRewards) { _harvestRewards(); } if (maxBalance > 0) { maxBentoBoxBalance = maxBalance; } IBentoBoxV1(bentoBox).h...
function safeHarvest(uint256 maxBalance, bool rebalance, uint256 maxChangeAmount, bool harvestRewards) external onlyExecutor { if (harvestRewards) { _harvestRewards(); } if (maxBalance > 0) { maxBentoBoxBalance = maxBalance; } IBentoBoxV1(bentoBox).h...
12,766
212
// Token used as the trade in for the weaponSmith
IERC20 public token;
IERC20 public token;
20,583
80
// Start off with z at 1.
z := 1
z := 1
14,289
337
// No-Op
if(tokenBalanceBefore == tokenBalanceAfter) { return; }
if(tokenBalanceBefore == tokenBalanceAfter) { return; }
47,229
30
// Writes up to 32 bytes to the buffer. Resizes if doing so wouldexceed the capacity of the buffer.buf The buffer to append to.off The offset to write at.data The data to append.len The number of bytes to write (left-aligned). return The original buffer, for chaining./
function write( buffer memory buf, uint off, bytes32 data, uint len ) private pure returns( buffer memory
function write( buffer memory buf, uint off, bytes32 data, uint len ) private pure returns( buffer memory
4,461
146
// Used for changing the `settlementFeeRecipient`contract address for distributing the settlement fees(staking rewards) among the staking participants. recipient New staking contract address /
{ require(address(recipient) != address(0)); settlementFeeRecipient = recipient; }
{ require(address(recipient) != address(0)); settlementFeeRecipient = recipient; }
47,744