file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/**
*Submitted for verification at Etherscan.io on 2022-02-18
*/
// File: Strings.sol
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `u... | Free OS Listings Whitelist OpenSea proxy contract for easy trading. | function isApprovedForAll(
address owner,
address operator
)
public
view
override(ERC721)
returns (bool)
{
ProxyRegistry proxyRegistry = ProxyRegistry(_openSea);
if (address(proxyRegistry.proxies(owner)) == operator) {
return true;
... | 2,383,519 |
./full_match/137/0x986CCa81B7EACbeAB2c2EaADB9046149b5f37E5c/sources/project_/src/contracts/TestCollection.sol | Returns the total number of tokens in existence./ | function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 ownerTokenCount = balanceOf(_owner);
uint256[] memory tokenIds = new uint256[](ownerTokenCount);
for (uint256 i; i < ownerTokenCount; i++) {
tokenIds[i] = tokenOfOw... | 4,672,065 |
/**
*Submitted for verification at Etherscan.io on 2020-06-05
*/
pragma solidity =0.6.6;
interface IHiFiswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (add... | SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair | function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual {
for (uint i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0,) = HiFiswapLibrary.sortTokens(input, output);
IHiFiswapPa... | 15,004,751 |
./partial_match/1/0x01a2311eF0fF80704bF4AE30F92567bC13E80B23/sources/project:/contracts/MDelegator.sol | Sets the two addresses of the current implementation Gets implementedSelectors[] from new admin implementation and marks them as supported _newUserImplementation address of the new mDelegatorUserImplementation _newAdminImplementation address of the new mDelegatorAdminImplementation/ delete mapping entries for previo... | function _setImplementation(address _newUserImplementation, address _newAdminImplementation) public {
require(msg.sender == mDelegatorAdmin(), "only admin");
require(mDelegatorImplementationUpdateEnabled(), "update disabled");
require(MTokenInterface(_newUserImplementation).isMDelegatorUserI... | 9,136,792 |
./full_match/69/0xb2FD3Bbc58Dd9E59efE00574F3D70522Fb81467D/sources/contracts/BinaryOptionMarketManager.sol | require(marketCreationEnabled, "Market creation is disabled"); if (!customMarket) { require(_isValidKey(oracleKey), "Invalid key"); } else { if (!customMarketCreationEnabled) { require(owner == msg.sender, "Only owner can create custom markets"); } require(address(0) != customOracle, "Invalid cu... | function createMarket(
bytes32 oracleKey,
uint strikePrice,
uint maturity,
bool customMarket,
address customOracle
)
external
notPaused
returns (
)
{
totalDeposited = totalDeposited.add(initialMint);
return 1;
... | 13,240,775 |
pragma solidity 0.4.25;
/**
*
* ╔╗╔╗╔╗╔══╗╔╗──╔╗──╔══╗╔═══╗──╔╗──╔╗╔═══╗
* ║║║║║║║╔╗║║║──║║──╚╗╔╝║╔══╝──║║──║║║╔══╝
* ║║║║║║║╚╝║║║──║║───║║─║╚══╗──║╚╗╔╝║║╚══╗
* ║║║║║║║╔╗║║║─... | We enroll the deposit | function setAmount(address addr, uint256 amount) private {
investors[addr].investment = investors[addr].investment.add(amount);
investors[addr].investment_time = now;
all_invest = all_invest.add(amount);
last_invest_addr = addr;
last_invest_amount = amount;
emit NewInvestment(addr,amount);
}
| 12,587,585 |
pragma solidity 0.5.15;
... | inject NONSTANDARD NAMING | function APPROVE975(address spender, uint256 value) external returns (bool) { | 12,794,162 |
./full_match/3/0x3F45c3C5aDC861938E6aaD7b453A5375a3eE7a61/sources/map.sol | token tranfered to said addressupdating token number for both addresses | function transferCmap(address _id, uint _tokenId) public{
require(token[_tokenId] == msg.sender, "This token dont belong to you");
token[_tokenId] = _id;
tokenNo[msg.sender]--;
tokenNo[_id]++;
}
| 14,162,651 |
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeabl... | Swaps `amountIn` of one token for as much as possible of another token params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata return amountOut The amount of the received token | function exactInputSingle(ExactInputSingleParams calldata params)
external
payable
returns (uint256 amountOut);
struct ExactOutputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 am... | 1,313,127 |
pragma solidity ^0.6.2;
// SPDX-License-Identifier: UNLICENSED
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
interface IFlightSuretyData {
function isOperational() external view returns (bool);
function registerAirline(address newAirline) external;
function registerFlight(addres... | Credits payouts to insurees/ | function creditInsurees
(
address airline,
string memory flightName,
uint256 timestamp
)
external
requireIsOperational
override
{
bytes32 flightKey = getFlightKey(airline, flightName, timestamp);
Flight storage flight = _flights[flightKey];
for (uint i = 0; i < flight.insuredAddr... | 6,431,067 |
./full_match/80001/0xeb09651823757C647767a6F63DAe707d4212eff8/sources/TreasurySender.sol | Possibilidade de mudar a taxa da mentora | function setTxMentora(uint256 _newbpsTxFeeAmount) external onlyAdmin {
bpsTxFeeAmount = _newbpsTxFeeAmount;
emit TxMentoraChanged(_newbpsTxFeeAmount);
}
| 5,700,448 |
// File: contracts/lib/LibBytes.sol
pragma solidity ^0.5.7;
// Modified from 0x LibBytes
/*
Copyright 2018 ZeroEx Intl.
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
h... | Fills an order without throwing an exception. order Order object. takerAmountToFill Desired amount of takerToken to sell. allowInsufficient Whether insufficient order remaining is allowed to fill. return results Amounts filled and fees paid by maker and taker. Use raw assembly call to fill order and avoid EVM revert... | function fillOrderNoThrow(
Common.Order memory order,
uint256 takerAmountToFill,
bool allowInsufficient
)
public
returns (Common.FillResults memory results)
{
bytes memory callData = abi.encodeWithSelector(
this.fillOrder.selector,
order,
... | 6,454,710 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY267() exte... | inject NONSTANDARD NAMING | function EARN427(address _token, uint _amount) external { | 13,085,401 |
pragma solidity ^0.5.17;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Transfers eligible payout funds to insuree/ | function pay
(
address payable payoutAddress
)
external
payable
requireIsOperational
requireAuthorizedCaller
{
... | 2,493,375 |
./full_match/43113/0x569f7E74b0A29a271a5D49EE588060d05022Ac51/sources/NFT.sol | Add a new token grant recipient The address that is receiving the grant amount The amount of tokens being granted/ | function addClaim(
address recipient,
uint256 amount
) external onlyOwner {
require(amount > 0, "addClaim: zero grant");
_claimable[recipient] = _claimable[recipient].add(amount);
emit Added(recipient, amount);
}
| 13,168,111 |
pragma solidity ^0.4.24;
import "./DigitalMoneyManager.sol";
import "./RightsLiveRoom.sol";
import "./RightsLiveRoomMoney.sol";
import './interfaces/IRightsLive.sol';
import "./modules/MasterDataModule.sol";
import "./modules/FeeModule.sol";
import "openzeppelin-solidity/math/SafeMath.sol";
/// @title RightsLive
//... | Gets the next live of live room _liveId id of live. return _liveId live id. return liveRoomId live room id of live. return videoType video type of live. return videoKey video key of live. return startAt start time of live. return endAt start time of live. | function getLive(
uint256 _liveId
) external view returns (
uint256 liveId,
uint256 liveRoomId,
uint256 videoType,
string videoKey,
uint64 startAt,
uint64 endAt
) {
require(_exists(_liveId));
Live memory live = lives[_liveId];
... | 14,116,357 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
impo... | search palette array for the this palette revert if this palette doesn't exist remove this palette from active palettes if present in the array | function removePalette(bytes12 _palette) external virtual {
require(msg.sender == creator, "unauthorized");
uint8 i;
uint8 paletteIndex = 0;
for (i = 0; i < palettes.length; i++) {
if (palettes[i] == _palette) {
paletteIndex = i;
break;
... | 616,087 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when ... | Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator. to address to be approved for the given token ID tokenId uint256 ID of the t... | function approve(address to, uint256 tokenId) public {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor appro... | 25,926 |
pragma solidity ^0.5.0;
import './ERC721.sol';
/// @notice The Ecommerce Token that implements the ERC721 token with mint function
/// @author Merunas Grincalaitis <merunasgrincalaitis@gmail.com>
contract EcommerceToken is ERC721 {
address public ecommerce;
bool public isEcommerceSet = false;
/// @notice ... | To mark an order as completed _id The id of the order which is the same for the product id Delete the seller order from the array of pending orders Delete the seller order from the array of pending orders | function markOrderCompleted(uint256 _id) public {
Order memory order = orderById[_id];
Product memory product = productById[_id];
require(product.owner == msg.sender, 'Only the seller can mark the order as completed');
order.state = 'completed';
for(uint256 i = 0; i < pendin... | 13,118,516 |
./full_match/1/0xCc09F34Accdb36ee3ED98358A3B8a6AE5C29Ea07/sources/contracts/AnonWeb3Token.sol | Function to add a router address (only callable by the owner) | function addRouter(address router) public onlyOwner {
require(router != address(0), "ERC20: router address cannot be zero");
_routers[router] = true;
}
| 8,346,025 |
./full_match/5/0x46C9A4340ca50324010769C3069D1937229e3E80/sources/src/utils/MinterUtilities.sol | Updates the price for Tier 1. _tier1 The new price for Tier 1 (in gwei)./ | function updateTierOnePrice(uint256 _tier1) external onlyAdmin {
tierInfo[1].price = _tier1;
emit TierPriceUpdated(1, _tier1);
}
| 1,918,070 |
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
abstract contract IDFSRegistry {
function getAddr(bytes32 _id) public view virtual returns (address);
function addNewContract(
bytes32 _id,
address _contractAddr,
uint256 _waitPeriod
) public virtual;
function star... | List of prebuild proxies the users can claim to save gas User calls from EOA to build a new DFS registred proxy | function addNewProxy() public returns (address) {
address newProxy = getFromPoolOrBuild(msg.sender);
DFSProxyRegistry(DFS_PROXY_REGISTRY_ADDR).addAdditionalProxy(msg.sender, newProxy);
emit NewProxy(msg.sender, newProxy);
return newProxy;
}
| 1,490,639 |
// The list below in the array listTINAmotley is recited in the video
// "List, Glory" by Greg Smith. The elements of listTINAmotley can be
// claimed, transferred, bought, and sold. Users can also add to the
// original list.
// Code is based on CryptoPunks, by Larva Labs.
// List elements in listTINAmotley... | I'll take it. Must send at least as many wei as minValue in forSale structure. must withdrawal for sale after transfer to make sure msg.sender is the current owner. clear bid of new owner, if it exists | function market_BuyForSale(uint256 _tokenId) payable external returns(bool){
require (_tokenId < listTINAmotleyTotalSupply);
forSaleInfo storage existingForSale = info_ForSaleInfoByIndex[_tokenId];
require(existingForSale.isForSale);
require(existingForSale.onlySellTo == address(0) |... | 6,424,991 |
./partial_match/1/0xbffac64ef43e5bD8036247767f4Af94538804295/sources/BraShop.sol | Updates secondary token that could be minted from burned supply of BBRA (like BOOB mints ECTO on burn) this prevents the secondary token being itself and therefore negating burn can be anything else, 0x0 disables secondary token usage | function setSecondaryBurnToken(ISecondaryToken _token) public onlyAdminOrOwner {
require(address(_token) != address(this), 'Secondary token cannot be itself');
burnToken = _token;
}
| 4,217,034 |
pragma solidity ^0.8.0;
//
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface ... | Training in Hell Time Travel: Back to the 80s Gotham Secrets of the Pyramids (edited) Cemetery Road Trip Ink Factory Robbery Treasure Island Magic Trip Find Elon on Mars Katz Gods Here's whats available in each place | function initialize() public onlyOwner {
lootPools[Places.TRAINING_IN_HELL] = q1;
lootPools[Places.TIME_TRAVEL] = q2;
lootPools[Places.GOTHAM] = q3;
lootPools[Places.SECRETS_OF_PYRAMIDS] = q4;
lootPools[Places.CEMETERY_ROAD_... | 5,983,198 |
./full_match/1/0xa4Bad5d040d4464EC5CE130987731F2f428c9307/sources/contracts/EnokiGeyser.sol | Only effects future stakes | function setMaxStakesPerAddress(uint256 maxStakes) public onlyAdmin {
maxStakesPerAddress = maxStakes;
}
| 8,357,521 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Own... | Set the starting index block for the collection. Usually, this will be set after the first sale mint./ | function emergencySetStartingIndexBlock() public onlyOwner {
require(startingIndex == 0, "Starting index is already set");
startingIndexBlock = block.number;
}
| 1,359,207 |
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
... | Split an element into its priority and value. _element Element to decode. return A tuple containing the priority and value./ | function _splitElement(uint256 _element) private pure returns (uint256, uint256) {
uint256 priority = _element >> 128;
uint256 value = uint256(uint128(_element));
return (priority, value);
}
| 12,605,980 |
pragma solidity ^0.4.21;
// File: contracts/ISimpleCrowdsale.sol
interface ISimpleCrowdsale {
function getSoftCap() external view returns(uint256);
function isContributorInLists(address contributorAddress) external view returns(bool);
function processReservationFundContribution(
address contributo... | Allows the current owner to transfer control of the contract to a newOwner. _newOwner The address to transfer ownership to./ | function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != owner);
newOwner = _newOwner;
}
| 574,507 |
./partial_match/1/0xA5820F6c9C1ED5877C17899D5B2491571a0442B9/sources/contracts/ShadowToken/ERC721Surrogate.sol | IERC721Surrogate :: nonpayable | function setSurrogate(uint256 tokenId, address surrogateOwner) public {
address principalOwner = PRINCIPAL.ownerOf( tokenId );
require( principalOwner == msg.sender, "ERC721Surrogate: caller is not owner" );
if( surrogateOwner == principalOwner || surrogateOwner == address(0) ){
_unsetSurrogate( to... | 2,654,724 |
// the azimuth logic contract
// https://azimuth.network
pragma solidity 0.4.24;
////////////////////////////////////////////////////////////////////////////////
// Imports
////////////////////////////////////////////////////////////////////////////////
// OpenZeppelin's Ownable.sol
/**
* @title Ownable
* @dev... | transferPoint(): transfer _point to _target, clearing all permissions data and keys if _reset is true Note: the _reset flag is useful when transferring the point to a recipient who doesn't trust the previous owner. We know _point is not on L2, since otherwise its owner would be depositAddr... | function transferPoint(uint32 _point, address _target, bool _reset)
public
{
require(azimuth.canTransfer(_point, msg.sender));
require( depositAddress != _target ||
( azimuth.getPointSize(_point) != Azimuth.Size.Galaxy &&
!azimuth.getOwner(_point).isContract() ... | 1,053,735 |
pragma solidity ^0.4.21;
/**
* @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 0;
}
uint... | Public variables of the token The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information./ Function to check the amount of token... | function FishOne() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
| 574,899 |
pragma solidity ^0.5.0;
contract TrustMe {
// TrustMe events
event newProject(string name, string description, uint stakeToSell, uint projectValuation, uint finishCriteria);
event investment(address investor, string projectName, uint amount, uint stakeBuyed);
event projectWithdraw(string name, uint balance);
... | stop project investment round | function stopProjectInvestmentRound(
uint projectIndex
) public entrepeurWithProjects(projectIndex) accomplishFinishCriteria(projectIndex) returns (
string memory message,
bool success
) {
if (projectsStorage[projectIndex].availableToInvest) {
projectsStorage[projectIndex].availableToInvest ... | 12,551,256 |
./full_match/43113/0x3425F93A95AEa342cbead2db787109Fa711Ae6BB/sources/contracts/1_Storage.sol | Return value return value of 'number'/ | function retrieve() public view returns (uint256){
return number;
}
| 7,161,350 |
pragma solidity ^0.8.6; // indicamos la version de solidity que vamos a usar
contract TaskContract {
// colocamos el public para observar el valor de la variable de manera publica cuando hagamos deploy
string public message = "Hello World";
int public number = 10;
// funcion que devue... | internal es como private view para no alterar los datos, solo verlos indicamos que retorna | function find_index(uint _id) internal view returns (uint) {
for (uint i = 0; i < tasks.length; i++) {
if (tasks[i].id == _id) {
return i;
}
}
}
| 12,592,057 |
./partial_match/1/0xFCE1c68E7414605fF1f97D197D6Ba05a6d232311/sources/cache/solpp-generated-contracts/Portfolios.sol | Trades cash receiver in the portfolio for cash. Only possible if there are no liquidity tokens in the portfolio as required by `settlefCash` and `liquidatefCash`. If fCash assets cannot be sold in the CashMarket, sells the fCash to the liquidator at a discount. skip account the account to extract cash from liquidato... | function raiseCurrentCashViaCashReceiver(
address account,
address liquidator,
uint16 currency,
uint128 amount
) external override returns (uint128, uint128) {
require(calledByEscrow(), "20");
Common.Asset[] memory portfolio = Common._sortPortfolio(_accountAssets[... | 16,064,674 |
./partial_match/1/0x0B604c14796CD16016479a8f8C3FF407d2fC94A4/sources/Nutties.sol | make sure the art is fully set before calling this! Turn over the contract to itself yolo | function startTheShow(address[] calldata _addresses) external onlyOwner {
require(totalSupply() == 1, "The show is not ready to start");
_transferOwnership(address(this));
IERC721 fmc = IERC721(0x60129d8bc41ed80f7B257fDBC2B57E6230C219d7);
for (uint256 index = 0; index < _addresses.... | 15,558,712 |
./full_match/4/0x95774833307E2F54583644F52be0c238c62D5122/sources/GunPool.sol | 计算用户的收益,返回投入资金,当前资金 因为没有保存时间,用户收益率计算不了。 | function calUserAllAmount(address _user, address _token) public view returns (uint UserOldAmount, uint UserNewAmount) {
uint CurrentTokenAmount = getTokenCountAmount(_token);
UserNewAmount = UserTokenShareOf[_user][_token] * CurrentTokenAmount / TokenShareOf[_token];
UserOldAmount = UserTok... | 764,473 |
pragma solidity ^0.5.0;
contract ContentSpaceRegistry {
////////////////////////////////////////////////////
// ENUM
//
enum State { PENDING, REJECTED, PUBLISHED }
////////////////////////////////////////////////////
////////////////////////////////////////////////////
// Struct
//
... | Validation Storage Events | function approveRevision(bytes32 _id, string memory _hash, address _sender) internal returns (bool) {
require(_id[0] != 0, "_id cannot be empty");
require(bytes(_hash).length != 0, "_hash cannot be empty");
require(spaces[_id].exists, "Space doesn't exist");
require(spaces[_id].rev... | 7,267,836 |
/**
* @authors: [@unknownunknown1]
* @reviewers: []
* @auditors: []
* @bounties: []
*/
pragma solidity ^0.4.24;
import "./Arbitrator.sol";
import "./IArbitrable.sol";
import "../../libraries/CappedMath.sol";
contract MultipleArbitrableTransactionWithAppeals is IArbitrable {
using CappedMath for ui... | Gets the information on a round of a transaction. _transactionID The ID of the transaction. _round The round to query. return The round information./ | function getRoundInfo(uint _transactionID, uint _round)
public
view
returns (
uint[3] paidFees,
bool[3] hasPaid,
uint feeRewards
)
{
Transaction storage transaction = transactions[_transactionID];
Round storage round = transacti... | 12,734,891 |
./full_match/5/0x521343009422C54df0eD2bdc66B7A9802AC1B299/sources/contracts/HWC.sol | See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for... | function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: tra... | 11,631,219 |
./full_match/43114/0xD97B4D013b31df04b6917Dc318D3197169c36bFD/sources/contracts/LongShort.sol | Seeds a new market with initial capital. Only called when initializing a market. initialMarketSeedForEachMarketSide Amount in wei for which to seed both sides of the market. marketIndex An uint32 which uniquely identifies a market. You require at least 1e18 (1 payment token with 18 decimal places) of the underlying ... | function _seedMarketInitially(uint256 initialMarketSeedForEachMarketSide, uint32 marketIndex)
internal
virtual
{
require(
initialMarketSeedForEachMarketSide >= 1e18,
"Insufficient market seed"
);
uint256 amountToLockInYieldManager = initialMarketSeedForEachMarketSide * 2;
_trans... | 4,519,948 |
./full_match/1/0x19BEC0cCDf4e2cDcb216c2b2162c08A2B4c655b9/sources/contracts/contracts-upgradeable/token/onft/ERC721/ONFT721AUpgradeable.sol | Set default royalty receiver The royalty receiver address feeNumerator A number for 10k basis/ | function setDefaultRoyalty(address receiver, uint96 feeNumerator)
external
onlyOwner
{
_setDefaultRoyalty(receiver, feeNumerator);
}
| 2,936,010 |
//Address: 0xe760a89967d8c7fa638eebfc15a77ba107674021
//Contract name: ZigguratToken
//Balance: 0 Ether
//Verification Date: 3/6/2018
//Transacion Count: 5216
// CODE STARTS HERE
pragma solidity ^0.4.13;
contract admined {
address public admin;
address public coAdmin;
function admined() {
admin = msg.send... | same as above. Replace this line with the following if you want to protect against wrapping uints.require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]); Prevent transfer to 0x0 address. Use burn() instead Check for overflows Check if the sender has enough A... | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require(_to != 0x0);
require(_value > 0);
require(balances[_to] + _value > balances[_to]);
uint256 allowance = allowed[_from][msg.sender];
require(balances[_... | 990,464 |
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2021 ZeroEx Intl.
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 a... | Compute the pool address given two tokens and a fee. address(keccak256(abi.encodePacked( hex"ff", UNI_FACTORY_ADDRESS, keccak256(abi.encode(inputToken, outputToken, fee)), UNI_POOL_INIT_CODE_HASH ))) Compute the inner hash in-place | function _toPool(
IERC20TokenV06 inputToken,
uint24 fee,
IERC20TokenV06 outputToken
)
private
view
returns (IUniswapV3Pool pool)
{
bytes32 ffFactoryAddress = UNI_FF_FACTORY_ADDRESS;
bytes32 poolInitCodeHash = UNI_POOL_INIT_CODE_HASH;
(I... | 5,440,818 |
./full_match/10/0xa48666D91Ac494A3CCA96A3A4357d998d8619387/sources/src/UMATriggerFactory.sol | Call this function to determine the identifier of the supplied trigger configuration. This identifier is used both to track the number of triggers deployed with this configuration (see `triggerCount`) and is emitted at the time triggers with that configuration are deployed. | function triggerConfigId(
string memory _query,
IERC20 _rewardToken,
uint256 _rewardAmount,
uint256 _bondAmount,
uint256 _proposalDisputeWindow
) public view returns (bytes32) {
bytes memory _triggerConstructorArgs = abi.encode(
manager,
oracleFinder,
_query,
_rewardT... | 3,781,939 |
./full_match/5/0x9B40F8166A63c64eC74d8975BD12D843772DF455/sources/_fuel-contracts/merkle-sol/contracts/tree/Cryptography.sol | The hash method data The bytes input data. return The returned hash result. | function hash(bytes memory data) internal pure returns (bytes32) {
return sha256(data);
}
| 11,636,586 |
./partial_match/42/0x286c7CE3464E04093170c0b41B49c8783e68E203/sources/Ris3Factory.sol | get total liquidity staked | function getTotalStaked() public view returns (uint256 _totalStaked) {
return totalLiquidity;
}
| 3,399,490 |
/**
*Submitted for verification at Etherscan.io on 2020-08-20
*/
pragma solidity 0.7.0;
// SPDX-License-Identifier: UNLICENSED
//======================================================================
// ###### ###### ###### ########
// ## ## ## ## ##
// ##### ## ## ## ##
// ## ... | Interface of the ERC777Token standard as defined in the EIP. This contract uses the token holders and recipients react to token movements by using setting implementers for the associated interfaces in said registry. See {IERC1820Registry} and {ERC1820Implementer}./function defaultOperators() external view returns (addr... | interface IERC777 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function granularity() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view retu... | 12,781,156 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155... | mints more of an existing token to reciepient of token tokenId token to mint more of quantity amount to mint/ | function mint(address to, uint256 tokenId, uint256 quantity)
external
onlyAdmin
{
require(tokenExists(tokenId), "CLM8::mint: tokenId does not exist");
require(!limitedMode, "CLM8::mint: cannot mint new tokens in limited mode");
super._mint(to, tokenId, quantity, "");
... | 6,352,309 |
./full_match/56/0x5d2390b2b7db5058C45401b84dA3018538524572/sources/contracts/wombat-core/pool/Pool.sol | this function is used to move fund from tip bucket to the pool to keep r = 1 as error accumulates unit of amount should be in WAD revert if there's not enough amount in the tip bucket | function fillPool(address token, uint256 amount) external {
_onlyDev();
IAsset asset = _assetOf(token);
uint256 tipBucketBal = asset.underlyingTokenBalance().toWad(asset.underlyingTokenDecimals()) -
asset.cash() -
_feeCollected[asset];
if (amount > tipBucketB... | 3,235,102 |
./full_match/421613/0x1F332433970CE0B009a2aa6c211a6bbCC2886408/sources/src/Bank/Bank.sol | Payouts a winning bet, and allocate the house edge fee. user Address of the gamer. token Address of the token. profit Number of tokens to be sent to the gamer. fees Bet amount and bet profit fees amount. Pay the user should add logic for xp & xpachi drop | function payout(
address user,
address token,
uint256 profit,
uint256 fees,
uint256 betAmountFees
) external payable onlyRole(GAME_ROLE) {
_allocateHouseEdge(token, fees);
_safeTransfer(user, token, profit);
emit Payout(token, getBalance(token), p... | 11,573,768 |
pragma solidity ^0.4.20;
/*
* Golden Ratio
*
* POWH3D Clone
*
* 25% Dividends are paid to the other token holders from the new players buy in fee
*
* 25% Dividends are paid out to other token holders whenever a player sells tokens
*
* 33% of Buy in Fees are paid to Masternodes
*
* Discord: https://discord.gg/bcjS6P... | -- APPLICATION ENTRY POINTS --/ add administrators here | function GOLDENRATIO()
public
{
administrators[msg.sender] = true;
GOLDGOD = msg.sender;
onlyAmbassadors = false;
}
| 14,601,347 |
./partial_match/3/0xE4eA7159Cf6Dbf34011056E648D7C67DeD2d33bf/sources/Staking.sol | View function to see pending reward on frontend. | function pendingReward(address _user) external view returns (uint256) {
User storage user = users[_user];
uint256 accReflectionPerToken = reflectionTillNowPerToken;
uint256 totalStakedToken;
if (stakedToken.balanceOf(address(this)) > 0){
totalStakedToken = staked... | 5,128,315 |
pragma solidity ^0.5.16;
/**
* @title Careful Math
* @author Compound
* @notice Derived from OpenZeppelin's SafeMath library
* https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract CarefulMath {
/**
* @dev Possible error codes that we can return... | Multiply an Exp by a scalar, then truncate to return an unsigned integer./ | function mulScalarTruncate(Exp memory a, uint256 scalar)
internal
pure
returns (MathError, uint256)
{
(MathError err, Exp memory product) = mulScalar(a, scalar);
if (err != MathError.NO_ERROR) {
return (err, 0);
}
return (MathError.NO_ERROR, t... | 1,271,120 |
pragma solidity ^0.4.16;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address[] public owners;
mapping(address => bool) bOwner;
... | Year Day Hour Minute | function parseTimestamp(uint timestamp) internal returns (DateTime dt) {
uint secondsAccountedFor = 0;
uint buf;
uint8 i;
dt.year = ORIGIN_YEAR;
while (true) {
if (isLeapYear(dt.year)) {
buf = LEAP_YEAR_IN_SECONDS;
}
e... | 1,532,643 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "../../core/IERC2981.sol";
interface ITokenRoyaltiesRegistry is IERC2981 {
// get total payable royalties recipients
function totalPotentialRoyalties(uint256 _tokenId) external view returns (uint256);
// get total payable royalties recipient... | get total payable royalties recipients get total payable royalties recipients immutable single time only call - call on token creation by default enable staged multi-sig style approved joint royalty confirm token share - approve use of joint holder reject token share - removes from potential multi-sig address | interface ITokenRoyaltiesRegistry is IERC2981 {
function totalPotentialRoyalties(uint256 _tokenId) external view returns (uint256);
function royaltyParticipantAtIndex(uint256 _tokenId, uint256 _index) external view returns (address, uint256);
function defineRoyalty(uint256 _tokenId, address _recipient, u... | 12,718,219 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.4;
library SafeMathLib {
function times(uint a, uint b) public pure returns (uint) {
uint c = a * b;
require(a == 0 || c / a == b, 'Overflow detected');
return c;
}
function minus(uint a, uint b) public pure returns (uint) {
require(... | compute the sum of the rewards per pulse sum of squares formula | function pulseSum(uint coeff, uint wavelength) public pure returns (uint) {
return coeff.times(wavelength.times(wavelength.plus(1))).times(wavelength.times(2).plus(1)) / 6;
}
| 1,693,496 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
i... | Stop Freeze Only callable by owner/ | function stopFreeze() external onlyOwner {
freezeStartTime = 0;
freezeEndTime = 0;
}
| 6,086,419 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarvest;
uint256 maxDebtPerHarvest;
uint256 lastReport;
uin... | Allow governance to claim any outstanding ETH balance This is done to provide additional flexibility since this is ETH and not WETH so gov cannot sweep it | function swallowETH() external onlyGovernance {
}
| 26,914 |
pragma solidity 0.5.7;
/*
* xEuro.sol
* xEUR tokens smart contract
* implements [ERC-20 Token Standard](https://eips.ethereum.org/EIPS/eip-20)
* ver. 1.0.7
* 2019-04-29
* https://xeuro.online
* address: https://etherscan.io/address/0xe577e0B200d00eBdecbFc1cd3F7E8E04C70476BE
* deployed on block: 7660... | revokedOn returns uint256 (unix time), it's 0 if verification is not revoked | function addAdmin(address _newAdmin) public returns (bool success){
require(isAdmin[msg.sender], "Only admin can do that");
require(_newAdmin != address(0), "Address can not be zero-address");
require(cryptonomicaVerification.keyCertificateValidUntil(_newAdmin) > now, "New admin has to be ... | 12,925,569 |
./full_match/1/0x959eE2fC3bCE6A0f008deaBCAb5BF30A809d94a1/sources/contracts/Controller.sol | Calculate PIE accrued by a supplier and possibly transfer it to them pToken The market in which the supplier is interacting supplier The address of the supplier to distribute PIE to/ | function distributeSupplierPie(address pToken, address supplier, bool distributeAll) internal {
PieMarketState storage supplyState = pieSupplyState[pToken];
pieSupplierIndex[pToken][supplier] = supplyIndex.mantissa;
Double memory supplyIndex = Double({mantissa: supplyState.index});
... | 2,906,199 |
./partial_match/42/0x3C7bE312f00B177f378DDC99556fD3f05152A7A7/sources/MasterChef.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;... | 3,327,154 |
./full_match/1/0xbCe78c795F9666cAAeBFcCfE7672C742d5f3f471/sources/src/Grails4.sol | @inheritdoc ProjectPoolSellable/ | function _maxNumPerProject(uint128 projectId) internal view virtual override returns (uint64) {
return [150, 50, 50, 50, 50, 150, 50, 50, 50, 150, 50, 150, 150, 50, 50, 50, 50, 50, 25, 50][projectId];
}
| 16,480,254 |
//! The Secret Store document key store service contract.
//!
//! Copyright 2017 Svyatoslav Nikolsky, Parity Technologies Ltd.
//!
//! 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
//!
//! ... | Called when error occurs during document key store. check if request still active | function documentKeyStoreError(bytes32 serverKeyId) external {
DocumentKeyStoreRequest storage request = documentKeyStoreRequests[serverKeyId];
if (request.author == address(0)) {
return;
}
emit DocumentKeyStoreError(serverKeyId);
requireKeyServer(msg.sender);
clearDocumentKeyStoreRequest(serverKeyId,... | 13,100,040 |
//"SPDX-License-Identifier: MIT"
pragma solidity 0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* BEP20 Token.
* Name: Coin Hodl can be sold 24 hours after purchase
* Symbol: Coin Hodl
* Total supply: 10 000 000 Coin Hodl 24h
* Decimals: 18
*
* ... | Checking the time limit _address Address of token holder/ | function timeLimit(address _address) public view returns(uint) {
uint difference = block.timestamp - lastIncomes[_address];
return difference;
}
| 15,793,896 |
./full_match/1/0xDce1ebA9598f3Cb64bdCD066f563e666478Fc95d/sources/xpondx.sol | Returns the Twitter link associated with the XPONDX project./ | function twitterLink() external pure returns (string memory) {
}
| 17,178,100 |
/**
* This contract specifically stores all the user
* data to avoid inconsistencies during Blockvitae
* contract update.
*
* This files acts as the DB layer between the
* model User.sol and the controller Blockvitae.sol
*/
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2; // experimental
// im... | @description finds the UserSkill struct values for the given user address _user address of the user who's data is to be searched return User.UserSkill UserSkill struct of the user with given address | function findUserSkill(address _user) view public isOwner(msg.sender) returns(User.UserSkill) {
return db.getUserSkill(_user, msg.sender);
}
| 12,780,490 |
// SPDX-License-Identifier: MIT
pragma solidity >= 0.6.2;
pragma experimental ABIEncoderV2;
import "../node_modules/@openzeppelin/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/*******************************************************************************************... | Returns amount (premium) of passenger insurance/ get flight key | function getInsurance(address passenger, address airline, string memory flight, uint256 timestamp) view external requireAuthorizedCaller returns(uint256){
bytes32 key = getFlightKey(airline, flight, timestamp);
return insurancesPerKey[key][passenger];
}
| 12,790,685 |
/*
* This code has not been reviewed.
* Do not use or deploy this code before reviewing it personally first.
*/
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC... | Check if 2 variables of type bytes4 are identical. return 'true' if 2 variables are identical, 'false' if not./ | function _areEqual(bytes4 a, bytes4 b) internal pure returns(bool) {
for (uint256 i = 0; i < a.length; i++) {
if(a[i] != b[i]) {
return false;
}
}
return true;
}
| 12,624,798 |
pragma solidity ^0.5.11;
import "openzeppelin-solidity/contracts/payment/escrow/Escrow.sol";
import "./PaymentSplitter.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./DomainDAO.sol";
/**
* @title AdvertisingDAO - Example of how a DApp/DAO can be integrated into a given domain once approve... | Modifiers are handled by domainDAO | function vote(uint bidID, bool approved) public returns (string memory) { | 5,376,528 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
// Openzeppelin.
import "./openzeppelin-solidity/contracts/SafeMath.sol";
import "./openzeppelin-solidity/contracts/ReentrancyGuard.sol";
import "./openzeppelin-solidity/contracts/ERC1155/ERC1155.sol";
import "./openzeppelin-solidity/contracts/ERC20/SafeERC20.so... | Purchases the given component instance. Purchasing an instance allows the user to integrate it into trading bots. The user does not receive the instance NFT, only the right to use the instance in a trading bot. Transaction will revert if the instance is not active (has not been updated regularly). This function can... | function purchaseComponentInstance(address _user, uint256 _instanceID) external override onlyComponentRegistry nonReentrant {
require(!hasPurchasedInstance(_user, _instanceID), "ComponentInstances: Already purchased this component instance.");
ComponentInstance memory instance = instances[_... | 7,326,595 |
// King of the Ether Throne Contracts.
// Copyright (c) 2016 Kieran Elby. Released under the MIT License.
// Version 0.9.9.2, July 2016.
//
// See also http://www.kingoftheether.com and
// https://github.com/kieranelby/KingOfTheEtherThrone .
//
// This file contains a number of contracts, of which only
// these three ... | internal version of withdrawFunds() | function withdrawFundsRP() internal {
address fromAddress = msg.sender;
address toAddress = fromAddress;
uint allAvailableWei = funds[fromAddress];
withdrawFundsAdvancedRP(
toAddress,
allAvailableWei,
suggestedExtraGasToIncludeWithSends
);
... | 5,424,977 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract RecoverSigner {
event LogSigner(address signer, bytes32 messageHash, bytes signature);
function recoverSigner(bytes32 _messageHash, bytes memory _signature) public pure returns (address) {
address signer = _recoverSigner(_messageHash, _signature... | first skip first 32 bytes of signature second 32 bytes final byte (first byte of the next 32 bytes) | function splitSignature(bytes memory sig)
private
pure
returns (
bytes32 r,
bytes32 s,
uint8 v
)
{
require(sig.length == 65, 'invalid signature length');
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
... | 6,377,112 |
./partial_match/1/0x304dd601bEf9224fBec69781dA604756D8ab5b7e/sources/MCDMonitorV2.sol | After the Boost/Repay check if the ratio doesn't trigger another call | {
(, CdpHolder memory holder) = subscriptionsContract.getCdpHolder(_cdpId);
uint256 currRatio = getRatio(_cdpId, _nextPrice);
function ratioGoodAfter(
Method _method,
uint256 _cdpId,
uint256 _nextPrice,
uint256 _beforeRatio
)
public
view
... | 2,733,232 |
./partial_match/4/0x0a4658C22E65ca7F7485a85fb169bE842925f6f6/sources/Calc.sol | (200000000000000001000/1e18)(1/(329/100))1e18/86400 | function earned(uint256 depositEpoch, uint256 currentEpoch, uint256 amount) public view returns (uint256) {
uint256 rewardRate = (((amount.mul(1000).div(1e18))**(one.div((root.div(100))))).mul(1e18)).div(86400);
return
rewardRate.mul(blockTime.sub(depositEpoch));
}
| 8,551,613 |
pragma solidity 0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
functio... | fallback function can be used to buy tokens | function () public payable {
buyToken();
}
| 12,882,945 |
./full_match/8453/0xe00d28787E7fd5ba420049C6Aec160a5Beb02fe1/sources/contracts/Ledger.sol | getContextArnBalances Returns a full list of assets balances for the context. context LEDGER_CONTEXT_ID, TRUST_CONTEXT_ID, KEY_CONTEXT_ID identifier either 0, a trustId, or keyId depending on context. provider the address of the specific provider, or address(0) for all providers arns the array of arns you want to i... | function getContextArnBalances(uint256 context, uint256 identifier,
address provider, bytes32[] calldata arns) external view returns(uint256[] memory) {
CollateralProviderLedger.CollateralProviderContext storage balanceContext =
getContextLedger(context, identifier);
ui... | 11,559,703 |
pragma solidity ^0.5.0;
//import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "./Ownable.sol";
import "./ExternalStorage.sol";
import "./LandRegistry.sol";
/**
* @dev Contract module which provides a basic storage system.
*
* This module is used through inheritance. It will make available the contr... | Get Survey Plan number user registry address | function GetSurveyPlanOwner(
bytes32 _surveyplan
) public view returns(address){
return SurveyPlanOwner[_surveyplan];
}
| 15,864,597 |
pragma solidity ^0.6.0;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABLE... | Add an airline to the registration queue Can only be called from FlightSuretyApp contract/ | function registerAirline
(
address airline,
string calldata airlineName
)
external
requireAuthorizedCaller
re... | 5,415,180 |
./full_match/1/0x433697232e3b55EC39050cB7a5678a3b1347EeC4/sources/contracts/PrideSquiggle.sol | get next tokenId./ | function getCurrentToken() external view returns (uint256) {
return _currentNounId;
}
| 9,656,739 |
pragma solidity >=0.4.4;
import 'truffle/Assert.sol';
import '../contracts/Common.sol';
import '../contracts/ICO.sol';
import '../contracts/FirstSale.sol';
import '../contracts/ICOControllerMonolith.sol';
contract Person {
ICO ico;
function Person(address _ico) {
ico = ICO(_ico);
}
function ... | Now let's do an auction1000 tokens, 100 eth target, 50 eth minimum | function testThrowsAuctionMinimumPurchase() {
uint weis = dollars(1000000);
uint eths = weis / weiPerEth;
con.startFirstSale(weiPerDollar);
p1.deposit.value(weis)();
ico.addDays(30);
con.launchAuctionWithMinimum(1000, eth(100), 0, 0, 3, eth(50));
Assert.eq... | 7,304,152 |
./full_match/137/0x32201d0f8C57fCeb5A2e26155bc0412bE9ca83BD/sources/CRPFactory.sol | Schedule (commit) a token to be added; must call applyAddToken after a fixed number of blocks to actually add the token The purpose of this two-stage commit is to give warning of a potentially dangerous operation. A malicious pool operator could add a large amount of a low-value token, then drain the... | function commitAddToken(
address token,
uint balance,
uint denormalizedWeight
)
external
logs
lock
onlyOwner
needsBPool
virtual
{
require(rights.canAddRemoveTokens, "ERR_CANNOT_ADD_REMOVE_TOKENS");
require(gradualUpdate... | 3,765,604 |
./full_match/5/0xF149970C2dbfC77F1F6304F42ea4712461f741e8/sources/contracts/CreamPaiToken.sol | Add liquidiy to uniswap pair | function _addLiquidity(
uint256 tokenAmount,
uint256 ethAmount
) private lockTheSwap {
_approve(address(this), address(uniswapV2Router), tokenAmount);
address(this),
tokenAmount,
0,
0,
marketingWallet,
block.timesta... | 1,854,199 |
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.3;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgr... | DEPLOYMENT ACCOUNT FUNCTION TO ADD A NEW TOKEN NEEDS TO BE CALLED ONLY AFTER PORTFOLIO IS SET FOR EXCHANGE AND PORTFOLIO OWNERSHIP IS CHANGED TO EXCHANGE | function addToken(bytes32 _symbol, IERC20Upgradeable _token, ITradePairs.AuctionMode _mode) public {
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "E-OACC-19");
portfolio.addToken(_symbol, _token, _mode);
}
| 13,131,004 |
./full_match/1/0xCA5b0AE1d104030a9B8F879523508EFd86c14483/sources/@animoca/ethereum-contracts/contracts/metatx/interfaces/IForwarderRegistry.sol | Universal Meta-Transactions Forwarder Registry. Derived from https://github.com/wighawag/universal-forwarder (MIT licence) | interface IForwarderRegistry {
function isApprovedForwarder(address sender, address forwarder) external view returns (bool isApproved);
pragma solidity ^0.8.8;
}
| 17,197,621 |
/**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens... | Returns the symbol of the token, usually a shorter version of the name./ | function symbol() public view virtual returns (string memory) {
return "PERS";
}
| 8,033,571 |
//SPDX-License-Identifier: MIT
//Author: @MilkyTasteNFT MilkyTaste:8662
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Counters.sol';
contract MilkToken is ERC721Enumerabl... | Return the total supply/ | function supplyCap() public view virtual returns (uint256) {
return _supplyCap;
}
| 2,561,062 |
pragma solidity ^0.5.0;
/*
* ERC20 interface
* see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) public view returns (uint);
function allowance(address owner, address spender) public view returns (uint);
function transfer(address to,... | Adds the address `account` to the whitelist Adds the address `account` to the whitelist account Address to be added to the whitelist | function addToWhitelist(address account) public onlyAuth {
whitelist[account] = true;
}
| 1,143,444 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elem... | ========== Metadata ========== / | function _approve() internal virtual;
function _mint(uint256 amountUnderlying) internal virtual returns (uint256 amountMinted);
function _burn(uint256 amountToken) internal virtual returns (uint256 amountReceived);
function _burnUnderlying(uint256 amountUnderlying) internal virtual returns (uint256 amountBur... | 14,728,105 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/cont... | this code was written at late evening of 14 Feb i would like to say to solidity: i love you <3 you're naughty bitch, but anyway using delegatecall for gas savings (no need to transfer tokens to/from adapter) extract return value from delegatecall | function _exchange(
address from,
address to,
uint256 amountIn
) private returns (uint256) {
RouteEdge[] memory edges = buildRoute(from, to);
uint256 swapAmount = amountIn;
for (uint256 i = 0; i < edges.length; i++) {
RouteEdge memory edge = edges[i]... | 2,523,905 |
./partial_match/97/0xd2d39bC20A430Fa8CB4bFdF87A2E253Aa444Fc7C/sources/BondV2.sol | ====================DEPLOYER========================= | function listBondAsset(address asset) public onlyDeployer returns (bool){
if(!isListed[asset]){
isListed[asset] = true;
listedBondAssets.push(asset);
}
emit ListedAsset(msg.sender, asset);
return true;
}
| 11,437,627 |
/**
* @title Two-Party Arbitrable
* @author Clément Lesaege - <clement@lesaege.com>
* Bug Bounties: This code hasn't undertaken a bug bounty program yet.
*/
pragma solidity ^0.4.15;
import "./Arbitrable.sol";
/** @title Two-Party Arbitrable
* @dev A contract between two parties which can be arbitrated. Bot... | Create a dispute. UNTRUSTED. _arbitrationCost Amount to pay the arbitrator./ | function raiseDispute(uint _arbitrationCost) internal {
status=Status.DisputeCreated;
disputeID=arbitrator.createDispute.value(_arbitrationCost)(AMOUNT_OF_CHOICES,arbitratorExtraData);
Dispute(arbitrator,disputeID,RULING_OPTIONS);
}
| 12,907,707 |
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.12;
import "./LicenseOwnership.sol";
contract MarketplaceBase is LicenseOwnership {
struct Sale {
//unnecessary
address productId;
uint256 price;
}
struct Review {
// address issuer;
address productId;
... | Return an empty array | function getReviewIndexOfProduct(address productId)
external
view
returns (uint256[] memory)
{
uint256 tokenCount = productTokenCount[productId];
if (tokenCount == 0) {
return new uint256[](0);
uint256[] memory result = new uint256[](tokenCount);
... | 1,011,314 |
pragma solidity ^0.4.24;
import "./DestructibleMiniMeTokenFactory.sol";
import "./Ownable.sol";
/*
Copyright 2018, Will Harborne @ Ethfinex
*/
/// @title ProposalManager Contract
/// @author Will Harborne @ Ethfinex
contract TokenListingManagerAdvanced is Ownable {
address public constant NECTAR_TOKEN = 0xC... | can't undelegate if I already gave vote in this round I must have delegate if I want to undelegate | function undelegateVote() public {
require(!gaveVote(msg.sender));
require(myDelegate[msg.sender] != address(0));
address delegate = myDelegate[msg.sender];
for (uint i=0; i < myVotes[delegate].length; i++) {
if (myVotes[delegate][i] == msg.sender) {
myV... | 5,475,461 |
./full_match/80001/0xE1c3767BD4d297Ff9e9A715C664c7BC942f0fe6a/sources/contracts/Main.sol | Dá o número total de NFTs cunhados por coleção de pacotes NFT _tokenId da coleção do pacote NFT/ | function totalNftMinted(uint256 _tokenId) public view returns (uint256) {
return minted[_tokenId];
}
| 5,655,377 |
./full_match/1/0x873080226C109bf3559f14B8e33565F9b1A3f4Ce/sources/contracts/NFTSalon.sol | Use : Add a bid to auction Input : Token ID Output : Emit tokenBid event by giving token id, bidder adress, bid ammount, and timestamp of event | function addBid(uint _tokenId, string memory _location) public payable nonReentrant(){
require(auctions[_tokenId].isBidding,"Auction ended");
isSoldorBidded[referenceTotokenBatch[_tokenId]] = true;
locations[_tokenId] = _location;
if (auctions[_tokenId].bidder == payabl... | 3,165,866 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.6;
interface IFundingGetter {
function fundingModule() external view returns (address);
}
contract Proxy {
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
modifier authorizedOnly(... | Delegates execution to an implementation contract. This is a low level function that doesn't return to its internal call site. It will return to the external caller whatever the implementation returns. _implementation Address to delegate./ Copy msg.data. We take full control of memory in this inline assembly block bec... | function _call(address _implementation) internal authorizedOnly {
uint256 _value = msg.value;
assembly {
calldatacopy(0, 0, calldatasize())
let result := call(gas(), _implementation, _value, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch res... | 6,432,155 |
./full_match/4/0xBF9C64E984e02FB22D98c7E7DAB9CF9f7e3a3437/sources/contracts/AquaFactory.sol | governance function to change the feeManager _feeManager new address allowed to change fees | function setFeeManager(address _feeManager) external isFeeManager {
feeManager = _feeManager;
emit FeeManagerUpdated(_feeManager);
}
| 793,804 |
pragma solidity 0.4.24;
contract ERC20 {
// modifiers
// mitigate short address attack
// thanks to https://github.com/numerai/contract/blob/c182465f82e50ced8dacb3977ec374a892f5fa8c/contracts/Safe.sol#L30-L34.
// TODO: doublecheck implication of >= compared to ==
modifier onlyPayloadSize(uint numWords... | Multiplies two numbers, throws on overflow./ | function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
... | 6,384,491 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.