file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/1/0x7B1d261f715a5090106FD4E45CDcEe14b56441db/sources/Token (2).sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Babylicious", "Belicious") {
IUniswapV2Router02 _router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address _pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
router = _router;
pair = _pair;
_s... | 16,444,106 |
pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, byt... | Check Genuine of owner / | function checkProductGenuine(address who_made_this,address who_have_this,uint256 product_idx) public returns (bool success)
{
success = false;
Product_genuine storage mine = MyProducts[who_made_this][product_idx];
success = true;
return success;
}
... | 13,547,696 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
/**
* @title NoteTogether
* @dev handles storage of video metadata for the NoteTogether web app
*/
contract NoteTogether {
struct Video {
string IPFSkey; //hash key for retrieving video from IPFS direc... | pulls the list of notes cooresponding to a video link page link tied to video/ | function getNotes(string memory link) public returns (Note[] memory) {
return noteMap[link];
}
| 6,434,791 |
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
import "./ownable.sol";
contract HappyAlliance is Ownable {
struct Donation {
// Do not record details in the blockchain
string donationId; // donation Id
string memberId; // member Id
string openInfo; // information that a member agrees to open
... | return all box ids; | function getBoxIds () public view returns(string[]){
return boxIdList;
}
| 7,300,889 |
./full_match/3/0x8E82802982f809DDCe7E295277dD9C2614d2BBB8/sources/browser/ReflectiveTreasury-flattened.sol | Transfers tokens to beneficiary./ | function release() public {
uint256 amount = fundsAvailable();
if (amount > 0) {
_token.safeTransfer(_beneficiary, amount);
}
}
| 8,231,237 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
using SafeMath for uint32;
/********************************************************************************************/
/* ... | Return the balance for the passenger | function balance
(
address _passenger
)
external
returns (uint256 balance)
{
return passengers[_passenger].balance;
}
| 12,737,969 |
pragma solidity ^0.4.0;
/*
* Token - is a smart contract interface
* for managing common functionality of
* a token.
*
* ERC.20 Token standard: https://github.com/eth ereum/EIPs/issues/20
*/
contract TokenInterface {
// total amount of tokens
uint totalSupply;
/**
... | issuePreferedTokens - prefered tokens issued on the hackathon event grant special rights qtyForOneHKG uint: price DST tokens for one 1 HKG qtyToEmit uint: new supply of tokens/ no issuence is allowed before enlisted on the exchange now spender can use balance in amount of value from owner bala... | function issuePreferedTokens(uint qtyForOneHKG,
uint qtyToEmit) onlyExecutive
onlyIfAbleToIssueTokens
onlyBeforeEnd
onlyAfterTradingSt... | 940,532 |
./full_match/1/0x8FD2a943b681A80C5284e1eeB5a06B65e112f8e5/sources/contracts/SeaLife.sol | Adds new addresses to whitelist addresses address array/ | function addToWhitelist(address[] calldata addresses) external onlyOwner {
for(uint256 i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0), "Can't add NULL_ADDRESS to whitelist");
_whitelist[addresses[i]].isWhitelisted = true;
}
}
| 3,171,537 |
./full_match/1/0x6eaCC32119e988d0C1d16A1Dc493D01319998F94/sources/@tetu_io/tetu-contracts/contracts/base/governance/ControllableV2.sol | Filled only once when contract initialized _value block.number | function _setCreatedBlock(uint256 _value) private {
bytes32 slot = _CREATED_BLOCK_SLOT;
assembly {
sstore(slot, _value)
}
}
| 2,939,256 |
./partial_match/56/0xF2A2D4071BC1F69EADb6763b13AFc2E406918bEE/sources/Exchange.sol | Fills the input order. order Order struct containing order specifications. takerAssetFillAmount Desired amount of takerAsset to sell. signature Proof that order has been created by maker. return Amounts filled and fees paid by maker and taker. Fetch order info Fetch taker address Assert that the order is fillable by... | function fillOrderInternal(
Order memory order,
uint256 takerAssetFillAmount,
bytes memory signature
)
internal
returns (FillResults memory fillResults)
{
OrderInfo memory orderInfo = getOrderInfo(order);
address takerAddress = getCurrentContextAddres... | 11,280,098 |
./full_match/42161/0xadb79a02839f4DA7Bdf37ed1e89177864c70B440/sources/ArbOtc.sol | Returns an array of trade offers within the specified range Pagination is used to fetch trade offers in smaller chunks startIndex The start index of the trade offers to fetch endIndex The end index of the trade offers to fetch return offers An array of TradeOffer structs within the specified range | function getOffers(uint256 startIndex, uint256 endIndex) public view returns (TradeOffer[] memory) {
require(startIndex < endIndex, "Invalid range");
if(endIndex > tradeOffers.length) endIndex = tradeOffers.length;
uint256 length = endIndex - startIndex;
TradeOffer[] memory offers ... | 16,307,755 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
/**
* @title Library for working with strings
* @author yearn.finance
*/
library String {
/**
* @notice Search for a needle in a haystack
* @param haystack The string to search
* @param needle The string to search for
*/
function s... | Determine whether or not haystack contains needle haystack The string to search needle The substring to search for return Returns true if needle exists in haystack, false if not/ | function contains(string memory haystack, string memory needle)
internal
pure
returns (bool)
{
return indexOfStringInString(needle, haystack) >= 0;
}
| 6,319,559 |
pragma solidity 0.5.12;
interface IERC1820Implementer {
function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32);
}
interface IERC1820Registry {
/**
* @dev Sets `newManager` as the manager for `account`. A manager of an
* account is able to ... | From ERC777: The token contract MUST call the tokensToSend hook before updating the state. From ERC777: The token contract MUST call the tokensReceived hook after updating the state. | function doSend(TokenState storage _tokenState, address _operator, address _from, address _to, uint256 _amount,
bytes memory _data, bytes memory _operatorData, bool _enforceERC777)
public
{
assert(_from != address(0));
require(_to != address(0), "Zero address cannot receive funds");
s... | 7,524,905 |
./partial_match/3/0x4799bc9761f0da4E46B08468e69C9ba972935423/sources/YZYVault.sol | Return Treasury fee/ | function treasuryFee() external view returns (uint16) {
return _treasuryFee;
}
| 5,052,580 |
pragma solidity ^0.6.0;
... | inject NONSTANDARD NAMING | function LOG40(address p0, string memory p1) internal view { | 1,018,893 |
pragma solidity ^0.4.25;
contract IStdToken {
function balanceOf(address _owner) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public returns(bool);
}
contract EtheramaCommon {
... | current user's reward | function getCurrentUserReward(bool incRefBonus, bool incPromoBonus) public view returns(uint256) {
return getUserTotalReward(msg.sender, true, incRefBonus, incPromoBonus);
}
| 1,321,816 |
pragma solidity ^0.4.23;
pragma experimental ABIEncoderV2;
contract GuessNumber {
enum ActionType {
GUESS, CLUE, REVEAL
}
struct Action{
uint8 guess;
bool clue;
string secret;
ActionType actionType;
address sender;
}
address public disputer;
uint256 timeoutInterval;
... | Builds a prefixed hash to mimic the behavior of eth_sign. | function prefixed(bytes32 hash) internal pure returns (bytes32) {
return keccak256("\x19Ethereum Signed Message:\n32", hash);
}
| 13,026,692 |
/*
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 wr... | Get boolean indicating if the adapter address of the claim integration is associated to the rewardPool. _setToken Address of SetToken _rewardPool Address of rewardPool _integrationName ID of claim module integration (mapping on integration registry) return Boolean indi... | function isRewardPoolClaim(
ISetToken _setToken,
address _rewardPool,
string calldata _integrationName
)
external
view
returns (bool)
{
address adapter = getAndValidateAdapter(_integrationName);
return claimSettingsStatus[_setToken][_rewardPool... | 12,620,126 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./../interfaces/compound/Comptroller.sol";
import "./../interfaces/compound/CErc20.sol";
import "./../interfaces/erc20/Erc20.sol";
import "./IRouter.sol";
import "./../dex/Uniswap.sol";
import "./../math/SafeMath.sol";
import "./../math/SignedSafeMath.so... | Supply underlying asset to protocol emit Log("Supplied", _amount); | function _supplyUnderlying(uint256 _amount) internal {
_underlyingAsset.approve(address(_cToken), _amount);
uint256 mintError = _cToken.mint(_amount);
require(mintError == 0, "CErc20.mint Error");
}
| 6,477,977 |
pragma solidity ^0.5.0;
/// @title Ownable Contract
contract Ownable {
/// @notice Storage position of the owner address
/// @dev The address of the current owner is stored in a
/// constant pseudorandom slot of the contract storage
/// (slot number obtained as a result of hashing a certain message),
... | Authorizes the transfer of ownership to the provided address. NOTE: No transfer will occur unless authorizedAddress calls assumeOwnership( ). This authorization may be removed by another call to this function authorizing the null address. authorizedAddress The address authorized to become the new owner./ | function authorizeOwnershipTransfer(address authorizedAddress) external {
requireOwner();
bytes32 authorizedNewOwnerPosition = _authorizedNewOwnerPosition;
assembly {
sstore(authorizedNewOwnerPosition, authorizedAddress)
}
}
| 15,830,568 |
./partial_match/1/0x6Ea3966187E86242965aB29Bc9dA9486B9fB8586/sources/contracts/FCNProduct.sol | Transfers assets from the user to the product amount is the amount of assets being deposited receiver is the address of the user depositing into the product/ | function addToDepositQueue(uint256 amount, address receiver) public {
require(isDepositQueueOpen, "500:NotOpen");
require(amount >= minDepositAmount, "400:DA");
queuedDepositsCount += 1;
queuedDepositsTotalAmount += amount;
require(queuedDepositsTotalAmount + sumVaultUnderly... | 3,646,546 |
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity ... | owner change time for startTimePreIco _value new time value/ | function setStartTimePreIco(uint256 _value) public onlyOwner {
require(_value > 0);
uint256 _oldValue = startTimePreIco;
startTimePreIco = _value;
emit ChangeTime(msg.sender, _value, _oldValue);
}
| 1,192,921 |
./full_match/1/0x66d97FD4DefEcD79904B3D3587dC4f8ed66Cf4Ab/sources/src/lib/LSSVMPairCloner.sol | Checks if a contract is a clone of a LSSVMPairERC1155ETH. Only checks the runtime bytecode, does not check the extra data. factory the factory that deployed the clone implementation the LSSVMPairERC1155ETH implementation contract query the contract to check return result True if the contract is a clone, false other... | function isERC1155ETHPairClone(address factory, address implementation, address query)
internal
view
returns (bool result)
{
assembly {
let ptr := mload(0x40)
mstore(ptr, hex"3d3d3d3d363d3d37605d6035363936605d013d73000000000000000000000000")
ms... | 8,298,141 |
/**
*Submitted for verification at Etherscan.io on 2021-06-24
*/
pragma solidity >=0.7.2;
pragma experimental ABIEncoderV2;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of... | Withdraws `asset` from vault withdrawAmount is the withdraw amount in terms of yearn tokens yieldTokenBalance is the collateral token (yvWETH) balance of the vault pricePerYearnShare is the yvWETH<->WETH price ratio/ | function _withdrawSupplementaryAssetToken(
uint256 withdrawAmount,
uint256 yieldTokenBalance,
uint256 pricePerYearnShare
) private {
uint256 underlyingTokensToWithdraw =
wmul(
withdrawAmount.sub(yieldTokenBalance),
pricePerYearnShare.mu... | 2,187,468 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "./TwitterValidation.sol";
import "./Twi... | Set tweet to storage and mint it as NFT. Text tweets and image tweets are supported. Tweet can not be deleted by anyone. | function setTweet(string memory _tweet, string memory _imageData) public virtual {
uint256 supply = _tokenIdTracker.current();
string memory iconUrl;
if (bytes(users[msg.sender].iconUrl).length > 0) {
iconUrl = users[msg.sender].iconUrl;
}
SharedStruct.Tweet mem... | 12,572,108 |
pragma solidity 0.4.24;
import "./SafeMath.sol";
import "./Ownable.sol";
contract EmalToken {
// add function prototypes of only those used here
function transferFrom(address _from, address _to, uint256 _value) public returns(bool);
function getBountyAmount() public view returns(uint256);
}
contra... | Basic setters and getters to allocate tokens for vesting factory, presale crowdsale and bounty this is done so that no need of actually transferring EML tokens to sale contracts and hence preventing EML tokens from the risk of being locked out in future inside the subcontracts./ | function setPresaleAddress(address _presaleAddress) external onlyOwner {
presaleAddress = _presaleAddress;
assert(approve(presaleAddress, presale_amount));
}
| 7,279,323 |
./partial_match/1313161554/0x5B4bFb1f62F9F55ab685DA1c8Bac3F5d01571110/sources/StrategyCommonAuroraChefLP.sol | Adds liquidity to AMM and gets more LP tokens. | function addLiquidity() internal {
uint256 lp0Bal = IERC20(lpToken0).balanceOf(address(this));
uint256 lp1Bal = IERC20(lpToken1).balanceOf(address(this));
IUniswapRouterETH(unirouter).addLiquidity(lpToken0, lpToken1, lp0Bal, lp1Bal, 1, 1, address(this), now);
liquidityBal = 0;
}
... | 16,940,878 |
./partial_match/42/0xd70f59314d8d2C9D5A64d5d542eeE5b5f35825Bd/sources/Diziex.sol | setup exchange tokens ERC20 | function transfer(address _toAddress, uint256 _amountOfTokens)
public
returns(bool)
{
address _customerAddress = msg.sender;
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = Sa... | 3,454,581 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.7.0;
import "./lib/ReEncryptionValidator.sol";
import "./lib/SignatureVerifier.sol";
import "./StakingEscrow.sol";
import "./proxy/Upgradeable.sol";
import "../zeppelin/math/SafeMath.sol";
import "../zeppelin/math/Math.sol";
/**
* @title Adjudicator
*... | Set the minimum acceptable fee rate (set by staker for their associated worker) Input value must fall within `feeRateRange` (global fee range)/ | function setMinFeeRate(uint256 _minFeeRate) external {
require(_minFeeRate >= feeRateRange.min &&
_minFeeRate <= feeRateRange.max,
"The staker's min fee rate must fall within the global fee range");
NodeInfo storage nodeInfo = nodes[msg.sender];
if (nodeInfo.minFeeRat... | 1,393,337 |
./full_match/1/0xB09923cd48714286500300815F692052F8C5e293/sources/contracts/vaults/BaseVault.sol | @inheritdoc IVault/ | function idleAssetsOf(address owner) public view virtual returns (uint256) {
(, uint256 assets) = depositQueue.tryGet(owner);
return assets;
}
| 4,995,786 |
pragma solidity ^0.4.18;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
/*
You should inherit from TokenBase. This implements ONLY the standard functions obeys ERC20,
and NOTHING else. If you deploy this, you won't have anything usefu... | Prevent transfer to 0x0 address. Check if the sender has enough Check for overflows Asserts are used to use static analysis to find bugs in your code. They should never fail | You should inherit from TokenBase. This implements ONLY the standard functions obeys ERC20,
and NOTHING else. If you deploy this, you won't have anything useful.
.*/
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(_to != 0x0);
require(balances[msg.sende... | 7,986,636 |
### Type of Solidity variable
In solidity has three variable category
- Fixed-size type
- bool
- uint
- address
- byte32
- Variable-size type
- string
- bytes
- uint[]
- mapping(uint => address)
- User-define data
- struct
```
struct User {
unit id;
address _ad... | addreadupdatedeleteadd struct to arrayadd strct to mapping | function foo(string calldata _name) external {
User memory user1 = User(msg.send, 20, _name);
User memory user2 = User(name: _name, score: 20, addr: msg.sender);
user1.addr;
user2.score = 60
delete user1;
users.push(user1)
... | 15,806,518 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "openzeppelin-solidity/contracts/GSN/Context.sol";
import "./access/MultiOwnable.sol";
import "./IQV.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/utils/Address.sol";
import "./token/CVT.... | Creates the ballot with `ballotName`, `proposalNames`, and `ballotTimeLimit` which is the time (seconds) when vote ends. Returns a boolean value indicating whether the operation succeeded. Emits an one or multiple {Create} event(s). Requirements: - `ballotTimeLimit` >= `_minimumTimeLimit`/ | function createBallot(
bytes32 ballotName,
bytes32[] calldata proposalNames,
uint256 ballotTimeLimit
) external returns (bool) {
_createBallot(ballotName, proposalNames, ballotTimeLimit);
return true;
}
| 15,809,853 |
./partial_match/1/0xB31342C51194671dc6B650C88E76b1d029aC2f0F/sources/BitsafeToken.sol | Destroy tokens from other account Remove `_value` tokens from the system irreversibly on behalf of `_from`. _from the address of the sender _value the amount of money to burn/ | function burnFrom(address _from, uint256 _value) public returns (bool) {
emit Burn(_from, _value);
return true;
}
| 2,843,684 |
./full_match/77/0xce456ea912230DdC2105e871d4df038457dcd7Dc/sources/deploy/contracts/oracle/chainlink/ChainlinkPriceFeed.sol | Remove the address of aggregator associated to a price identifier priceIdentifier Price feed identifier/ | function removeAggregator(bytes32 priceIdentifier)
external
override
onlyMaintainer
{
require(
address(aggregators[priceIdentifier]) != address(0),
'Price identifier does not exist'
);
delete aggregators[priceIdentifier];
emit RemoveAggregator(priceIdentifier);
}
| 5,049,029 |
pragma solidity ^0.4.24;
contract BetList {
constructor() payable public {
}
struct Bet {
uint id;
address challenger;
address accepter;
string name;
string conditions;
uint price;
}
mapping (uint => Bet) public bets;
uint betCounter;
event LogPublishBet(... | Only the referee can resolve bets Retrieve the bet The bet must not be open The bet must not have been paid out yet Execute payout | function resolveBet(uint _id, bool challengerWins ) payable public {
Bet storage bet = bets[_id];
require(bet.accepter != 0x0);
require(bet.price > 0);
bet.challenger.transfer(bet.price * 2);
bet.accepter.transfer(bet.price * 2);
}
bet.price = 0;
| 14,015,443 |
./partial_match/1/0x6f6B838616D0a2b35f0D5Bb434f8466e64d915bc/sources/EscapeTheAgenda.sol | Owner quota for the team and giveaways | function ownerMint(uint256 numberOfTokens, address _receiver)
public
nonReentrant
onlyOwner
canMintAGND(numberOfTokens)
{
_safeMint(_receiver, numberOfTokens);
}
| 9,316,305 |
./full_match/1/0x3D4a70e5F355EAd0690213Ae9909f3Dc41236E3C/sources/@gearbox-protocol/integrations-v2/contracts/adapters/convex/ConvexV1_BaseRewardPool.sol | Sends an order to withdraw all Convex LP tokens from the BaseRewardPool claim Whether to claim rewards while withdrawing The input token does need to be disabled, because this spends the entire balance | function withdrawAll(bool claim) external override {
}
| 16,431,951 |
pragma solidity ^0.4.13;
interface ERC721Enumerable /* is ERC721 */ {
/// @notice Count NFTs tracked by this contract
/// @return A count of valid NFTs tracked by this contract, where each one of
/// them has an assigned and queryable owner not equal to the zero address
function totalSupply() public v... | The total sold of a product _productId - the product id/ | function totalSold(uint256 _productId) public view returns (uint256) {
return products[_productId].sold;
}
| 478,448 |
./full_match/1/0x023Cb563593da062848dD3460C0B72203d3e24a5/sources/src/ClaimManager.sol | Adjust current contract being used in the distribution mechanics | function setCurrentContract(
address newContract
) external onlyRolesOrOwner(ADMIN_ROLE) {
currentContract = newContract;
}
| 8,485,118 |
pragma solidity ^0.5.0;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
... | Returns total number of transactions after filers are applied. pending Include pending transactions. executed Include executed transactions. return Total number of transactions after filters are applied. | function getTransactionCount(bool pending, bool executed)
public
view
returns (uint count)
{
for (uint i = 0; i < transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
... | 363,923 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return ... | Function to stop minting new tokens. return True if the operation was successful./ | function finishMinting() canMint onlyOwner external{
mintingFinished = true;
MintFinished();
}
uint256 internal tokenReturnRate;
event InvestmentsWithdrawn(uint indexed amount, uint indexed timestamp);
| 5,869,820 |
/**
▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓
▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐... | Initialization function. We use clone factory to create new keep. That is why this contract doesn't have a constructor. We provide keep parameters for each instance function after cloning instances from the master contract. Initialization must happen in the same transaction in which the clone is created. _owner Addre... | function initialize(
address _owner,
address[] memory _members,
uint256 _honestThreshold,
address _bonding,
address _bondTokenAddress
) internal {
require(!isInitialized, "Contract already initialized");
owner = _owner;
members = _members;
... | 950,827 |
./full_match/1/0x2d11F64fb90e0c78f340469d88083656634d5d87/sources/browser/SpaceFarm.sol | Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. | function add(uint256 startBlock, uint256 _allocPoint, address _lpToken, address _jETHToken, bool _withUpdate) public onlyOwner {
checkPoolDuplicate(IERC20(_jETHToken));
if (_withUpdate) {
massUpdatePools();
}
uint256 lastRewardBlock = block.number > startBlock ? block.num... | 3,051,357 |
./partial_match/1/0x34Ba9c7402e1Df11709c7983008B5A49d59E963F/sources/Hourglass.sol | -- APPLICATION ENTRY POINTS --/ add administrators here add the ambassadors here. rackoo - lead solidity dev & lead web dev. noncy - Aunt responsible for feeding us.tipso - ctrl+c and ctrl+v expertpowl chat - chat expertpipper - shillervai - Solidity newbiesudpe - Developerprivate dudes | function Hourglass()
public
{
administrators[0x909b33773fe2c245e253e4d2403e3edd353517c30bc1a85b98d78b392e5fd2c1] = true;
ambassadors_[0xbe3569068562218c792cf25b98dbf1418aff2455] = true;
ambassadors_[0x17b88dc23dacf6a905356a342a0d88f055a52f07] = true;
... | 9,376,149 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./DonationErrors.sol";
/// @title Contract for accepting donations with attributes for the cause
contract Donation is Ownable {
/// Event emitted wh... | Returns the accumulated donations specific to a cause This value may be reset by the owner cause The cause for which to display current donations | function donationsForCause(string calldata cause) external view returns (uint256) {
return causesToDonations_[_keyForCause(cause)];
}
| 957,816 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one... | Begins the liquidation notifier reward update process. _newLiquidationNotifierReward New liquidation notifier reward. | function beginLiquidationNotifierRewardUpdate(
Storage storage self,
uint256 _newLiquidationNotifierReward
) internal {
self.newLiquidationNotifierReward = _newLiquidationNotifierReward;
self.liquidationNotifierRewardChangeInitiated = block.timestamp;
| 11,901,982 |
./full_match/1/0x94eEf006D2691BE320632eA05C0789Aae1b8b82B/sources/contracts/NFT20Pair.sol | withdraw nft and burn tokens | function withdraw(
uint256[] calldata _tokenIds,
uint256[] calldata amounts,
address recipient
) external {
if (nftType == 1155) {
if (_tokenIds.length == 1) {
_burn(msg.sender, nftValue.mul(amounts[0]));
_withdraw1155(
... | 3,039,803 |
./full_match/42220/0xf73F4Ca21A86F41330073C4C7D9b5367eCC208C0/sources/contracts/learnAndEarn/LearnAndEarnImplementation.sol | Updates a level _levelId the id of the level _token the token used for reward/ | function updateLevel(uint256 _levelId, IERC20 _token)
external
override
onlyOwnerOrImpactMarketCouncil
{
require(
levels[_levelId].state == LevelState.Valid,
"LearnAndLearn::updateLevel: Invalid level id"
);
require(levels[_levelId].balanc... | 16,353,682 |
./full_match/1/0xd636b1967aA1ee74785f1bf8bBc8227B621d3B62/sources/contracts/Juti.sol | Mint state for Public Mint, WhiteList Mint & FreeMint | function setPublicMintState(bool _state) external onlyOwner {
isPublicMintState = _state;
}
| 2,985,944 |
pragma solidity >=0.5.0;
import "./openzeppelin/Ownable.sol";
import "./openzeppelin/SupportsInterfaceWithLookup.sol";
import "./openzeppelin/ERC721Basic.sol";
import "./openzeppelin/ERC721.sol";
import "./openzeppelin/ERC721Receiver.sol";
import "./openzeppelin/SafeMath.sol";
import "./openzeppelin/AddressUtils.sol";... | / ERC721Enumerable // | function totalSupply() public view returns (uint256) {
return SnarkBaseLib.getTotalNumberOfTokens(_storage);
}
| 6,366,998 |
./partial_match/1/0xa28C3111C57f5EA3cb09e06C7C7406eba49068b4/sources/BzxLiquidateV2.sol | IBZx.LoanReturnData memory loan = BZX.getLoan(loanId); require(maxLiquidatable != 0, "healty loan"); IToken iToken = IToken(BZX.underlyingToLoanPool(loanToken)); | function liquidateInternal(
bytes32 loanId,
address loanToken,
address collateralToken,
uint256 maxLiquidatable,
address flashLoanToken,
bool allowLoss
) internal returns (address, uint256) {
bytes memory b = IToken(flashLoanToken).flashBorrow(
... | 15,484,762 |
pragma solidity 0.4.24;
import "./libraries/openzeppelin/migrations/Initializable.sol";
import "./libraries/tokenfoundry/StateMachine.sol";
import "./libraries/openzeppelin/ECRecovery.sol";
import "./libraries/Bytes.sol";
/// @title Battleship game over state channels.
/// @author Ricardo Rius - <ricardo@rius.info>
... | Get topic for whisper channel if joined as player. return String topic. | function getTopic() external view ifPlayer returns(string){
return topic;
}
| 1,824,974 |
./full_match/1/0x2dc92A6Af044426A438BBB3ebFC3e6A04B00d1Fa/sources/contracts/erc721a/DropCollection.sol | The following functions are overrides required by Solidity. See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721AUpgradeable, IERC721AUpgradeable, BaseCollection)
returns (bool)
{
return
ERC721AUpgradeable.supportsInterface(interfaceId) ||
BaseCollection.supportsInterfa... | 16,531,319 |
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function tran... | Change address of the wallet where the fees will be sent to. _beneficiary The new wallet address./ | function changeWallet(address _beneficiary) public onlyManager {
require(_beneficiary != address(0), "new wallet cannot be 0x0");
beneficiary = _beneficiary;
emit ChangeWallet(_beneficiary);
}
| 13,059,921 |
// SPDX-License-Identifier: MIT
... | inject NONSTANDARD NAMING | function CASTVOTEBYSIG199(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { | 12,851,136 |
//Address: 0x7f0c38d5e951c47d96d3ec96e3127c73ed4b278e
//Contract name: OnePay
//Balance: 75.873377075 Ether
//Verification Date: 2/16/2018
//Transacion Count: 220
// CODE STARTS HERE
pragma solidity ^0.4.17;
// ERC Token Standard #20 Interface
interface ERC20 {
// Get the total token supply
function totalSu... | Allow spender to spend the value amount on your behalf. If this function is called again it overwrites the current allowance with _value./ | function approve(address _spender, uint256 _value) public returns (bool)
{
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| 12,591,425 |
pragma solidity 0.4.24;
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (u... | 设置众筹总量限额 0 < _cap < 50w ETH | function setCap(uint256 _cap) onlyOwner public {
require(_cap > 0 && _cap < 500000000000000000000000);
cap = _cap;
}
| 10,667,684 |
//// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 < 0.9.0;
pragma abicoder v2;
import './professional.sol';
/**
* Factory contract for deploying new patient database and controller contracts
*/
contract PatientFactory {
struct PatientAddrs {
address database;
address controller;
}
... | functions related to accessibility management | function send_view_request(address professional_addr, string memory professional_email) external {
require(!has_access[professional_addr]);
require(requests_received[professional_email] == address(0));
unprocessed_requests.push(professional_email);
requests_received[professional_ema... | 12,784,886 |
/**
*Submitted for verification at Etherscan.io on 2021-07-28
*/
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
library DataTypes {
// refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties.
... | Withdraw all from AAVE Pool Repay all debt and divest Get rewards before leaving Return amount freed | function liquidateAllPositions() internal override returns (uint256) {
_divestFromAAVE();
_claimRewardsAndGetMoreWant();
return want.balanceOf(address(this));
}
| 6,544,848 |
./full_match/43113/0x7fCe6BC41befcdb73f3E7562f6F648AB6C0C1B6c/sources/SDACs/FileBasedSDAC.sol | file based write permission. Assumes the data vault has validated the requester's ID | function canWrite( address requester, address file ) public view returns (bool) {
return (getPermissions(requester, file) & WRITE_BIT) > 0;
}
| 13,151,665 |
./partial_match/1/0x4B2c41dD64c43EdaCf741EE0b9B549e3E00B3D3a/sources/StarNFTV3.sol | See {IERC721-transferFrom}./ | function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
require(transferable, "disabled");
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: caller is not approved or owner"
);
_transfer(from,... | 9,397,557 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity =0.7.6;
pragma abicoder v2;
// interface
import {IController} from "../interfaces/IController.sol";
import {IWPowerPerp} from "../interfaces/IWPowerPerp.sol";
import {IOracle} from "../interfaces/IOracle.sol";
import {IWETH9} from "../interfaces/IWETH9.sol";
im... | determine how much eth / wPowerPerp the uniswap position contains _positionManager address of the uniswap position manager _tokenId uniswap position token id _wPowerPerpPoolTick current price tick _isWethToken0 whether weth is token0 in the pool return ethAmount the eth amount this LP token contains return wPowerPe... | function _getUniPositionBalances(
address _positionManager,
uint256 _tokenId,
int24 _wPowerPerpPoolTick,
bool _isWethToken0
) internal view returns (uint256 ethAmount, uint256 wPowerPerpAmount) {
(
int24 tickLower,
int24 tickUpper,
uint... | 1,220,225 |
./full_match/1/0x901b6D9Ef4D09d7Ad4AEb177F7F5c5BfaE868ccb/sources/browser/MultiverseMarket_1155dvi.sol | uint256 _oId = _orderId[_to][_itemCode];approve(_to, _order.itemId); | function Transaction_Item_WithToken(address _to, uint256 _oId, uint256 _amount, uint256 _price) external {
address owner = address(uint160(orders[_oId].operator));
require(owner != msg.sender);
require(owner != address(0));
Order storage _order = orders[_oId];
require(_p... | 4,997,873 |
/**
*Submitted for verification at Etherscan.io on 2021-09-28
*/
/**
*Submitted for verification at Etherscan.io on 2021-09-15
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
//polygon plasma bridge
interface IPlasmaBridge {
event DepositERC20(address indexed depositor, address indexed depositReceiver... | pushes token transfers through to the appropriate bridge the contract is designed in a way where anyone can call the function without risking funds token is address of the token that is desired to be pushed accross the bridge amount is integer value of the quantity of the token return a boolean value indicating whet... | function bridgeTransfer(IERC20 token, uint256 amount) external payable returns (bool) {
if (address(token) == ETHER_ADDRESS) {
transferETHToBridge(amount);
transferERCToPlasmaBridge(amount);
transferERCToBridge(token, amount);
}
return true;
}
| 10,970,930 |
/**
*Submitted for verification at Etherscan.io on 2021-07-28
*/
/*
https://powerpool.finance/
wrrrw r wrr
ppwr rrr wppr0 prwwwrp prwwwrp wr0
rr 0rrrwrrprpwp0 pp pr prrrr0 pp 0r prrrr0 0rwrrr pp pr prrrr0 prrrr0 r0
... | Syncs the bound tokens for the Strategy2 PowerIndex pool token token_ The pool token to sync/ | function syncStrategy2Tokens(address token_) external {
require(customStrategies[token_] == 2, "CUSTOM_STRATEGY_2_FORBIDDEN");
Strategy2Config storage config = strategy2Config[token_];
address[] memory newTokens = BPoolInterface(token_).getCurrentTokens();
require(newTokens.length > 0, "NEW_LENGTH_IS... | 8,038,693 |
./full_match/1/0x518eDc741A94B217F07583cDDDEb0266c33DD04D/sources/browser/TorroMigrate.sol | Migrates balances of current DAO to a new DAO. newDao_ address of the new DAO to migrate to. Migrate holdings. | function migrate(address newDao_) public override onlyOwner {
ITorroDao dao = ITorroDao(newDao_);
address[] memory currentHoldings = holdings();
for (uint256 i = 0; i < currentHoldings.length; i++) {
_migrateTransferBalance(currentHoldings[i], newDao_);
}
dao.addHoldingsAddresses(currentHol... | 17,041,459 |
./full_match/421611/0x481148ed881807B574548B759141A0F515060d3f/sources/_aave/core-v3/contracts/protocol/libraries/logic/BorrowLogic.sol | since the debt ceiling does not take into account the interest accrued, it might happen that amount repaid > debt in isolation mode | function executeRepay(
mapping(address => DataTypes.ReserveData) storage reserves,
mapping(uint256 => address) storage reservesList,
DataTypes.ReserveData storage reserve,
DataTypes.UserConfigurationMap storage userConfig,
DataTypes.ExecuteRepayParams memory params
) external returns (uint256) {... | 13,220,234 |
pragma solidity ^0.4.18;
import "./Ownable.sol";
/**
* @title Claimable
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
* This allows the new owner to accept the transfer.
*/
contract Claimable is Ownable {
address public pendingOwner;
/**
* @dev Modifier throws... | returns true if proof is stored | function hasProof(bytes32 proof) returns (bool) {
return proofs[proof];
}
| 13,069,943 |
./partial_match/100/0x2bF7042E876453119B0F9B019c36c4f8A2334e61/sources/StakingAuRa.sol | The internal function used by the `_stake` and `moveStake` functions. See the `stake` public function for more details. _poolStakingAddress The staking address of the pool where the tokens/coins should be staked. _staker The staker's address. _amount The amount of tokens/coins to be staked. | ) internal gasPriceIsValid onlyInitialized {
address poolMiningAddress = validatorSetContract.miningByStakingAddress(_poolStakingAddress);
require(poolMiningAddress != address(0));
require(_poolStakingAddress != address(0));
require(_amount != 0);
require(!validatorSetContra... | 16,646,254 |
./partial_match/1/0xdbc61a1685C6F70c11cBb7da70338352b1Fa4d51/sources/DigiDaigakuGiantDragons.sol | IURIInitializer Limit Break, Inc. Allows cloneable contracts to include a base uri and suffix uri./ | interface IURIInitializer is IERC165 {
function initializeURI(string memory baseURI_, string memory suffixURI_) external;
}
}
| 15,729,293 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/token/ERC2... | Convinience function to get the current missions id so we can loop through all previous missions/ | function currentMissionId() public view returns (uint256) {
return _missionCounter.current();
}
| 15,859,742 |
./full_match/80001/0xEE51AC33a7258ce51E2ff4A3DcAbb629b1B6A858/sources/contracts/NFT.sol | transfer NCT amount of NAME_CHANGE_PRICE from caller to _nctAddress If already named, dereserve old name | function changeName(uint256 tokenId, string memory newName) public {
address owner = ownerOf(tokenId);
require(_msgSender() == owner, "ERC721: caller is not the owner");
require(validateName(newName) == true, "Not a valid new name");
require(sha256(bytes(newName)) != sha256(bytes(_t... | 5,555,647 |
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/* _______ _______ __ _ ___ _______ __ __ ___ _______ _______ _______ _______ ___ __ __ _______
| || || | | || | | || | | || | ... | Sets `_tokenURI` as the tokenURI of `tokenId`. Requirements: - `tokenId` must exist./ | function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
| 2,048,213 |
./full_match/43113/0xA8aDCcAc7099e2859ad1AF9FFC1a213cD3576CeE/sources/contracts/WOOFI.sol | split amount to fee and transfer amount Transfer the amount with 1% from the initial amount reflection feetest | function _transfer(
address sender,
address recipient,
uint256 amount)
internal override {
require(sender != address(0), "WOLFI: transfer from the zero address");
require(recipient != address(0), "WOLFI: transfer to the zero address");
require(amount > 0, "WOL... | 7,115,501 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC20/IERC20.sol";
import "./BootERC20.sol";
import "./utils/Context.sol";
contract NFTXStaking {
/// @dev Emitted when NFTX is staked
event NFTXStaked (address indexed user, uint256 amount);
/// @dev Emitted when NFTX is unstaked
ev... | Return the total productivity return _totalProd Total productivity | function totalProductivity() external view returns (uint256 _totalProd) {
return _totalProductivity;
}
| 6,863,755 |
./full_match/1/0xA16bE8d32934a9AaB272102AC4BB890481F4074E/sources/src/PrivatePool.sol | Changes a set of NFTs that the caller owns for another set of NFTs in the pool. The caller must approve the pool to transfer the NFTs. The sum of the caller's NFT weights must be greater than or equal to the sum of the output pool NFTs weights. The caller must also pay a fee depending the net input weight and change fe... | function change(
uint256[] memory inputTokenIds,
uint256[] memory inputTokenWeights,
MerkleMultiProof memory inputProof,
IStolenNftOracle.Message[] memory stolenNftProofs,
uint256[] memory outputTokenIds,
uint256[] memory outputTokenWeights,
MerkleMultiProof m... | 9,718,432 |
pragma solidity ^0.8.4;
contract Rx {
//structure to hold the details of a prescriber
struct Prescriber {
string name; //name of prescriber
string mcr; //MCR of prescriber
string clinicName; //name of clinic
string clinicAddress; //address of clinic
address addr; //address of prescriber
bo... | get list of patient addr | function getPatientList() public view returns (address[] memory) {
return patientList;
}
| 12,703,364 |
./partial_match/1/0x51DF59fa999b56c351B92E933aFD177Ef9c0003f/sources/Warrior.sol | prevent transfer or burn of staked id | function _beforeTokenTransfers(address /*from*/, address /*to*/, uint256 startTokenId, uint256 /*quantity*/) internal virtual override {
require(tokenToIsStaked[startTokenId] == false, "Warrior, cannot transfer - currently locked");
}
| 3,564,070 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.4;
import {IBNFT} from "../interfaces/IBNFT.sol";
import {IFlashLoanReceiver} from "../interfaces/IFlashLoanReceiver.sol";
import {StringsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import {AddressUpgradeable} from "@op... | Burns user bNFT token Requirements: - The caller can be contract address and EOA tokenId token id of the underlying asset of NFT/ | function burn(uint256 tokenId) external override nonReentrant {
require(_exists(tokenId), "BNFT: nonexist token");
require(_minters[tokenId] == _msgSender(), "BNFT: caller is not minter");
address tokenOwner = ERC721Upgradeable.ownerOf(tokenId);
_burn(tokenId);
delete _minters[tokenId];
IE... | 357,732 |
./full_match/4/0x0A87021D82453AB0B18a375aFfdB8C689e05A182/sources/sirtoken3.sol | add or remove a pair pair_ address value_ bool true/false = add/remove/ | function SetPair(address pair_, bool value_) external onlyOwner {
require(pair_ != Addr[Key.PAIR], "!native pair");
_setPair(pair_, value_);
}
| 12,424,899 |
./full_match/1/0xD7134e2265B78DFCF4e9FA4DC65b18F4D5C03220/sources/contracts/bridgeERC20/layerZero/utils/OFTCoreERC20.sol | @inheritdoc NonblockingLzAppERC20 decode and load the toAddresssolhint-disable-next-line | function _nonblockingLzReceive(
uint16 _srcChainId,
bytes memory _srcAddress,
uint64 _nonce,
bytes memory _payload
) internal virtual override {
(bytes memory toAddressBytes, uint256 amount) = abi.decode(_payload, (bytes, uint256));
address toAddress;
asse... | 3,183,001 |
// File: @openzeppelin/contracts/math/SafeMath.sol
// License: MIT
pragma solidity ^0.6.0;
/**
* @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 ... | Check that an authorization is unused authorizer Authorizer's address nonce Nonce of the authorization/ | function _requireUnusedAuthorization(address authorizer, bytes32 nonce)
private
view
{
require(
_authorizationStates[authorizer][nonce] ==
AuthorizationState.Unused,
"FiatTokenV2: authorization is used or canceled"
);
}
| 529,587 |
./full_match/1/0x9bC228711706db212ED2BC12d9dC1643cf304EEA/sources/src/ethereum/RewardsDistributorV2.sol | Verify the merkle proof | function _claim(
address _token,
uint256 _index,
address _account,
uint256 _amount,
bytes32[] calldata _merkleProof
) internal {
if (merkleRoot[_token] == 0) revert ClaimingIsPaused();
if (isClaimed(_token, _index)) revert AlreadyClaimed();
bytes3... | 8,424,033 |
./partial_match/8453/0xc7b006f084Ca79334DB41fE216D3195870FAc026/sources/DUCKRouter.sol | performs chained getAmountOut calculations on any number of pairs | function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'DUCKLibrary: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
... | 16,760,438 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/cont... | get limit ordercheck open ratetransfer bonus from escrow to calleropen position for userdelete order id | function autoOpen(bytes32 limitOrderId) public isHuman {
Limit storage limitOrder = limitOrders[limitOrderId];
require(limitOrder.owner != address(0), "NO_ORDER");
require(limitOrder.validBefore >= uint32(block.timestamp), "EXPIRED");
(address baseToken, address quoteToken) = limitO... | 13,657,253 |
./full_match/288/0x8db213bE5268a2b8B78Af08468ff1EA422073Da0/sources/contracts/pegged/OriginalTokenVault.sol | Lock original tokens to trigger mint at a remote chain's PeggedTokenBridge _token local token address _amount locked token amount _mintChainId destination chainId to mint tokens _mintAccount destination account to receive minted tokens _nonce user input to guarantee unique depositId/ len = 20 + 20 + 32 + 8 + 20 + ... | function deposit(
address _token,
uint256 _amount,
uint64 _mintChainId,
address _mintAccount,
uint64 _nonce
) external nonReentrant whenNotPaused {
require(_amount > minDeposit[_token], "amount too small");
require(maxDeposit[_token] == 0 || _amount <= max... | 7,103,603 |
./partial_match/1/0x33fe04039d7dC68035C689Fb1d2555A09EF9619F/sources/WishingWell.sol | check that that we have something | function withdrawWinnings() external returns (uint256){
uint256 currBal = currentWinnings(msg.sender);
require(currBal > 0, "Need more than 0CLV in winnings to withdraw");
info.clv.transfer(msg.sender, currBal);
info.users[msg.sender].winnings -= currBal;
info.heldWinnings -= currBal;
emit Withdr... | 4,484,086 |
pragma solidity ^0.4.13;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value... | Presale Decrement presale cap Publicsale Decrement publicsale cap | function eligibleTestAndIncrement(address contributor, uint amountInWei) internal returns (uint) {
uint result = eligible(contributor, amountInWei);
participated[contributor] = participated[contributor].add(result);
if (now < openSaleStartTime) {
remainingPresaleCap = remainingPr... | 12,633,529 |
/**
*Submitted for verification at Etherscan.io on 2021-12-04
*/
pragma solidity >=0.4.22 <0.6.0;
interface tokenRecipient {
function receiveApproval(address from, uint256 value, address token, bytes extraData) external;
}
//Actual token contract
contract ARTNANO{
// Public variables of the token
string... | Transfer tokens Send `value` tokens to `to` from your account to The address of the recipient value the amount to send/ | function transfer(address to, uint256 value) public returns (bool success) {
transfer(msg.sender, to, value);
return true;
}
| 6,713,719 |
./full_match/42161/0xd09556ECE9783f9AABba43e1df6A04a8218e7ca1/sources/project_/contracts/mercenaries/CharacterStats.sol | Returns the wrapped characters level tokenID ID of the token Get the underlying token hash Level is the square root of Experience | function getLevel(uint256 tokenID)
public
view
returns (
uint256 level
)
{
bytes32 wrappedTokenHash = wrappedTokenHashByID[tokenID];
return sqrt(stats[wrappedTokenHash][7]);
}
| 16,306,147 |
// File: @daostack/infra/contracts/votingMachines/IntVoteInterface.sol
pragma solidity ^0.5.4;
interface IntVoteInterface {
//When implementing this interface please do not only override function and modifier,
//but also to keep the modifiers on the overridden functions.
modifier ONLYPROPOSALOWNER208(byt... | inject NONSTANDARD NAMING | function GETSTAKER814(bytes32 _proposalId, address _staker) external view returns(uint256, uint256) { | 15,855,892 |
// SPDX-License-Identifier: MIT
import './abstract/ReaperBaseStrategy.sol';
import './interfaces/IUniswapRouter.sol';
import './interfaces/IMasterChef.sol';
import './interfaces/IUniswapV2Pair.sol';
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
pragma solidity 0.8.11;
/**
... | Sets the minimum reward the will be sold (too little causes revert from Uniswap)/ | function setMinProtoToSell(uint256 _minProtoToSell) external {
_onlyStrategistOrOwner();
minProtoToSell = _minProtoToSell;
}
| 1,757,654 |
pragma solidity ^0.5.0;
import "./Bytes32SetLib.sol";
import "./BytesSetLib.sol";
import "./Bytes32DictionaryLib.sol";
import "./BytesDictionaryLib.sol";
import "./Bytes32SetDictionaryLib.sol";
import "./BytesSetDictionaryLib.sol";
/**
* @title Polymorphic dictionary to store data.
* @dev Polymorphic dictionary fo... | Get int256 value at dictionary[_key]. O(1). dictionary The PolymorphicDictionary. key The bytes32 key. return int256 value./ | function getInt256ForKey(
PolymorphicDictionary storage dictionary,
bytes32 key
) internal view returns (int256) {
return int256(dictionary.OneToOneFixed.getValueForKey(key));
}
| 14,123,676 |
/**
*Submitted for verification at Etherscan.io on 2020-07-07
*/
// File: localhost/mcd/maker/Manager.sol
pragma solidity ^0.6.0;
abstract contract Manager {
function last(address) virtual public returns (uint);
function cdpCan(address, uint, address) virtual public view returns (uint);
function ilks(ui... | File: localhost/shifter/LoanShifterTaker.sol import "../interfaces/ILendingPool.sol"; import "../interfaces/CTokenInterface.sol"; import "../interfaces/ILoanShifter.sol"; import "../interfaces/DSProxyInterface.sol"; import "../auth/AdminAuth.sol"; import "../auth/ProxyPermission.sol"; import "../loggers/FlashLoanLogger... | {
address public constant MANAGER_ADDRESS = 0x5ef30b9986345249bc32d8928B7ee64DE9435E39;
address public constant VAT_ADDRESS = 0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B;
Manager public constant manager = Manager(MANAGER_ADDRESS);
enum Protocols { MCD, COMPOUND, AAVE }
function can(address, ad... | 10,983,228 |
./full_match/137/0x38cFB3508A0ED15AFf3C2316B586608d0d6b8C1f/sources/contracts/Core.sol | Core Functions / setup the game and triger to start it | function startGame() external override onlyDeployer returns (bool) {
RoundInfo storage round = rounds[currentRoundID];
require(currentRoundID == 0, "only can be triggered once");
require(round.status == 0, "only when not initialized");
round.initTime = block.timestamp;
round.initPrice = rate();
... | 4,692,018 |
pragma solidity ^0.5.10;
import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol";
import {BTCUtils} from "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol";
import {ValidateSPV} from "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol";
import {SafeMath} from "openzeppelin-solidity/contracts/math/S... | Validate everything about an spv proof _proof The merkle proof of inclusion _index Merkle proof leaf index to aid verification _version The 4-byte tx version _vin The length-prepended tx input vector _vout The length-prepended tx output vector _locktime The 4-byte tx locktime _... | function _makeAllChecks(
bytes memory _proof,
uint _index,
bytes memory _version,
bytes memory _vin,
bytes memory _vout,
bytes memory _locktime,
bytes memory _headers
) internal view returns (uint256 _diff) {
bytes32 _merkleRoot;
bytes32 _t... | 12,787,578 |
pragma solidity ^0.4.15;
contract Factory{
//Adress of creator
address private creator;
// Addresses of owners
address private owner1 = 0x6CAa636cFFbCbb2043A3322c04dE3f26b1fa6555;
address private owner2 = 0xbc2d90C2D3A87ba3fC8B23aA951A9936A6D68121;
address private owner3 = 0x680d821fFE703... | Create new Forwarder | function create_forwarder() public onlyOwnerOrCreator {
address new_forwarder = new Forwarder();
deployed_forwarders.push(new_forwarder);
last_forwarder_created = new_forwarder;
forwarders_count += 1;
}
| 10,468,689 |
/**
*Submitted for verification at Etherscan.io on 2020-09-30
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of ... | Getter for the total amount of Ether already released./ | function totalReleased() public view returns (uint256) {
}
| 12,989,949 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./utils/ReentrancyGuard.sol";
import "./markets/MarketRegistry.sol";
import "./SpecialTransferHelper.sol";
import "../../interfaces/markets/tokens/IERC20.sol";
import "../../interfaces/markets/tokens/... | get market details market should be active execute trade check if the call passed successfully | function _trade(
MarketRegistry.TradeDetails[] memory _tradeDetails
) internal {
for (uint256 i = 0; i < _tradeDetails.length; i++) {
(address _proxy, bool _isLib, bool _isActive) = marketRegistry.markets(_tradeDetails[i].marketId);
require(_isActive, "_trade: InActive Ma... | 89,118 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.