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
9
// @custom:security-contact be-prosperous@luckois.com
contract LucKois is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable, ERC721Burnable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; constructor() ERC721("LucKois", "LUCKOIS") {} function _baseURI() internal pure override returns (string memory) { ...
contract LucKois is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable, ERC721Burnable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; constructor() ERC721("LucKois", "LUCKOIS") {} function _baseURI() internal pure override returns (string memory) { ...
4,291
13
// Request subscription owner transfer. subId - ID of the subscription newOwner - proposed new owner of the subscription /
function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;
function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;
2,718
65
// Returns the downcasted int56 from int256, reverting onoverflow (when the input is less than smallest int56 orgreater than largest int56). Counterpart to Solidity's `int56` operator. Requirements: - input must fit into 56 bits _Available since v4.7._ /
function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); require(downcasted == value, "SafeCast: value doesn't fit in 56 bits"); }
function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); require(downcasted == value, "SafeCast: value doesn't fit in 56 bits"); }
15,345
10
// public information how much the user received money
mapping(address => uint) public investor_payout;
mapping(address => uint) public investor_payout;
9,647
124
// Set next 3 bits to fuel type
uint8 fuelType = uint8(fuelBurn.fuelType); amountAndFuel |= uint256(fuelType) << 96;
uint8 fuelType = uint8(fuelBurn.fuelType); amountAndFuel |= uint256(fuelType) << 96;
36,056
4
// ---------------------------------------------------------------------------- Safe maths ----------------------------------------------------------------------------
contract SafeMath { function safeAdd(uint a, uint b) public pure returns (uint c) { c = a + b; require(c >= a); } function safeSub(uint a, uint b) public pure returns (uint c) { require(b <= a); ...
contract SafeMath { function safeAdd(uint a, uint b) public pure returns (uint c) { c = a + b; require(c >= a); } function safeSub(uint a, uint b) public pure returns (uint c) { require(b <= a); ...
3,997
4
// Creates the token description given its components and what type it is
function componentsToString(uint256[5] memory components, uint256 itemType) public view returns (string memory)
function componentsToString(uint256[5] memory components, uint256 itemType) public view returns (string memory)
5,947
5
// Build if the required amount of the OAS tokens is deposited. _builder Address of the Verse-Builder. /
function build(address _builder) external { require(msg.sender == agentAddress, "only L1BuildAgent can call me"); require(depositTotal[_builder] >= requiredAmount, "deposit amount shortage"); require(buildBlock[_builder] == 0, "already built by builder"); buildBlock[_builder] = bloc...
function build(address _builder) external { require(msg.sender == agentAddress, "only L1BuildAgent can call me"); require(depositTotal[_builder] >= requiredAmount, "deposit amount shortage"); require(buildBlock[_builder] == 0, "already built by builder"); buildBlock[_builder] = bloc...
22,881
20
// function primarySaleRecipient() public view returns (address);
// function setPrimarySaleRecipient(address saleRecipient) external { // };
// function setPrimarySaleRecipient(address saleRecipient) external { // };
18,376
72
// An address can't transfer to itself.
require(_holder != _recipient, "TicketBooth::transfer: IDENTITY");
require(_holder != _recipient, "TicketBooth::transfer: IDENTITY");
29,486
77
// Atomically change a set of role assignments
function setUserRoles( address[] subjects, bytes32[] roles, IAccessControlled[] objects, TriState[] newValues ) public only(ROLE_ACCESS_CONTROLLER)
function setUserRoles( address[] subjects, bytes32[] roles, IAccessControlled[] objects, TriState[] newValues ) public only(ROLE_ACCESS_CONTROLLER)
52,494
392
// if enabled TCAP can't be minted if the total supply is above or equal the cap value
bool public capEnabled = false;
bool public capEnabled = false;
32,310
25
// Returns the current total borrows plus accrued interestreturn The total borrows with interest /
function totalBorrowsCurrent() external nonReentrant returns (uint256) { require(accrueInterest() == uint256(Error.NO_ERROR), "T7"); return totalBorrows; }
function totalBorrowsCurrent() external nonReentrant returns (uint256) { require(accrueInterest() == uint256(Error.NO_ERROR), "T7"); return totalBorrows; }
4,991
2
// v.11.7
struct Receipt { string patient_wallet_string; uint256 rxId; }
struct Receipt { string patient_wallet_string; uint256 rxId; }
17,079
60
// Function to add minter address. return True if the operation was successful./
function addMinter( address _minter) public onlyOwner canMint
function addMinter( address _minter) public onlyOwner canMint
17,103
11
// Set the tokenURI for a tokenId/can only be called by the admin
function setTokenURI(uint256 tokenId, string calldata tokenUri) external onlyAdmin { require(bytes(tokenUri).length > 0, "NFT: uri should be set"); super._setTokenURI(tokenId, tokenUri); }
function setTokenURI(uint256 tokenId, string calldata tokenUri) external onlyAdmin { require(bytes(tokenUri).length > 0, "NFT: uri should be set"); super._setTokenURI(tokenId, tokenUri); }
22,602
553
// EVENTS / Emitted when a new proposal is created.
event NewProposal(uint256 indexed id, Transaction[] transactions);
event NewProposal(uint256 indexed id, Transaction[] transactions);
1,757
192
// Deposit of l1Addr on L1
uint256 deposit;
uint256 deposit;
54,652
648
// Mock variables to create edge cases
uint256 public subtractSourceAmount; uint256 public subtractOutputAmount;
uint256 public subtractSourceAmount; uint256 public subtractOutputAmount;
27,343
22
// Amount claimable
function _calculateClaim( LibLockTOSDividend.Distribution storage _distr, uint256 _lockId, uint256 _startEpoch, uint256 _endEpoch
function _calculateClaim( LibLockTOSDividend.Distribution storage _distr, uint256 _lockId, uint256 _startEpoch, uint256 _endEpoch
70,030
39
// mapping(address => uint256) public interestPool;
mapping(uint256 => uint256) public USDCInterest; mapping(uint256 => uint256) public OROInterest; mapping(address => uint256[]) public loanHolders; uint256 public k = 1; uint256 public dailyOROdistribution = 10E18; // has to be set in 18 decimals mapping(address => uint256) public totalstakings;...
mapping(uint256 => uint256) public USDCInterest; mapping(uint256 => uint256) public OROInterest; mapping(address => uint256[]) public loanHolders; uint256 public k = 1; uint256 public dailyOROdistribution = 10E18; // has to be set in 18 decimals mapping(address => uint256) public totalstakings;...
41,239
3
// asset types 0-native, 1-ERC20, 2-ERC721, 3-ERC1155
enum Assets { Native, ERC20, ERC721, ERC1155 }
enum Assets { Native, ERC20, ERC721, ERC1155 }
31,112
28
// The SSTORE2 storage pointer for immutable collection data./These values are exposed via name/symbol/contractURI views.
address internal immutableStoragePointer;
address internal immutableStoragePointer;
37,984
1
// The active conditions for claiming tokens.
ClaimConditionList public claimCondition; /*/////////////////////////////////////////////////////////////// Drop logic
ClaimConditionList public claimCondition; /*/////////////////////////////////////////////////////////////// Drop logic
24,946
10
// Total number of bounty tokens distributed to accounts/
function getDistribution() public view returns (uint256) { return _allocation.sub(_totalSupply); }
function getDistribution() public view returns (uint256) { return _allocation.sub(_totalSupply); }
11,391
214
// A mapping containing a summary of every epoch
mapping(uint24 => EpochSummary) public summaries;
mapping(uint24 => EpochSummary) public summaries;
39,924
207
// Add your own name here, suggestion e.g. "StrategyCreamYFI"
return string(abi.encodePacked("SingleSidedBalancer ", bpt.symbol(), "Pool ", ERC20(address(want)).symbol()));
return string(abi.encodePacked("SingleSidedBalancer ", bpt.symbol(), "Pool ", ERC20(address(want)).symbol()));
10,096
29
// Private: Add resources
function _addResources(address[] _conts, bytes4[] _funcs) private returns (bool)
function _addResources(address[] _conts, bytes4[] _funcs) private returns (bool)
28,006
91
// Retrieve the symbol of the token. /
function symbol() public view returns(bytes32)
function symbol() public view returns(bytes32)
41,350
28
// Fetches most recent priceCoeff from the balancer pool.PriceCoeff = units of MTA per BPT, scaled to 1:1 = 10000Assuming an 80/20 BPT, it is possible to calculatePriceCoeff (p) = balanceOfMTA in pool (b) / bpt supply (s) / 0.8p = b1.25 / s /
function getProspectivePriceCoefficient() public view returns (uint256 newPriceCoeff) { (address[] memory tokens, uint256[] memory balances, ) = balancerVault.getPoolTokens( poolId ); require(tokens[0] == address(REWARDS_TOKEN), "not MTA"); // Calculate units of MTA per ...
function getProspectivePriceCoefficient() public view returns (uint256 newPriceCoeff) { (address[] memory tokens, uint256[] memory balances, ) = balancerVault.getPoolTokens( poolId ); require(tokens[0] == address(REWARDS_TOKEN), "not MTA"); // Calculate units of MTA per ...
63,061
15
// executor: address(0),
open: true, initiated: now, closed: 0
open: true, initiated: now, closed: 0
22,914
268
// See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length. /
function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
659
195
// Save the debt entry parameters
issuanceData[account].initialDebtOwnership = debtPercentage; issuanceData[account].debtEntryIndex = debtLedger.length;
issuanceData[account].initialDebtOwnership = debtPercentage; issuanceData[account].debtEntryIndex = debtLedger.length;
6,114
316
// Returns the mocked timestamp if it was set, or current `block.timestamp`/
function getTimestamp() internal view returns (uint256) { if (mockedTimestamp != 0) return mockedTimestamp; return super.getTimestamp(); }
function getTimestamp() internal view returns (uint256) { if (mockedTimestamp != 0) return mockedTimestamp; return super.getTimestamp(); }
46,444
11
// calculate fee growth above
uint256 feeGrowthAbove0X128; uint256 feeGrowthAbove1X128; if (tickCurrent < tickUpper) { feeGrowthAbove0X128 = upper.feeGrowthOutside0X128; feeGrowthAbove1X128 = upper.feeGrowthOutside1X128; } else {
uint256 feeGrowthAbove0X128; uint256 feeGrowthAbove1X128; if (tickCurrent < tickUpper) { feeGrowthAbove0X128 = upper.feeGrowthOutside0X128; feeGrowthAbove1X128 = upper.feeGrowthOutside1X128; } else {
23,633
85
// Request payout dividend (claim) (requested by tokenHolder -> pull)dividends that have not been claimed within 330 days expire and cannot be claimed anymore by the token holder. /
function claimDividend() public returns (bool) { // unclaimed dividend fractions should expire after 330 days and the owner can reclaim that fraction require(dividendEndTime > 0 && dividendEndTime.sub(claimTimeout) > now); updateDividend(msg.sender); uint256 payment = unclaimedDivi...
function claimDividend() public returns (bool) { // unclaimed dividend fractions should expire after 330 days and the owner can reclaim that fraction require(dividendEndTime > 0 && dividendEndTime.sub(claimTimeout) > now); updateDividend(msg.sender); uint256 payment = unclaimedDivi...
19,025
66
// Function to withdraw a portion of the component tokens of a Set This function should be used in the event that a component token has beenpaused for transfer temporarily or permanently. This allows users amethod to withdraw tokens in the event that one token has been frozen. The mask can be computed by summing the po...
function partialRedeem(uint _quantity, bytes32 _componentsToExclude) public isMultipleOfNaturalUnit(_quantity) isNonZero(_quantity) hasSufficientBalance(_quantity) returns (bool success)
function partialRedeem(uint _quantity, bytes32 _componentsToExclude) public isMultipleOfNaturalUnit(_quantity) isNonZero(_quantity) hasSufficientBalance(_quantity) returns (bool success)
32,745
12
// contract ownership status/
contract owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwners...
contract owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwners...
34,067
41
// from seller
if (!inSwap && from != uniswapV2Pair && tradingOpen) { require(amount <= 1e8 * 10**9); if(sellCooldownEnabled) { require(cooldown[from] < block.timestamp, "Your transaction cooldown has not expired."); cooldown[from] = block.timestamp +...
if (!inSwap && from != uniswapV2Pair && tradingOpen) { require(amount <= 1e8 * 10**9); if(sellCooldownEnabled) { require(cooldown[from] < block.timestamp, "Your transaction cooldown has not expired."); cooldown[from] = block.timestamp +...
43,457
291
// Allows for the distribution of Ether to be transferred to multiple recipients at a time._recipients The list of addresses which will receive tokens._values The corresponding amounts that the recipients will receive_affiliateAddress The affiliate address that is paid a commission.affiliated with a partner, they will ...
function multiValueEthAirdrop(address[] memory _recipients, uint256[] memory _values, address _affiliateAddress) public payable returns(bool) { require(_recipients.length == _values.length, "Total number of recipients and values are not equal"); uint256 totalEthValue = _getTotalEthValue(_values); ...
function multiValueEthAirdrop(address[] memory _recipients, uint256[] memory _values, address _affiliateAddress) public payable returns(bool) { require(_recipients.length == _values.length, "Total number of recipients and values are not equal"); uint256 totalEthValue = _getTotalEthValue(_values); ...
44,136
0
// Bridge Client Interface This should be implemented every part of pool or other logic instead pool /
interface BridgeClientInterface { /** * @notice filling commitment about executed tx in another part of pool */ function setPendingRequestsDone(bytes32 requestId ,bytes32 tx_fromNet2) external; }
interface BridgeClientInterface { /** * @notice filling commitment about executed tx in another part of pool */ function setPendingRequestsDone(bytes32 requestId ,bytes32 tx_fromNet2) external; }
6,481
22
// This value is multiplied with priceDeviationCumulative
int Ki; // [EIGHTEEN_DECIMAL_NUMBER]
int Ki; // [EIGHTEEN_DECIMAL_NUMBER]
5,677
60
// Amount of GD tokens that was minted to the `ubiCollector`
uint256 gdUbiTransferred );
uint256 gdUbiTransferred );
51,510
88
// Transfer of rewards
rewardCap[tokenAddress] = rewardCap[tokenAddress].sub(amount); require( IERC20(tokenAddress).transfer(userAddress, amount), "Transfer failed" );
rewardCap[tokenAddress] = rewardCap[tokenAddress].sub(amount); require( IERC20(tokenAddress).transfer(userAddress, amount), "Transfer failed" );
22,483
7
// Transfer event as defined in current draft of ERC721. Emitted every time a kitten/ownership is assigned, including births.
event Transfer(address from, address to, uint256 tokenId);
event Transfer(address from, address to, uint256 tokenId);
5,868
0
// map token ID to
uint32 bidIncreasePercentage; uint32 auctionBidPeriod; //Increments the length of time the auction is open in which a new bid can be made after each bid. uint64 auctionEnd; uint32 auctionClosePeriod; uint128 minPrice; uint128 nftHighestBid; address nftHighestBidde...
uint32 bidIncreasePercentage; uint32 auctionBidPeriod; //Increments the length of time the auction is open in which a new bid can be made after each bid. uint64 auctionEnd; uint32 auctionClosePeriod; uint128 minPrice; uint128 nftHighestBid; address nftHighestBidde...
978
20
// Add updaters and modify threshold The caller must have the `DEFAULT_ADMIN_ROLE` newUpdaters New updater addresses newThreshold New threshold /
function addUpdaters(address[] memory newUpdaters, uint256 newThreshold) onlyAdmins external override { for(uint i; i< newUpdaters.length; i++) { _setupRole(UPDATER_ROLE, newUpdaters[i]); } _setUpdateThreshold(newThreshold); }
function addUpdaters(address[] memory newUpdaters, uint256 newThreshold) onlyAdmins external override { for(uint i; i< newUpdaters.length; i++) { _setupRole(UPDATER_ROLE, newUpdaters[i]); } _setUpdateThreshold(newThreshold); }
22,302
52
// transfer :star
require( givePoint(star, _to, _reset) );
require( givePoint(star, _to, _reset) );
35,605
61
// Play in lottery with own numbers _partner Affiliate partner /
function playSystem(uint _hash, address _partner) payable public returns (uint) { won(); // check if player did not win uint24 bethash = uint24(_hash); require(msg.value <= 1 ether && msg.value < hashBetMax); if(msg.value > 0){ if(investStart==0) { // dividends only afte...
function playSystem(uint _hash, address _partner) payable public returns (uint) { won(); // check if player did not win uint24 bethash = uint24(_hash); require(msg.value <= 1 ether && msg.value < hashBetMax); if(msg.value > 0){ if(investStart==0) { // dividends only afte...
1,487
210
// Transfers tokens from msg.sender to a recipient/Errors with ST if transfer fails/token The contract address of the token which will be transferred/to The recipient of the transfer/value The value of the transfer
function safeTransfer( address token, address to, uint256 value
function safeTransfer( address token, address to, uint256 value
4,159
11
// Extension of BeaconOracle that is intended to be deployed on Mainnet to give financialcontracts on non-Mainnet networks the ability to trigger cross-chain price requests to the Mainnet DVM. This contractis responsible for triggering price requests originating from non-Mainnet, and broadcasting resolved price databac...
contract SourceOracle is BeaconOracle { constructor(address _finderAddress, uint8 _chainID) BeaconOracle(_finderAddress, _chainID) {} /*************************************************************** * Publishing Price Request Data to L2: ***************************************************************...
contract SourceOracle is BeaconOracle { constructor(address _finderAddress, uint8 _chainID) BeaconOracle(_finderAddress, _chainID) {} /*************************************************************** * Publishing Price Request Data to L2: ***************************************************************...
18,045
99
// all fees go to the other side
oneSideFeesInVcash = oneSideFeesInVcash.mul(2);
oneSideFeesInVcash = oneSideFeesInVcash.mul(2);
55,861
14
// allowList mapping 1=oasis;2=allowlist;0=not on list
mapping(address => uint8) public allowList; mapping(address => uint256) public allowListMinted; mapping(uint256 => uint8) public oasisPassMints;
mapping(address => uint8) public allowList; mapping(address => uint256) public allowListMinted; mapping(uint256 => uint8) public oasisPassMints;
1,926
14
// Configuration of price changes.
DutchAuctionConfig public dutchAuctionConfig;
DutchAuctionConfig public dutchAuctionConfig;
5,816
867
// Number of blocks voting will be held (e.g. 17280 blocks ~ 3 days of blocks)
uint32 votingPeriod;
uint32 votingPeriod;
35,159
11
// withdraw cash
IAssetManager(AM()).withdraw(investor, cashAmount, scale); _burn(investor, exitAmount); emit PoolExited(investor, exitAmount);
IAssetManager(AM()).withdraw(investor, cashAmount, scale); _burn(investor, exitAmount); emit PoolExited(investor, exitAmount);
43,358
11
// pending rewards awaiting anyone to update
uint256 public pendingRewards;
uint256 public pendingRewards;
9,617
506
// Update the voting period. This operation can only be performed/ through a governance proposal. Emits a `VotingPeriodSet` event.
function setVotingPeriod(uint256 newVotingPeriod) external virtual onlyGovernance
function setVotingPeriod(uint256 newVotingPeriod) external virtual onlyGovernance
38,648
125
// Withdraw LP tokens from MasterSommelier.
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accMoutaiPerSh...
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accMoutaiPerSh...
21,352
195
// get min returns
uint256[] memory reserveMinReturnAmounts;
uint256[] memory reserveMinReturnAmounts;
33,191
20
// Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair /
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) external;
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) external;
16,965
79
// Kin token unit. Using same decimal value as ETH (makes ETH-KIN conversion much easier). This is the same as in Kin token contract.
uint256 public constant TOKEN_UNIT = 10 ** 18;
uint256 public constant TOKEN_UNIT = 10 ** 18;
44,072
22
// transfer token for a specified address_to The address to transfer to._amount The amount to be transferred./
function transfer(address _to, uint256 _amount) public returns (bool success) { require(_to != address(0)); require(balances[msg.sender] >= _amount && _amount > 0 && balances[_to].add(_amount) > balances[_to]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = ...
function transfer(address _to, uint256 _amount) public returns (bool success) { require(_to != address(0)); require(balances[msg.sender] >= _amount && _amount > 0 && balances[_to].add(_amount) > balances[_to]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = ...
1,266
3
// Default function; Gets called when Ether is deposited, and forwards it to the destination address /
function() payable { if (!destinationAddress.call.value(msg.value)(msg.data)) throw; // Fire off the deposited event if we can forward it Deposited(msg.sender, msg.value, msg.data); }
function() payable { if (!destinationAddress.call.value(msg.value)(msg.data)) throw; // Fire off the deposited event if we can forward it Deposited(msg.sender, msg.value, msg.data); }
31,259
45
// Function to mint tokens and set their URI in one action @to The address that will receive the minted tokens. @tokenId The token id to mint. @uri string URI to assign /
function mintWithTokenURI(address to, uint256 tokenId, string calldata uri) external payable enoughFunds(msg.value) canMintMod(to, tokenId) { _doMint(to, tokenId); // set token URI super._setTokenURI(tokenId, uri); }
function mintWithTokenURI(address to, uint256 tokenId, string calldata uri) external payable enoughFunds(msg.value) canMintMod(to, tokenId) { _doMint(to, tokenId); // set token URI super._setTokenURI(tokenId, uri); }
18,439
4
// @inheritdoc RoyaltyGuard
function hasAdminPermission(address _addr) public view virtual override(IRoyaltyGuard, RoyaltyGuard) returns (bool)
function hasAdminPermission(address _addr) public view virtual override(IRoyaltyGuard, RoyaltyGuard) returns (bool)
2,729
192
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == to...
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == to...
10,565
62
// if the transaction hash has not been processed yet, it should be the next expected index
require(_sourceTransferId == expectedSourceTransferId); require(_v.length >= signatoryQuorumSize); bytes32 hash = computeTransferHash(_sourceTransactionHash, _recipientContract, _data, _gas, _sourceTransferId); require(EthBridgeHelpers.hasEnoughValidSignatures(hash, _v, _r, _s, signato...
require(_sourceTransferId == expectedSourceTransferId); require(_v.length >= signatoryQuorumSize); bytes32 hash = computeTransferHash(_sourceTransactionHash, _recipientContract, _data, _gas, _sourceTransferId); require(EthBridgeHelpers.hasEnoughValidSignatures(hash, _v, _r, _s, signato...
9,945
61
// sets the requester access controller _requesterAccessController designates the address of the new requester access controller /
function setRequesterAccessController(AccessControllerInterface _requesterAccessController) public onlyOwner()
function setRequesterAccessController(AccessControllerInterface _requesterAccessController) public onlyOwner()
13,880
128
// Parses user inputs into a ZeroExV2.Order format
function __constructOrderStruct(bytes memory _encodedOrderArgs) private pure returns (IZeroExV2.Order memory order_)
function __constructOrderStruct(bytes memory _encodedOrderArgs) private pure returns (IZeroExV2.Order memory order_)
25,427
387
// if we have time remaining: convert it
if (timeRemaining > 0) {
if (timeRemaining > 0) {
38,822
7
// Transfers internal control of a name to a new account. Does not update ENS. name The name to transfer. newOwner The address of the new owner. /
function transfer(string memory name, address payable newOwner) public owner_only(name)
function transfer(string memory name, address payable newOwner) public owner_only(name)
42,661
45
// Did this player play the game in some point 1. Still playing 2. Was playing / withdraw 3. Was playing / dropped out
function isPlayerAddress(address addr) public view returns(bool) { return isPatientZero(addr) || referrals[addr] != address(0); }
function isPlayerAddress(address addr) public view returns(bool) { return isPatientZero(addr) || referrals[addr] != address(0); }
3,818
2
// AMOUNTS
uint256 public allowlistMintAmount = 2; uint256 public publicMintAmt = 1;
uint256 public allowlistMintAmount = 2; uint256 public publicMintAmt = 1;
19,926
7
// DAO member 1 - indexed
_tokenIds.increment(); uint256 newId = _tokenIds.current(); _safeMint(to, newId); return newId;
_tokenIds.increment(); uint256 newId = _tokenIds.current(); _safeMint(to, newId); return newId;
51,373
192
// View function to see pending cranes on frontend.
function pendingCrane(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accCranePerShare = pool.accCranePerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
function pendingCrane(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accCranePerShare = pool.accCranePerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
15,847
17
// Returns the number of values on the set. O(1). /
function _length(Set storage set) private view returns (uint256) { return set._values.length; }
function _length(Set storage set) private view returns (uint256) { return set._values.length; }
7,024
5
// create a new variable with empty campaigns
Campaign[] memory allCampaigns = new Campaign[](numberOfcampaigns); for(uint i = 0; i < numberOfcampaigns; i++) { Campaign storage item = campaigns[i]; allCampaigns[i] = item; }
Campaign[] memory allCampaigns = new Campaign[](numberOfcampaigns); for(uint i = 0; i < numberOfcampaigns; i++) { Campaign storage item = campaigns[i]; allCampaigns[i] = item; }
31,172
117
// transfer from for unlocked accounts/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(locked[_from] < now); return super.transferFrom(_from, _to, _value); }
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(locked[_from] < now); return super.transferFrom(_from, _to, _value); }
41,626
57
// Do not allow construction without upgrade master set. /
constructor(address _upgradeMaster) public { upgradeMaster = _upgradeMaster; }
constructor(address _upgradeMaster) public { upgradeMaster = _upgradeMaster; }
28,184
17
// split by a comma delimiter into a string array
string[] memory parts = new string[](s.count(delim) + 1); for(uint i = 0; i < parts.length; i++) { parts[i] = s.split(delim).toString(); }
string[] memory parts = new string[](s.count(delim) + 1); for(uint i = 0; i < parts.length; i++) { parts[i] = s.split(delim).toString(); }
47,099
1
// Verifies that a request is signed by an authorized account.
function verify(GenericRequest calldata _req, bytes calldata _signature) public view override returns (bool success, address signer) { signer = _recoverAddress(_req, _signature); success = !executed[_req.uid] && _isAuthorizedSigner(signer); }
function verify(GenericRequest calldata _req, bytes calldata _signature) public view override returns (bool success, address signer) { signer = _recoverAddress(_req, _signature); success = !executed[_req.uid] && _isAuthorizedSigner(signer); }
1,567
66
// update sell fee
function updateSellFees(uint256 _newFee) external onlyOwner { sellTotalFees = _newFee; }
function updateSellFees(uint256 _newFee) external onlyOwner { sellTotalFees = _newFee; }
35,635
275
// check supply and duration
if (supply_ == 0 || duration_ == 0 || duration_ > 60) { revert InvalidConfig(supply_, duration_); }
if (supply_ == 0 || duration_ == 0 || duration_ > 60) { revert InvalidConfig(supply_, duration_); }
53,695
49
// Add encrypted move to draw game. If both players added moves - init reveal stage
function addDrawMove( uint256 gameId, bytes32 newHiddenMove
function addDrawMove( uint256 gameId, bytes32 newHiddenMove
5,962
198
// Echoes the change to other contracts interacting with this collateral `PoolManager` Since the other contracts interacting with this `PoolManager` do not have governor roles, we just need it to set the new governor as guardian in these contracts
_addGuardian(_governor);
_addGuardian(_governor);
48,358
3
// Mapping of all user ids with withdraw requests.
mapping(address => WithdrawalRequest[]) private userWithdrawalRequests; bytes32 public constant INSTANT_POOL_OWNER = keccak256("IPO"); uint8 public override feePercent; address public instantPoolOwner; uint256 public instantPoolMatic; uint256 public instantPoolMaticX;
mapping(address => WithdrawalRequest[]) private userWithdrawalRequests; bytes32 public constant INSTANT_POOL_OWNER = keccak256("IPO"); uint8 public override feePercent; address public instantPoolOwner; uint256 public instantPoolMatic; uint256 public instantPoolMaticX;
19,065
14
// battle was a tie - send original waver back
require(wagerByAdressForEachBattle[msg.sender][_battleNumber]>0,"Sorry, you didn't wager on this gulag"); require(wagerByAddressForEachBattleByFighter[msg.sender][_battleNumber][0]>0,"Sorry, you didn't wager on the winner (creator) of this gulag"); payable(msg.sender).transfer(wagerB...
require(wagerByAdressForEachBattle[msg.sender][_battleNumber]>0,"Sorry, you didn't wager on this gulag"); require(wagerByAddressForEachBattleByFighter[msg.sender][_battleNumber][0]>0,"Sorry, you didn't wager on the winner (creator) of this gulag"); payable(msg.sender).transfer(wagerB...
26,087
358
// | keccak256( "metaSafeTransferFrom(address,address,uint256,uint256,bool,bytes)" );
bytes32 internal constant META_TX_TYPEHASH = 0xce0b514b3931bdbe4d5d44e4f035afe7113767b7db71949271f6a62d9c60f558;
bytes32 internal constant META_TX_TYPEHASH = 0xce0b514b3931bdbe4d5d44e4f035afe7113767b7db71949271f6a62d9c60f558;
9,790
200
// See {ICompliance-isTokenBound}./
function isTokenBound(address _token) public override view returns (bool) { if (_token != address(_tokenBound)){ return false; }
function isTokenBound(address _token) public override view returns (bool) { if (_token != address(_tokenBound)){ return false; }
19,748
189
// Provides a descriptive tag for bot consumption This should be modified weekly to provide a summary of the actions Hash: seth keccak -- "$(wget https:raw.githubusercontent.com/makerdao/community/6d2eaab1360395916b9b09c4137c5da6f2de9f1a/governance/votes/Executive%20vote%20-%20July%2017%2C%202021.md -q -O - 2> /dev/nul...
string public constant override description = "2021-07-17 MakerDAO Executive Spell | Hash: 0x887d27e20f47d0701d1eea14045bb5fdbea634401f7dc5aedd729af13a5c8ddc";
string public constant override description = "2021-07-17 MakerDAO Executive Spell | Hash: 0x887d27e20f47d0701d1eea14045bb5fdbea634401f7dc5aedd729af13a5c8ddc";
27,805
100
// return the crowdsale secondary sale time. /
function secondaryTime() public view virtual returns (uint256) { return _secondarySaleTime; }
function secondaryTime() public view virtual returns (uint256) { return _secondarySaleTime; }
38,283
24
// Function for the frontend to dynamically retrieve the price scaling of buy orders.
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256);
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256);
10,955
724
// A token was created by transferring direct position ownership to this contract. /
event PositionTokenized( bytes32 indexed positionId, address indexed owner );
event PositionTokenized( bytes32 indexed positionId, address indexed owner );
46,879
1
// Compound's Maximillion Contract Compound /
contract Maximillion { /** * @notice msg.sender sends Ether to repay an account's borrow in a cEther market * @dev The provided Ether is applied towards the borrow balance, any excess is refunded * @param borrower The address of the borrower account to repay on behalf of * @param cEther The addr...
contract Maximillion { /** * @notice msg.sender sends Ether to repay an account's borrow in a cEther market * @dev The provided Ether is applied towards the borrow balance, any excess is refunded * @param borrower The address of the borrower account to repay on behalf of * @param cEther The addr...
364
19
// if if users are able to transfer tokens between each toher.
bool public transferActive = false;
bool public transferActive = false;
126
86
// Aponta mapping CNPJ e Subcredito para newAddr
cnpjFSAddr[cnpj][idFinancialSupportAgreement] = newAddr; emit AccountChange(oldAddr, newAddr, cnpj, idFinancialSupportAgreement, salic, idProofHash);
cnpjFSAddr[cnpj][idFinancialSupportAgreement] = newAddr; emit AccountChange(oldAddr, newAddr, cnpj, idFinancialSupportAgreement, salic, idProofHash);
40,096
39
// Calculate rewards and set apart for claiming
rewards = getRewards(_allocationID); indexerRewards[alloc.indexer] = indexerRewards[alloc.indexer].add(rewards);
rewards = getRewards(_allocationID); indexerRewards[alloc.indexer] = indexerRewards[alloc.indexer].add(rewards);
13,676
193
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0; import "./IERC1155Mint.sol"; import "./IERC1155Burn.sol";
pragma solidity ^0.8.0; import "./IERC1155Mint.sol"; import "./IERC1155Burn.sol";
76,911
172
// Since all the membership cards are the same, they all point to the same image.
string memory baseURI = _baseURI(); if (bytes(baseURI).length > 0) { return string(abi.encodePacked(baseURI, Strings.toString(1))); }
string memory baseURI = _baseURI(); if (bytes(baseURI).length > 0) { return string(abi.encodePacked(baseURI, Strings.toString(1))); }
43,556