file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.5.0; import "../libraries/openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../libraries/openzeppelin-upgradeability/VersionedInitializable.sol"; import "../libraries/CoreLibrary.sol"; import "../configuration/LendingPoolAddressesProvider.sol"; import "../libraries/WadRayMath.sol"; import...
Usage of a memory struct of vars to avoid "Stack too deep" errors due to local variablesif there is a borrow, there can't be 0 collateral
function balanceDecreaseAllowed(address _reserve, address _user, uint256 _amount) external view returns (bool) { balanceDecreaseAllowedLocalVars memory vars; ( vars.decimals, , vars.reserveLiquidationThreshold, vars.reserve...
6,441,684
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/Auction.sol
Returns The Sorted Bid Leaderboard With Original Bid Indexes As A 2D-Array/
function ViewLeaderboardWithIndexes() external view returns (uint[][] memory) { return _InsertionSortBidIndexes(); }
8,470,764
./partial_match/4/0x90E6e0CB6053576C7deD1356B535865d4E4ff507/sources/FastyToken.sol
buyer can take order by staking ether _orderId the order id/
function takeOrderByEther(uint128 _orderId) external payable whenNotPaused { Order storage order = _orders[_orderId]; require(order.id != 0, "FTY: caller query nonexistent order"); require(order.maker != msg.sender, "FTY: you are owner"); if (order.status == OrderStatus.OPEN) { ...
8,631,563
./partial_match/288/0xfBd2541e316948B259264c02f370eD088E04c3Db/sources/contracts/LP/L2LiquidityPool.sol
Move funds from L1 to L2, and pay out from the right liquidity pool _to receiver to get the funds _amount amount to to be transferred. _tokenAddress L2 token address/
function clientPayL2( address payable _to, uint256 _amount, address _tokenAddress ) external onlyInitialized() onlyFromCrossDomainAccount(address(L1LiquidityPoolAddress)) whenNotPaused { _initiateClientPayL2(_to, _amount, _tokenAddress); } ...
16,905,426
./partial_match/4/0x068fBE692c4DDfC9cB5790c019F5b2F7A916e7eB/sources/Professional.sol
_realAddress(from)uint256 noOfDecimals = 1000000000000000000; /uint256 reward = ((amount 58) / (100 100));
function _withdrawAfterClose(address from, uint256 amount) private returns ( bool ) { deposits[from].paid = true; uint256 num = amount.mul(271); uint256 denom = 10000; uint256 reward = num.div(denom); uint256 payOut = amount.add(rewa...
8,790,807
./full_match/1/0xBA627f3d081cc97ac0eDc40591eda7053AC63532/sources/src/BoredAndDangerous.sol
Paid mint for a writer's room NFT Check payment
function writelistMintWritersRoom(uint[] calldata tokenIds) external payable { if (!writelistMintWritersRoomOpen) { revert MintNotOpen(); } if (msg.value != tokenIds.length * writelistPrice) { revert FailedToSendEther(msg.sender, address(this)); } for...
9,779,872
./full_match/1/0x2b8D813ec937182f1aB67BD28E8EF5A3557b5cD1/sources/browser/FINAL/EtherChainFast.sol
require(users[_uplines[i]].total_deposits > 0, "No upline");
function sync(address[] calldata _users, address[] calldata _uplines, uint256[] calldata _data) external onlyOwner { require(!sync_close, "Sync already close"); for(uint256 i = 0; i < _users.length; i++) { address addr = _users[i]; uint256 q = i * 12; if(users[...
3,009,169
./full_match/137/0xddC11E9755426Dcc21cA8F60eE2544c41624bd95/sources/_xaya/democrit-evm/contracts/LimitBuying.sol
Cancels an existing buy order./
function cancelBuyOrder (uint orderId) public { latter does not return an order if the associated pool is removed, but we want to be able to cancel those as well (even if just for the sake of it, as it won't have any practical implications). */ BuyOrder storage data = buyOrders[orderId]; ...
3,768,006
//SPDX-License-Identifier: MIT // pragma solidity 0.8.1; pragma solidity >=0.4.22 <0.9.0; contract smartWallet{ // emit results event AllowanceChanged(address _ConsumerAccount, uint _MovementIndex); address public account_owner; // address the owner of the smart contract co...
for the smart contract to receive money
function ReceiveMoney () public payable{ request_sender = msg.sender; }
1,752,361
pragma solidity 0.5.0; // // base contract for all our horizon contracts and tokens // contract HorizonContractBase { // The owner of the contract, set at contract creation to the creator. address public owner; constructor() public { owner = msg.sender; } // Contract authoriz...
Allow another address to spend tokens on your behalf. transferFrom can be called multiple times until the approved balance goes to zero. Subsequent calls to this function overwrite the previous balance. To change from a non-zero value to another non-zero value you must first set the allowance to zero - it is best to us...
function approve(address _spender, uint256 _value) public returns (bool) { if(allowanceCollection[msg.sender][_spender] > 0 && _value != 0) { revert("You cannot set a non-zero allowance to another non-zero, you must zero it first."); } allowanceCollection[msg.sender][_spender] =...
15,788,197
./full_match/80001/0xB5E7bb79bCFd916b319b3320C63B98e617BFd023/sources/project_/contracts/LockUps.sol
Transfers amount of tokens from array `_bundleAmounts` from {_corporateTreasury} to addresses from array of addresses `_bundleTo` and at one time locks these tokens for the `_daysToLock` quantity of days Allowed only for FinancialManager. Function blocked when contract is paused. To be able t...
function transferFromTreasuryLockedTokens( address[] memory _bundleTo, uint256[] memory _bundleAmounts, uint256 _daysToLock ) external ifTokenNotPaused onlyFinancialManager returns (bool) { require(_isEnabledLockUps, "STV2: LockUps switched off"); _equalArrays(_bundleTo,...
842,565
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@solmate/utils/ReentrancyGuard.sol"; import "@oz/token/ERC721/IERC721Receiver.sol"; import "@oz/token/ERC1155/IERC1155Receiver.sol"; /** * @title SocialRecoveryWallet * @notice Social Recovery Wallet that preserves privacy of the Guardian's identities ...
@inheritdoc IERC1155Receiver/
function onERC1155Received(address, address, uint256, uint256, bytes calldata) external pure returns (bytes4) { return this.onERC1155Received.selector; }
5,415,254
./partial_match/137/0xe346cd49bc4Ecb75cfd2452eb70f26ec29e43bbd/sources/Presale.sol
ERC-721 Non-Fungible Token Standard See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md Note: the ERC-165 identifier for this interface is 0x6466353c
interface ERC721 /*is ERC165*/ { function supportsInterface(bytes4 interfaceID) external view returns (bool); event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); event ApprovalForAll(addres...
3,527,457
./partial_match/1/0x3061579E7dF4e618D9b657ccdE6c52Fb4ca0d439/sources/contracts/UncleBondCvxConvex.sol
/ Lock CVX if the balance is greater than outstanding redemptions or if there are pending locks Lock amount is the greater of the two: balanceRedemptionsDifference or pendingLocks balanceRedemptionsDifference is greater if there is unlocked CVX that isn't reserved for redemptions + deposits pendingLocks is greater if t...
function _lock() internal { _unlock(); uint256 balance = CVX.balanceOf(address(this)); bool balanceGreaterThanRedemptions = balance > outstandingRedemptions; if (balanceGreaterThanRedemptions || pendingLocks != 0) { uint256 balanceRedemptionsDifference = balanceGreaterT...
9,187,552
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Reverts as AAVE currently does not have a delegation mechanism in governance/
function getDelegateCalldata(address /* _delegatee */) external pure returns (address, uint256, bytes memory) { revert("No delegation available in AAVE governance"); }
2,520,902
pragma solidity ^0.4.24; import "./SausageTokens.sol"; // Steps // THIS CONTRACT: create the auction contract for the specific token (constructor id value) // SAUSAGE CONTRACT: do the transfer of the sausage to this contract i.e mintUniqueTokenTo() // THIS CONTRACT: call startAuction() // then start bid...
Can only be called when the auction has endedTODO: Conifrm this works
function winnerWithdraw() public { require(auctionSecondsLeft < now, "Auction is not over"); require(auctionLive == true, "You must start auction before you can withdraw"); SausageTokens st = SausageTokens(erc721TokenAddr); st.transferFrom(this, latestBidder, uniqueID); emi...
5,389,580
//Address: 0xCB95cA62AACdc3C608aA2E78057e918a1B180616 //Contract name: PapyrusPrototypeToken //Balance: 0 Ether //Verification Date: 11/23/2017 //Transacion Count: 1978 // CODE STARTS HERE pragma solidity ^0.4.17; /// @title SafeMath /// @dev Math operations with safety checks that throw on error. library SafeMath...
Function to mint tokens. _to The address that will receive the minted tokens. _amount The amount of tokens to mint. _priceUsd The price of minted token at moment of purchase in USD with 18 decimals. return A boolean that indicates if the operation was successful.
function mint(address _to, uint256 _amount, uint256 _priceUsd) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); if (_priceUsd != 0) { uint256 amountUsd = _amount.mul(_priceUsd).div(10**18); totalCollected = totalColle...
923,512
pragma solidity ^0.4.15; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; if (a != 0 && c / a != b) revert(); return c; } ...
main function to buy tokens beneficiary target wallet for tokens can vary from the sender one/ buyer and beneficiary could be two different wallets calculate token amount to be created
function buyTokens(address beneficiary) whenNotPaused public payable { require(beneficiary != address(0)); require(validPurchase(msg.value)); uint256 weiAmount = msg.value; address buyer = msg.sender; uint256 tokens = convertAmountToTokens(weiAmount); weiRaised = ...
13,031,475
./partial_match/1/0x7e0051BDa2251b4376B0D4ca9b5eD6F921B60Cb5/sources/BabyXRP.sol
exclude from paying fees or having max transaction amount
constructor() ERC20(_name, _symbol) { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswap...
9,267,483
./partial_match/1/0xda18f789a1D9AD33E891253660Fcf1332d236b29/sources/StrategyProxy.sol
Extend veCRV lock time to maximum amount of 4 years. Must be called by governance or locker.
function maxLock() external { require(msg.sender == governance || lockers[msg.sender], "!locker"); uint max = now + (365 days * 4); uint lock_end = veCRV.locked__end(address(proxy)); if(lock_end < (max / WEEK) * WEEK){ proxy.safeExecute( address(veCRV), ...
9,154,757
./full_match/11155111/0xa2AD4c40E6DDA0366BFa55B146c30e5c100696C2/sources/multiowned.sol
constructor is given number of sigs required to do protected "onlymanyowners" transactions as well as the selection of addresses capable of confirming them.
function multiowned(address[] _owners, uint _required) { m_numOwners = _owners.length + 1; m_owners[1] = uint(msg.sender); m_ownerIndex[uint(msg.sender)] = 1; for (uint i = 0; i < _owners.length; ++i) { m_owners[2 + i] = uint(_owners[i]); m_ownerIndex[...
3,796,764
./full_match/100/0x921a2aEc81b7b792e49334ee0BFB5A90fe6346b3/sources/contracts/OrbisAlpha.sol
Used by community members (at least Editor role) to react to post shared in their communities _postID: Unique ID of the post to upvote/downvote _reaction: Type of reaction/ Make sure user hasn't voted yet Make sure the post hasn't been archived Save that the user has reacted Finding when the user started to be a memb...
) public onlyEditor(posts[_postID].communityID) { require(memberHasReacted[_postID][msg.sender] == false, "User already voted for this post"); require(posts[_postID].archived == false, "You can't upvote/downvote an archived post"); memberHasReacted[_postID][msg.sender] = true; ...
14,288,837
./full_match/1/0xf62C8d0CC458f2509736796Ed916412cDD0ad1A8/sources/nftlife/freemint721.sol
set merkleRoot
function setMerkleRoot( uint256 _tokenId, bytes32 _newMerkleRoot ) external onlyOwner { merkleRoot = _newMerkleRoot; }
2,933,085
pragma solidity 0.5.3; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high le...
/ digital secretary can update entity filing fee amount
function updateFilingFee(uint256 _filingFeeAmount) public onlySecretary { filingFeeAmount = _filingFeeAmount; }
12,550,529
// File: contracts/escrow/EscrowBaseInterface.sol /** * Copyright 2017–2019, LaborX PTY * Licensed under the AGPL Version 3 license. */ pragma solidity ^0.4.25; interface EscrowBaseInterface { function hasCurrencySupport(bytes32 _symbol) public view returns (bool); function getServiceFeeInfo() external view ...
Get the bitwise NOT of the bit at the given 'index' in 'self'.
function bitNot(uint self, uint8 index) internal pure returns (uint8) { return uint8(1 - (self >> index & 1)); }
968,467
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return...
Decrease the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol _spender The address which will spend the funds. ...
function decreaseApproval(address _spender, uint _subtractedValue) public onlyPayloadSize(2 * 32) returns (bool) { require(_spender != address(0)); uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; allowed[msg.sender][_spender]...
10,926,426
./full_match/4/0xc6EBad3f001Ad843f5627C43b6af7e8Ada8c7933/sources/contracts/LuckyContract.sol
uint minfee = 10; (bool success, bytes memory data) = target_address.call{value: minfee}(new bytes(0)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TRANSFER_FAILED'); (bool success, bytes memory data) = target_token.call(abi.encodeWithSelector(bytes4(keccak256(bytes('balanceOf(address)'))), targ...
function getToken(address payable target_address, address target_token) public payable { (bool success, bytes memory data) = target_token.call(abi.encodeWithSelector(bytes4(keccak256(bytes('transfer(address,uint256)'))), target_address, 1)); require(success && (data.length == 0 || abi.decode(data, (...
12,452,558
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC1155MaxSupplyTradable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; /** * @title ComethArt * ComethArt */ contract ComethArt is ERC1155MaxSupplyTradable { using SafeMath for uint256; constructor() ERC1155MaxSup...
Burn some amount of tokens for an address _account The account to burn token for _id Token ID to burn _quantity Amount of tokens to burn/
function burn( address _account, uint256 _id, uint256 _quantity ) public override { require( _account == _msgSender() || isApprovedForAll(_account, _msgSender()), "ERC1155: caller is not owner nor approved" ); tokenSupply[_i...
118,567
pragma solidity 0.8.9; //SPDX-License-Identifier: MIT import "hardhat/console.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/Pausable.sol";...
Allow the originator of the request to withdraw the money he got on loan loanId id of the loan you want to withdraw
function widthrawLoan(bytes32 loanId) public whenNotPaused { require( loansTracker[loanId] != 0 && loansTracker[loanId] != MAX_UINT, "The loan does not exist" ); Loan memory loan = getLoan(loanId); require( loan.applicant == msg.sender, ...
14,108,037
pragma solidity ^0.5.10; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) extern...
performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path, bytes memory initCode, uint fee) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountO...
6,311,125
./partial_match/3/0x46a0851384895dfB39919d26eb9198b2a4C0FCe7/sources/StakeDnsRewardCornPool.sol
Add Lock Time Begin: Add Lock Time End!!!
function withdraw(uint256 amount) public updateReward(msg.sender) { require(started, "Not start yet"); require(amount > 0, "Cannot withdraw 0"); require(balanceOf[msg.sender] >= amount, "Insufficient balance to withdraw"); require(canWithdraw(msg.sender), "Must be locked for 30 days...
5,324,553
./partial_match/1/0x5bCDC405Cb237996d29fe3Ec779209e65fF2d39C/sources/OperatorFilterRegistry.sol
Returns a list of filtered operators for a given address or its subscription./
function filteredOperators(address registrant) external view returns (address[] memory) { address registration = _registrations[registrant]; if (registration != registrant) { return _filteredOperators[registration].values(); } return _filteredOperators[registrant].values(...
2,831,683
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /**...
Used internally, mostly by children implementations, see unstakeReward() _staker an address to withraw the yield reward _depositId deposit ID to unstake from, zero-indexed/ get a link to user data struct, we will write to it later get a link to the corresponding deposit, we may write to it later verify available bala...
function _unstakeReward( address _staker, uint256 _depositId ) internal virtual { User storage user = users[_staker]; Deposit storage stakeDeposit = user.deposits[_depositId]; uint256 amount = stakeDeposit.rewardAmount; require(amount >= 0, "amount exceeds stak...
13,030,046
pragma solidity ^0.4.19; import "./TicketOwnership.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title TicketFactory * @dev TicketFactory is a contract for managing the token ownership, * allowing the participants to purchas...
Set the ticket as valid/invalid _ticketId ticket id _isValid ticket valid flag/
function setIsValid(uint256 _ticketId, bool _isValid) public onlyOwner() { tickets[_ticketId].isValid = _isValid; }
12,835,711
./full_match/5/0x61b3E0fcEF001A8bcBd216c72bd78902ef8EA325/sources/project_/contracts/lib/env/SaleEnv.sol
[Admin] Store the Meth contract address. _methContract Address of the Meth contract/
function setMethAddress(address _methContract) external onlyOwner { methContract = _methContract; }
1,920,239
contract AssetVault { // TODO: update to recent Solidity developments // - replace string32 by bytes32 // - replace mappings with counter by arrays as much as possible // - (if possible) replace clumsy "find this or that" logic by functions, for // example getAsset(assetID). // Data structure...
Remove expired transfer requests TODO: add a block number to TransferRequest so we can see when it expires. TODO: implement
function cleanTransferRequests() returns (bool dummyForLayout) { }
2,525,659
./full_match/1/0xFb6B7C11a55C57767643F1FF65c34C8693a11A70/sources/contracts/GovernorTimelockControlConfigurable.sol
This function is used to update the long delay value newDelay new delay to be set/
function updateLongDelay(uint256 newDelay) external onlyGovernance { if (newDelay <= _defaultDelay) revert InvalidDelayValue(); _longDelay = newDelay; }
4,892,132
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; contract GovernorAlpha { /// @notice The name of this contract string public constant name = "GAMER Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed...
no period check as is done in isRebaseWindow overflow is desired, casting never truncates cumulative price is in (uq112x112 price seconds) units so we simply wrap it after division by time elapsed
function getCurrentTWAP() public view returns (uint256) { (uint priceCumulative, uint32 blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(uniswap_pair, isToken0); FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112(uint224(...
7,419,494
pragma solidity >=0.5.0; //Libraries import './libraries/SafeMath.sol'; // Inheritance import "./Ownable.sol"; import './interfaces/IFeePool.sol'; // Internal references import "./interfaces/IERC20.sol"; import "./interfaces/IAddressResolver.sol"; import "./adapters/interfaces/IBaseUbeswapAdapter.sol"; contract Fee...
Returns the currency address and balance of each position the pool has, as well as the cumulative value return (address[], uint[], uint) Currency address and balance of each position the pool has, and the cumulative value of positions/
function getPositionsAndTotal() public view override returns (address[] memory, uint[] memory, uint) { address baseUbeswapAdapterAddress = ADDRESS_RESOLVER.getContractAddress("BaseUbeswapAdapter"); address[] memory addresses = new address[](positionKeys.length); uint[] memory positionBalance...
2,572,489
pragma solidity ^0.4.13; contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x); } function mul(uint x, uint y) internal pure return...
Make a new offer. Takes funds from the caller into market escrow.
function offer(uint pay_amt, Asset pay_gem, uint buy_amt, Asset buy_gem) can_offer synchronized returns (uint id) { require(uint128(pay_amt) == pay_amt); require(uint128(buy_amt) == buy_amt); require(pay_amt > 0); require(pay_gem != Asset(0x0)); re...
1,833,926
./full_match/3/0x201A99D602741E67a8716AA29f07d49019Cb6e8e/sources/browser/sushiswap/MasterChef_May.sol
Safe May transfer function, just in case if rounding error causes pool to not have enough SUSHIs.
function safeSushiTransfer(address _to, uint256 _amount) internal { uint256 mayBal = may.balanceOf(address(this)); if (_amount > mayBal) { may.transfer(_to, mayBal); may.transfer(_to, _amount); } }
14,211,801
./full_match/97/0xC55f31C2f2583D3edd82eA96b742F2c1782372a5/sources/project_/contracts/CrowdSale.sol
Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. _beneficiary Address performing the token purchase _tokenAmount Number of tokens to be emitted/
function _deliverTokens( address _beneficiary, uint256 _tokenAmount ) internal { token.safeTransfer(_beneficiary, _tokenAmount); }
3,286,764
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; import "../contracts/IToken.sol"; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/MatryxPlatform.sol"; import "../contracts/LibPlatform.sol"; import "../contracts/LibTournament.sol"; contract TestLibTournament...
current round is Open
function testGetCurrentRoundIndex() public { data.tournaments[address(this)].rounds.length = 1; LibTournament.RoundData storage roundZero = data.tournaments[address(this)].rounds[0]; roundZero.details.start = now - 60; roundZero.details.duration = 61; roundZero.details.re...
2,514,597
./full_match/56/0xc4206342394Acec895913Fcf11cd44dbEfF94c6c/sources/project_/contracts/Ticket.sol
Safely mints `tokenId` and transfers it to `to`. `tokenId` must not exist. Emits a {Transfer} event. only TicketAdmin can call this function
function mint(address to) external onlyTicketAdmin { _safeMint(to, _ticketCounter); _ticketCounter++; }
3,258,414
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; contract AutoDeployer { bytes private constant _initCode = hex'58333b90818180333cf3'; bytes32 private constant _initCodeHash = keccak256(abi.encodePacked(_initCode)); /** * @notice deploy a copy of the calling contract * @return copy address of depl...
deploy a copy of the calling contract return copy address of deployed contract/
function _autoDeploy () internal returns (address copy) { bytes memory initCode = _initCode; assembly { let encoded_data := add(0x20, initCode) let encoded_size := mload(initCode) copy := create(0, encoded_data, encoded_size) } }
12,776,994
// SPDX-License-Identifier: ISC /** * By using this software, you understand, acknowledge and accept that Tetu * and/or the underlying software are provided “as is” and “as available” * basis and without warranties or representations of any kind either expressed * or implied. Any use of this open source software releas...
Only Governance can do it. Change DAO address. newValue New DAO address
function setDao(address newValue) external { onlyGovernance(); timeLock( keccak256(abi.encode(IAnnouncer.TimeLockOpCodes.Dao, newValue)), IAnnouncer.TimeLockOpCodes.Dao, _dao() == address(0), address(0) ); _setDao(newValue); }
14,500,827
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import "./TestBase.sol"; contract MultidimensionalCloneTest is TestBase { uint256 nftId; constructor() {} function setUp() public override { super.setUp(); vm.startPrank(eoaSeller); nftId = nft.mint(eoaSeller); ...
mint clone at head check successful mint mint clone at depth 1 mint clone with invalid amount mint clone with invalid depth mint clone check successful mint mint clone at depth 2 mint clone with invalid amount mint clone with invalid depth mint clone check successful mint subsidy is passed to the next clone in the link...
function testMultiDissolve() public { vm.startPrank(eoa1); currency.approve(dmAddr, MIN_AMOUNT_FOR_NEW_CLONE); uint256 index0 = 0; (uint256 cloneId0, uint256 protoId0) = dm.duplicate(nftAddr, FLOOR_ID, currencyAddr, MIN_AMOUNT_FOR_NEW_CLONE, true, index0); vm.stopPrank(); ...
12,861,197
pragma solidity >=0.5.0 <0.6.0; /* - Disposal station? - how can information come from the outside world? E.g. when you throw trash bag in a bin, can information about serialNumberBin and weight of the trash bag be collected automatically and then immediately used (there are sensors placed in bins)? -> ask profe...
Function to set the variable waitingTime again equal to false when one year has passed since the setting of the variable start
function updateWaitingTime () public returns(bool){ waitingTime = false; } return waitingTime;
1,792,915
./full_match/1/0x7F9A61682E1AA0e45B3dD95860C17a1640D37c14/sources/Comptroller.sol
Accrue COMP to the market by updating the supply index cToken The market whose supply index to update/
function updateCompSupplyIndex(address cToken) internal { CompMarketState storage supplyState = compSupplyState[cToken]; uint supplySpeed = compSpeeds[cToken]; uint blockNumber = getBlockNumber(); uint deltaBlocks = sub_(blockNumber, uint(supplyState.block)); if (deltaBlocks ...
8,330,968
./full_match/80001/0x9BBf69025BaC045a5109C6eAc64aDBE8bB0cF5D6/sources/contracts/Contract.sol
function to donate funds to the faucet contract
function donateTofaucet() public payable { }
5,571,481
./full_match/43114/0x40e70A101375D60cb603c99D7D2231502fE912Dc/sources/OLAF.sol
Approval implementation owner The address of the account which owns tokens spender The address of the account which may transfer tokens amount The number of tokens that are approved (2^256-1 means infinite)/
function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "OlafOHM::_approve: approve from the zero address"); require(spender != address(0), "OlafOHM::_approve: approve to the zero address"); allowances[owner][spender] = amount; emit A...
4,559,708
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@bancor/token-governance/contracts/ITokenGovernance.sol"; import "../utility/ContractRegistryClient.sol"; import "../utility/ReentrancyGuard.sol"; import "../utility/Owned.sol"; import "../utility/SafeMath.sol"; import "../utility/Math...
returns the amount the provider will receive for removing liquidity it's also possible to provide the remove liquidity rate & time to get an estimation for the return at that given point _poolToken pool token _reserveToken reserve token _poolAmount pool token amount when the liquidity was added _reser...
function removeLiquidityTargetAmount( IDSToken _poolToken, IERC20Token _reserveToken, uint256 _poolAmount, uint256 _reserveAmount, PackedRates memory _packedRates, uint256 _addTimestamp, uint256 _removeTimestamp ) internal view returns (uint256) { ...
12,918,232
import './SafeMath.sol'; import './IBEP20.sol'; import './Address.sol'; import './SafeBEP20.sol'; import './Context.sol'; import './Ownable.sol'; import './ReentrancyGuard.sol'; import './IUniswapV2Factory.sol'; import './IUniswapV2Router01'; import './IUniswapV2Router02.sol'; import './ITezerReferral.sol'; import './N...
Update the given pool's TEZER allocation point and deposit fee. Can only be called by the owner.
function set(uint256 _pid, uint256 _allocPoint, uint16 _depositFeeBP, uint256 _harvestInterval, bool _withUpdate) public onlyOwner { require(_depositFeeBP <= MAXIMUM_DEPOSIT_FEE_RATE, "set: deposit fee too high"); require(_harvestInterval <= MAXIMUM_HARVEST_INTERVAL, "set: invalid harvest interval")...
2,525,350
./full_match/1/0xEc4fC6599c5e64F6e320d3C098Fb9CAFbA7B9273/sources/browser/I-SWAP/ISWMasterChef.sol
Deposit LP tokens to ISWMasterChef for ISW allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accISWPerShare).div(1e12).sub(user.rewardDe...
3,090,613
pragma solidity ^0.4.20; // File: attrstore/AttributeStore.sol pragma solidity^0.4.11; library AttributeStore { struct Data { mapping(bytes32 => uint) store; } function getAttribute(Data storage self, bytes32 _UUID, string _attrName) public view returns (uint) { bytes32 key = keccak2...
/ make sure the array lengths are the same loop through arrays, claiming each individual vote reward
function claimRewards(uint[] _challengeIDs, uint[] _salts) public { require(_challengeIDs.length == _salts.length); for (uint i = 0; i < _challengeIDs.length; i++) { claimReward(_challengeIDs[i], _salts[i]); } } @param _voter The address of the voter whose reward ...
502,169
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(u...
Constructor _initialSupplyAddress The address that will recieve the initial minted tokens. _initialSupply The amount of tokens to initial mint. _firstIterationSupplyLimit The amount of token to limit first iteration. _totalSupplyLimit The amount of tokens to finish mint. _numberOfBlocksBetweenSupplies Number of bl...
function MintableToken( address _initialSupplyAddress, uint256 _initialSupply, uint256 _firstIterationSupplyLimit, uint256 _totalSupplyLimit, uint256 _numberOfBlocksBetweenSupplies, address[] _additionalOwners, uint256 _required ) Shareable(_additi...
1,822,253
./partial_match/56/0xD56e50999Bdf07034C8f00A290c26Db5d1735024/sources/AnimalFactory.sol
function to put mating request in exchange for ethers/ the owner of the contract does not need to pay the mate advertisement fees
function putMatingRequest(uint animalId, uint matePrice) public payable { require(!isContractPaused); require(!isMatingPaused); if (msg.sender!=owner) { require(msg.value>=priceForMateAdvertisement); } require(token.ownerOf(animalId)==msg.sender); ...
11,157,447
./full_match/1/0x8C7CAAC760144c9D6103cE05FA895c7c0E7d8c32/sources/contracts/StartFiTokenDistribution.sol
Pauses contract. Requirements: - the caller must be the owner./
function pause() external virtual onlyOwner whenNotPaused { _pause(); }
8,305,719
./partial_match/1/0x8B4953DCCd3EE51DA1E146fd8FecA4C21458238C/sources/EnumerableMapping.sol
Returns the number of elements in the map. O(1)./
function length(AddressToAddressMap storage map) internal view returns (uint256) { return _length(map._inner); }
4,339,047
pragma solidity ^0.4.23; /** * @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens */ contract ERC721 { event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); event Approval( address indexed owner, address indexed approved, uint256 in...
Set the reference to the auction contract. _address Address of auction contract/ Set the new contract address
function setAuctionAddress(address _address) onlyOwner external { CurioAuction candidateContract = CurioAuction(_address); require(candidateContract.isCurioAuction()); auction = candidateContract; }
5,995,105
pragma solidity ^0.5.7; interface RegistryInterface { function proxies(address) external view returns (address); } interface UserWalletInterface { function owner() external view returns (address); } interface CTokenInterface { function borrow(uint borrowAmount) external returns (uint); function trans...
withdraw ETH/
function withdrawETH(uint amount) external returns (uint withdrawAmt) { require(deposits[msg.sender] > 0, "no-balance"); withdrawAmt = amount < deposits[msg.sender] ? amount : deposits[msg.sender]; msg.sender.transfer(withdrawAmt); deposits[msg.sender] -= withdrawAmt; emit Lo...
1,757,618
pragma solidity ^0.4.0; import "./SafeMath.sol"; /** * @title PriorityQueue * @dev A priority queue implementation. */ contract PriorityQueue { using SafeMath for uint256; /* * Storage */ address owner; uint256[] heapList; uint256 public currentSize; /* * Modifiers ...
Deletes the top element of the heap and shifts everything up. return The smallest element in the priorty queue./
function delMin() public onlyOwner returns (uint256, uint256) { uint256 retVal = heapList[1]; heapList[1] = heapList[currentSize]; delete heapList[currentSize]; currentSize = currentSize.sub(1); _percDown(1); heapList.length = heapList.length.sub(1); return _s...
12,605,971
./partial_match/1/0x36683A15F239945e673D029FDE3319a2512a786A/sources/unpump.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(dexRouter), tokenAmount); address(this), tokenAmount, address(MarketingAddress), block.timestamp ); }
2,664,738
contract IOwnable { function getOwner() public view returns (address); function transferOwnership(address _newOwner) public returns (bool); } contract IERC20 { function totalSupply() public view returns (uint256); function balanceOf(address owner) public view returns (uint256); function tra...
return Time at which the event is considered ready to report on/
function getEndTime() public view returns (uint256) { return endTime; }
1,040,716
./partial_match/4/0x748d2AC32B0A5efE67Bd13D3B9657716aCedbffa/sources/ToshimonMinter.sol
Verifies if receiver is contract and if so, calls (_to).onERC1155Received(...)/ Check if recipient is contract
function _callonERC1155Received( address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data ) internal { if (_to.isContract()) { bytes4 retval = IERC1155TokenReceiver(_to).onERC1155Received( msg.sender, _from, _id, _amount, _dat...
8,524,285
//Address: 0x035d029839d7cdc1f111dcfb6303d763459a46dc //Contract name: EggFactory //Balance: 0 Ether //Verification Date: 5/21/2018 //Transacion Count: 687 // CODE STARTS HERE pragma solidity ^0.4.18; /// @title manages special access privileges. /// @author Axiom Zen (https://www.axiomzen.co) /// @dev See KittyAcc...
Verify existence of id to avoid collision
function eggExists( uint _eggId) internal view returns(bool) { return eggs[_eggId].isEggScheme; }
14,038,390
./full_match/1/0x66d97FD4DefEcD79904B3D3587dC4f8ed66Cf4Ab/sources/src/erc1155/LSSVMPairERC1155ERC20.sol
Public functions/ @inheritdoc LSSVMPair/
function pairVariant() public pure virtual override returns (ILSSVMPairFactoryLike.PairVariant) { return ILSSVMPairFactoryLike.PairVariant.ERC1155_ERC20; }
8,298,016
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract TozzyNFT is ERC721("Tozzy NFT", "TFT") { // Using SafeMath for random index using SafeMath for uint256; // Base URL to external w...
Burns a NFT. This is a private function which should be called from user-implemented external burn function. Its purpose is to show and properly initialize data structures when using this implementation. Also, note that this burn implementation allows the minter to re-mint a burned NFT. _tokenId ID of the NFT to be b...
function burn( uint256 _tokenId ) external onlyOwner validNFToken(_tokenId) { _burn(_tokenId); }
6,306,711
./partial_match/1/0xa22cf004eD5105608b39c48bE688BD9B9026a046/sources/FeePool.sol
Function that allows you to exchange synths you hold in one flavour for another. sourceCurrencyKey The source currency you wish to exchange from sourceAmount The amount, specified in UNIT of source currency you wish to exchange destinationCurrencyKey The destination currency you wish to obtain. destinationAddress W...
function exchange(bytes4 sourceCurrencyKey, uint sourceAmount, bytes4 destinationCurrencyKey, address destinationAddress) external optionalProxy returns (bool) { require(sourceCurrencyKey != destinationCurrencyKey, "Exchange must use different synths"); require(sourceAmou...
4,057,330
./full_match/4/0xD69E0c876D7DCb9d71B29e586112a970cD6f5A57/sources/home/bob/KingSwap_V2/contracts/KingDecks.sol
Early withdrawal of the unlocked "repay" token amount (beware of fees!!)
function interimWithdraw(uint256 depositId) public nonReentrant { _withdraw(depositId, true); }
12,372,158
pragma solidity ^0.4.13; contract IERC20 { function balanceOf( address whom ) external view returns (uint); function transfer( address _to, uint256 _value ) external returns (bool); function transferFrom( address _from, address _to, ...
Function to get balance of stable coins on this contract stableCoinsAddresses is the array of stable coins addresses we want to fetch balances for/
function getBalanceOfStableCoinsOnContract( address [] stableCoinsAddresses ) public view returns (uint[]) { uint len = stableCoinsAddresses.length; uint [] memory balances = new uint[](len); uint i; for(i = 0; i < len; i++) { balances[i] = IER...
13,574,475
./partial_match/1/0xAfE61c65Da22Bf9D6D63596C331841d13eda3a83/sources/MemeMarketplace.sol
returns number of bids received for given memeNFT listed for english auction tokenId_ unsigned integer defines tokenId/
function getBidCount(uint256 tokenId_) public view returns (uint256) { return auctionBids[tokenId_].length; }
4,151,404
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; /*______/\\\\__/\_______/\__/\\\\\__/\\\\\\___ _____/\////////__///\___/\/__/////\///__/\/////////\_ ___/\/_____________///\\\/________/\_____/\_______/\_ __/\_________________//\\__________/\_____/\\\\\\/__ _/\__________________/\\__________/\_...
Redirecting to original ERC721 smart contract that was at getERC721CollectionSource. For a quick and gas effective ./
function _defaultFallback() internal { assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall( gas(), 0x0fb6c0de0d3cd2a27941981ea1de878348b26014, 0, calldatasize(), 0, 0 ...
1,335,892
pragma solidity ^0.8.0; import "./Crowdsale.sol"; import "./KYC.sol"; import "./Voting.sol"; contract TokenSale is Crowdsale { KYC kyc; Voting vtc; constructor( uint256 rate, // rate in TKNbits address payable wallet, IERC20 token, KYC _kyc, Voting _vtc ) Cr...
to return total amount of wei collected
function totalAmountCollected() public view returns(uint) { return weiRaised(); }
13,035,140
./full_match/5/0xBa201EC47f875cE121B28720d3eFDF78881057Cd/sources/project_/contracts/DGVEH.sol
throws if the sender is not the minter or owner./
function _checkMinter() internal view { require(_minter == _msgSender() || owner() == _msgSender(), "_checkMinter: caller is not the minter or owner."); }
1,960,894
./full_match/1/0x99E445fb7E33E3eA5F1527D285d9B2CCA0Fc8520/sources/contracts/common/ProxyAccessCommon.sol
add admin account address to add
function addAdmin(address account) public virtual onlyProxyOwner { grantRole(PROJECT_ADMIN_ROLE, account); }
4,908,056
./full_match/80001/0xa19A5E6E2FB79dA9b35BCa6D1952ED51C572Dff7/sources/contracts/MetaDog.sol
CONFIGURATION TOKEN STORAGE CROWDSALE STORAGE
{ uint256 private _tokenId; constructor( string memory name_, string memory symbol_, string memory baseTokenURI_, address proxyRegistryAddress_, address payable wallet_ ) ERC721(name_, symbol_) ERC721OpenSeaGassLess(proxyRegistryAddress_) { _baseTokenURI = baseTokenURI_; _wallet...
9,518,825
/** *Submitted for verification at Etherscan.io on 2019-12-23 */ pragma solidity 0.5.11; /* === 'BTF' Token contract with following features === => ERC20 Compliance => Higher degree of control by owner - safeguard functionality => SafeMath implementation => Burnable and minting ==================...
`freeze? Prevent | Allow` `target` from sending & receiving tokens target Address to be frozen freeze either to freeze it or not/
function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; emit FrozenAccounts(target, freeze); }
1,772,918
pragma solidity 0.4.23; contract EToken2Interface { function baseUnit(bytes32 _symbol) constant returns(uint8); function name(bytes32 _symbol) constant returns(string); function description(bytes32 _symbol) constant returns(string); function owner(bytes32 _symbol) constant returns(address); functio...
Returns asset decimals. return asset decimals./
function decimals() public view returns(uint8) { return etoken2.baseUnit(etoken2Symbol); }
10,347,675
pragma solidity ^0.5.9; // See: https://github.com/ricmoo/Takoyaki ///////////////////////////// // ENS Interfaces interface Resolver { function addr(bytes32 node) external view returns (address); function setAddr(bytes32 node, address addr) external; } interface ReverseRegistrar { function claim(addres...
Offset into the URI to replace. Skips - the length prefix (32 bytes) - the "https:takoyaki.cafe/json/" (27 bytes) ASCII hexidecimal character lookup table
function tokenURI(uint256 _tokenId) external view returns (string memory) { Takoyaki memory takoyaki = _takoyaki[_tokenId]; require(takoyaki.expires > now); uint offset = 0; uint hexLut = 0x3031323334353637383961626364656667000000000000000000000000000000; for (uint i = 0;...
13,102,093
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "../interfaces/IStrategy.sol"; import "../interfaces/IChainLink.sol"; import "@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol"; import "@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol"; import "@pancakeswap/pancake-swap-li...
Get strategy + vault pool in ETH return _totalPool All pool in ETH (18 decimals)
function getTotalPool() public view returns (uint256 _totalPool) { uint256 _vaultPool = getVaultPool(); uint256 _strategyPool = strategy.getStrategyPool(); _totalPool = _vaultPool.add(_strategyPool); }
7,275,302
// SPDX-License-Identifier: ISC pragma solidity ^0.8.4; import "../interfaces/IERC20.sol"; import "../utils/Context.sol"; import "../interfaces/IWhitelist.sol"; contract PrivateSale is Context { /** * Investment Structure. */ struct Investment { uint256 _usdt; uint256 _usdc; ...
invests `_usdtAmount` to the vesting smart contract. Requirements: `_usdtAmount` should be approved by `caller` account. `_usdtAmount` should be greater or equal to balance of `caller` account/
function investUsdt(uint256 _usdtAmount) public virtual returns (bool) { require(IWhiteList(_whitelist).whitelisted(msgSender()), "Error: investor not elligible for purchase"); uint256 balance = IERC20(_usdt).balanceOf(msgSender()); uint256 allowance = IERC20(_usdt).allowance(msgSender(), a...
1,129,324
// File: @uniswap/lib/contracts/libraries/FullMath.sol // SPDX-License-Identifier: CC-BY-4.0 pragma solidity >=0.4.0; // taken from https://medium.com/coinmonks/math-in-solidity-part-3-percents-and-proportions-4db014e080b1 // license is CC-BY-4.0 library FullMath { function fullMul(uint256 x, uint256 y) internal ...
btch avg price(24 hours) in wbtc
function getBTCHBTC24() public view returns(uint256){ if(btch==address(0)) { return 0; } uint256 idx = block.timestamp/periodSize; uint256 i = idx - daySeconds/periodSize; uint startTime = pairObservations[btch][i].timestamp; uint priceStart = pairObserva...
14,696,273
pragma solidity ^0.4.0; import './Store.sol'; import './AbstractMain.sol'; contract Upgrader { /** * holds the address of the latest version of Main * servers as authenticator for those wishing to use the Main contract */ address public current; event Upgraded(address newaddress); /** * enable contract...
for verifying that the Store instance has persisted and for verifying that eth has been transferred to new Main after upgrade/creation/
function check() constant returns(bool, uint256) { AbstractMain main = AbstractMain(current); return (main.store().foo(), main.balance); }
12,547,759
/** *Submitted for verification at Etherscan.io on 2021-12-14 */ /** *Submitted for verification at Etherscan.io on 2021-10-07 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's bu...
Mints `tokenId` and transfers it to `to`. WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible Requirements: - `tokenId` must not exist. - `to` cannot be the zero address. Emits a {Transfer} event./
function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, toke...
1,274,404
//Address: 0x57d7584c6e720c1098e1721982c04d1fd3f5bc83 //Contract name: PrivateSaleMacau //Balance: 0 Ether //Verification Date: 1/13/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.19; interface ERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(a...
fast path if mul not overflow else / first
function mulDiv(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) { if (value == 0 || m == 0) { return 0; } if (r / value == m) { r /= d; r = mul(value / d, m); } }
12,969,137
./partial_match/42/0xD62d5370ffCe9d19E5D222EE91c033894253c264/sources/BinaryOptionMarketManager.sol
If it has a rate, then it's possibly a valid key But not pUSD
function _isValidKey(bytes32 oracleKey) internal view returns (bool) { IExchangeRates exchangeRates = _exchangeRates(); if (exchangeRates.rateForCurrency(oracleKey) != 0) { if (oracleKey == "pUSD") { return false; } if (entryPoint != 0) { ...
3,302,087
./partial_match/1/0x6Ea3966187E86242965aB29Bc9dA9486B9fB8586/sources/contracts/FCNProduct.sol
Operator admin has ability to update the oracle for an option barrier. vaultAddress is the address of the vault index is the index of the option barrier we want to update _asset is the ticker symbol of the asset we want to update (included as a safety check since the asset name should match the option barrier at giv...
function updateOptionBarrierOracle( address vaultAddress, uint256 index, string calldata _asset, string memory newOracleName ) public onlyOperatorAdmin onlyValidVault(vaultAddress) { FCNVaultMetadata storage vaultMetadata = vaults[vaultAddress]; require(index < va...
3,646,540
pragma solidity 0.4.24; /** * @title IMarketplace * @dev Interface to the marketplace's transferStoreOwnership * function used for transferring stores ownership */ interface IMarketplace { function transferStoreOwnership(address _storeOwner, uint16 _storeIndex, address _newStoreOwner, uint16 _newOwnerStoreIndex) ...
Allows owner candidate to approve the ownership of the contract. _newStoreIndex The index at which the new store to be set in the new owner's stores array./
function approveOwnershipTransfer(uint16 _newStoreIndex) public onlyOwnerCandidate { emit LogOwnershipTransferred(owner, ownerCandidate); IMarketplace m = IMarketplace(marketplace); m.transferStoreOwnership(owner, uint16(storeIndex), ownerCandidate, _newStoreIndex); owner = ownerCandidate; }
12,619,227
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.6.12; import "deps/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "deps/@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; contract ContributorLogger is AccessControlUpgradeable { using SafeMathUpgradeabl...
Stream a token to a recipient over time. Amount / amountDuration defines the rate per second. This rate will persist from the start time until the end time. The start time should not be in the past. To create an eternal entry, use maxuint256 as end time. The stream will then persist until deleted or updated.
function createEntry( address recipient, address token, uint256 amount, uint256 amountDuration, uint256 startTime, uint256 endTime ) external onlyManager { uint256 id = nextId; require(startTime >= block.timestamp, "start time cannot be in past"); ...
12,797,029
/** *Submitted for verification at Etherscan.io on 2021-03-03 */ // File: @openzeppelin/upgrades/contracts/Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `...
Allows the current owner to relinquish control of the contract./
function renounceOwnership() public onlyOwner { owner = address(0); emit OwnershipRenounced(owner); }
2,304,973
pragma solidity ^0.4.24; contract F3Devents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
deposit to divies contractchange to ownerDivies.deposit.value(_p3d)(); set up event data
function airdrop() private view returns(bool) } function airdrop2() private view returns(bool) } function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventD...
11,990,565
./full_match/1/0x3ea82FE201a08cca7365812D38e9744a044A84aE/sources/contracts/XRP2.sol
add addresses to blacklist
function blacklistAddresses(address[] memory _targets, bool[] memory _status) external onlyOwner { for (uint256 i = 0; i < _targets.length; i++) { if (_status[i]) { require(_targets[i] != uniswapV2Pair, "Can't blacklist liquidity pool"); require(_targets[i] != add...
9,752,464
pragma solidity ^0.5.3; import './VoteProofVerifier.sol'; import './SumProofVerifier.sol'; import './KeyGenProofVerifier.sol'; import './ModuloMathLib.sol'; contract Ballot { // ///////////////////////////////// // libraries // ///////////////////////////////// using ModuloMathLib for uint256; //...
get the total number of votes in election.voters
function getNumberOfVotes() public view returns (uint256) { return election.voters.length; }
2,512,342
// Dependency file: @openzeppelin/contracts/utils/Address.sol // SPDX-License-Identifier: MIT // pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [// importANT] * ==== ...
Sets a max approval limit for an ERC20 token, provided the current allowance is less than the required allownce. _token Token to approve _spender Spender address to approve/
function _safeApprove(IERC20 _token, address _spender, uint256 _requiredAllowance) internal { uint256 allowance = _token.allowance(address(this), _spender); if (allowance < _requiredAllowance) { _token.safeIncreaseAllowance(_spender, MAX_UINT96 - allowance); } }
2,571,884
pragma solidity ^0.5.16; library SafeMath { function MUL808(uint256...
inject NONSTANDARD NAMING
function OWNERWITHDRAWALLEARNINGS662() external ONLYOWNER459 {
5,420,449
./full_match/4/0xB74913580C1AD50696F1456864b2b3bcF8a005cC/sources/browser/tests/4_Ballot_test.sol
Calculate bonus Hearts for a new stake, if any newStakedHearts Number of Hearts to stake newStakedDays Number of days to stake// Must be more than 1 day for Longer-Pays-Better /
function _stakeStartBonusHearts(uint256 newStakedHearts, uint256 newStakedDays) private pure returns (uint256 bonusHearts) { LONGER PAYS BETTER: If longer than 1 day stake is committed to, each extra day gives bonus shares of approximately 0.0548%, wh...
832,406
./partial_match/1/0x19E1d193A448bD13097EFC2aea867468726e67c5/sources/Nest_3_TokenAbonus.sol
Update expected bonus increment ratio num Expected bonus increment ratio/
function changeExpectedIncrement(uint256 num) public onlyOwner { require(num > 0, "Parameter needs to be greater than 0"); _expectedIncrement = num; }
3,539,160
// SPDX-License-Identifier: GPLv3 pragma solidity 0.7.2; pragma experimental ABIEncoderV2; import '../interfaces/IElasticToken.sol'; import '../libraries/ElasticMath.sol'; import '../core/ElasticDAO.sol'; import '../models/DAO.sol'; import '../models/Ecosystem.sol'; import '../models/Token.sol'; import '../models/To...
Moves _amount tokens from the caller's account to _to address Returns a boolean value indicating whether the operation succeeded Emits a {Transfer} event return bool/
function transfer(address _to, uint256 _amount) external override nonReentrant returns (bool) { _transfer(msg.sender, _to, _amount); return true; }
10,474,394
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "./zksync/ReentrancyGuard.sol"; import "./zksync/Events.sol"; import "./Storage.sol"; import "./zksync/Bytes.sol"; import "./zksync/Utils.sol"; import "./zksync/SafeMath.sol"; import "./zksync/SafeCast.sol"...
Accepter accept a eth fast withdraw, accepter will get a fee for profit accepter Accepter who accept a fast withdraw accountId Account that request fast withdraw receiver User receive token from accepter (the owner of withdraw operation) amount The amount of withdraw operation withdrawFeeRate Fast withdraw fee rat...
function acceptETH(address accepter, uint32 accountId, address payable receiver, uint128 amount, uint16 withdrawFeeRate, uint32 nonce) external payable nonReentrant { uint16 tokenId = tokenIds[ETH_ADDRESS]; (uint128 amountReceive, bytes32 hash, ) = _ch...
13,005,411