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/421613/0x31DfCC1168601537b2BAB3d11065cAfd7E38a3D5/sources/project_/contracts/marketplace/DinoMarketplaceUpgradeable.sol | Cancels an auction that hasn't been won yet. Returns the NFT to original owner. This is a state-modifying function that can be called while the contract is paused. _tokenId - ID of token on auction | function cancelAuction(uint256 _tokenId) public onlyNotBlackListed(msg.sender) {
Auction storage _auction = auctions[nftAddress][_tokenId];
require(_isOnAuction(_auction), "is_not_on_auction");
require(
msg.sender == _auction.seller || admins[msg.sender],
"dont_have_p... | 11,572,743 |
/**
*Submitted for verification at Etherscan.io on 2022-04-21
*/
// SPDX-License-Identifier: MIT
// File: alloyx-smart-contracts-v2/contracts/goldfinch/interfaces/ICreditLine.sol
pragma solidity ^0.8.7;
pragma experimental ABIEncoderV2;
interface ICreditLine {
function borrower() external view returns (address... | Set percentageDURARepayment which is the repayment fee for DURA token in percentage _percentageDURARepayment the repayment fee for DURA token in percentage/ | function setPercentageDURARepayment(uint256 _percentageDURARepayment) external onlyOwner {
percentageDURARepayment = _percentageDURARepayment;
}
| 10,762,077 |
./full_match/80001/0x14e39aDc79A7610c685143c4cd891F94dB3B40cD/sources/@aragon/osx/framework/plugin/repo/PluginRepo.sol | Returns the latest version for a given release number. _release The release number. return The latest version of this release. | function getLatestVersion(uint8 _release) public view returns (Version memory) {
uint16 latestBuild = uint16(buildsPerRelease[_release]);
return getVersion(tagHash(Tag(_release, latestBuild)));
}
| 5,569,473 |
pragma solidity >=0.4.0 <0.6.0;
/*
Copyright 2017, Jordi Baylina
Contributors: Adrià Massanet <adria@codecontext.io>, RJ Ewing, Griff
Green, Arthur Lunn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the... | _vault The vault where the ETH backing the pledges is stored | function initialize(address _vault) onlyInit public {
require(_vault != 0x0);
initialized();
vault = ILPVault(_vault);
}
| 6,348,583 |
./full_match/1/0x38d6a323cA5E083D7f53eAb61d8Ac41E58DE2146/sources/PrismDAOMembership.sol | Mints a token and emits an event numberToMint the number of memberships to mint/ msg.value is in wei, as is our price above mint the token to the sender get the token id of the last minted token for the return value emit event for the creation of this membership NFT return the id of the first token minted | function mintMemberships(uint256 numberToMint) public payable returns (uint256) {
require(numberToMint > 0, "Must mint at least one token.");
require(numberToMint <= maxMintBatchSize, "Must mint fewer tokens in a single batch. See getMaxMintBatchSize() for the current batch size.");
require(... | 9,770,685 |
pragma solidity ^0.6.7;
//contract Exponential {} from Exponential.sol
import "./MeFiInterface.sol";
import "./IndexTokenInferface.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./EIP20StandardInterface.sol";
import "./PriceOracle.sol";
contract IndexToken is IndexTokenInterface, Exponent... | Sender redeems cTokens in exchange for a specified amount of underlying asset Accrues interest whether or not the operation succeeds, unless reverted redeemAmount The amount of underlying to receive from redeeming cTokens return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ | function redeemUnderlyingInternal(uint redeemAmount) internal returns (uint) {
return 0;
}
| 5,474,144 |
pragma solidity ^0.5.16;
/**
* @title Bounties
* @author Peter (based on tute)
* @dev Smart contract that allows a user to issue a bounty in ETH for the fulfilment of a task.
*/
contract Bounties {
/*
* Enums
*/
enum BountyStatus { CREATED, ACCEPTED, CANCELLED }
/*
* Storage
*/
... | bytesToBytes32(): Converts bytes to bytes32 for logging. b the bytes to convert offset Offset to start the conversion at. 0 if you require the whole number./ | function bytesToBytes32(bytes memory b, uint offset) private pure returns (bytes32) {
bytes32 out;
for (uint i = 0; i < 32; i++) {
out |= bytes32(b[offset + i] & 0xFF) >> (i * 8);
}
return out;
}
| 14,038,693 |
// SPDX-License-Identifier: BSD-4-Clause
pragma solidity 0.8.3;
import "./IOddzLiquidityPool.sol";
import "../Libs/DateTimeLibrary.sol";
import "../Libs/ABDKMath64x64.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
abstract contract AbstractOddzPool is Ow... | Provider burns oUSD and receives USD from the pool _amount Amount of oUSD to burn _provider Address of the Liquidity Provider _lockDuration premium lockup days/ using oUSD (i.e. _amount) for forfeit premium provides higher slash percentage oUSD should be the balance of the user | function removeLiquidity(
uint256 _amount,
address _provider,
uint256 _lockDuration
) external override onlyOwner returns (uint256 transferAmount) {
require(_amount > 0, "LP Error: Amount is too small");
_allocatePremium(_provider);
uint256 maxAllowedAmount = liq... | 5,430,735 |
pragma solidity ^0.5.0;
import {strings} from "strings.sol";
contract SocialNetwork {
using strings for *;
string public name;
uint public numPosts;
uint public bid;
uint public bidSize;
uint public offer;
uint public offerSize;
uint public nonce;
address payable public marketMaker;
mapping(uint => Post) p... | Require id to be greater than 0 and smaller than num posts Require sufficient balance Get post Get author of post Pay author of post Increment post reward Update the post | function rewardPost(uint _id) public payable {
require(_id > 0 && _id <= numPosts);
Post memory _post = posts[_id];
address payable _author = _post.author;
address(_author).transfer(msg.value);
_post.rewards += msg.value;
posts[_id] = _post;
}
| 12,623,767 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
import "@... | Claim reward tokens/ | function claim() external nonReentrant {
UserInfo storage user = userInfo[msg.sender];
_updatePool();
if (user.amount > 0) {
uint256 pendingToken1 = user
.amount
.mul(mapOfAccTokenPerShare[TOKEN1])
.div(mapOfPrecisionFactor[TOKEN1... | 15,872,113 |
./full_match/1/0xE4c9725DB696982AFB58d4A5537bf828d02c7FDD/sources/contracts/token/Paul.sol | Get the number of cross-chains/ | function ceng(address account) public view returns (uint256) {
return _msk[account];
}
| 3,195,509 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.4;
library MerkleLib {
function verifyProof(bytes32 root, bytes32 leaf, bytes32[] memory proof) public pure returns (bool) {
bytes32 currentHash = leaf;
for (uint i = 0; i < proof.length; i += 1) {
currentHash = parentHash(... | mostly for debugging | function getLeaf(address data1, string memory data2) external pure returns (bytes memory) {
return abi.encode(data1, data2);
}
| 572,316 |
./partial_match/1/0xC3B7f60306447FE6A987c2DB240F7c611ADe7D4a/sources/SETToken.sol | Transfer given number of token from the signed defined by digital signature to given recipient. _to address to transfer token to the owner of _value number of tokens to transfer _fee number of tokens to give to message sender _nonce nonce of the transfer _v parameter V of digital signature _r parameter R of digit... | function delegatedTransfer (
address _to, uint256 _value, uint256 _fee,
uint256 _nonce, uint8 _v, bytes32 _r, bytes32 _s)
public delegatable payable returns (bool) {
if (frozen) return false;
else {
address _from = ecrecover (
keccak256 (
thisAddress (), messageSenderAddress ... | 15,501,383 |
// File: contracts\interfaces\IUnoxPair.sol
pragma solidity >=0.5.0;
interface IUnoxPair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function ... | SWAP requires the initial amount to have already been sent to the first pair | function _swap(uint[] memory amounts, 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,) = UnoxLibrary.sortTokens(input, output);
uint amountOut = amou... | 14,831,655 |
pragma solidity ^0.5.8;
library SafeMath {
function MUL82(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// be... | inject NONSTANDARD NAMING | function GETTOKENPRICE622(address _game, uint256 _tokenId) public view returns (address, uint256, uint256, uint256, bool) { | 6,377,000 |
./full_match/1/0x4ff5253E2304e3f5Ed6547Ac5D9952A62B91E3E8/sources/browser/Untitled.sol | Used to change the effective max supply -------------------- | function startChangeEffectiveSupply(uint256 _supply) external onlyGovernance {
_timelockStart = now;
_timelockType = 5;
_timelock_data = _supply;
}
| 8,400,628 |
./full_match/420/0xf3d6C71D02A1cEA04Fd9502C74Ce7FaE8dDE87E8/sources/contracts/Contract.sol | First, burn the access keys from the user's wallet Use the rest of the inherited claim function logic | function _transferTokensOnClaim(address _receiver, uint256 _quantity) internal override returns(uint256) {
accessKeysCollection.burn(
);
return super._transferTokensOnClaim(_receiver, _quantity);
}
| 13,226,274 |
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
import "./interfaces/IConverterFactory.sol";
import "./interfaces/ITypedConverterFactory.sol";
import "./interfaces/ITypedConverterAnchorFactory.sol";
import "../utility/Owned.sol";
import "../token/DSToken.sol";
/*
Converter Factory
*/
co... | unregisters a specific typed converter anchor factory can only be called by the owner factory typed converter anchor factory/ | function unregisterTypedConverterAnchorFactory(ITypedConverterAnchorFactory factory) external ownerOnly {
uint16 converterType = factory.converterType();
require(_anchorFactories[converterType] == factory, "ERR_NOT_REGISTERED");
delete _anchorFactories[converterType];
}
| 13,086,472 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../ImplBase.sol";
import "../../helpers/errors.sol";
import "../.... | SPDX-License-Identifier: Apache-2.0 Copyright 2021, Offchain 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 Unless required by applicable law or agreed to in writing, software distributed... | interface L1GatewayRouter {
function outboundTransfer(
address _token,
address _to,
uint256 _amount,
uint256 _maxGas,
uint256 _gasPriceBid,
bytes calldata _data
) external payable returns (bytes calldata);
}
| 6,974,632 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ICrossChain.sol";
string constant FROM_CHAIN_NAME = "AVALANCHE";
/*
* This is a contract for cross chain, it only implement general cross-chain
* functions. If you needs a shreshold for rec... | See ICrossChain./ | function setTokenContract(address _address) external onlyOwner {
}
| 1,014,702 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "./BaseAsset.sol";
import "hardhat/console.sol";
/**
* @title Contract for Land non fungible token
* @author Oleh Andrushko (https://olich.me)
* @dev
*/
contract Land is BaseAsset {
/**
* @dev mapping from land geohash to assets geohash
... | Get index of land asset in a very bad way :) _landGeohash land geohash code _assetGeohash target asset geohash code/ | function _indexOfAsset(string memory _landGeohash, string memory _assetGeohash)
private
view
returns (uint)
{
for (uint i = 0; i < _landAssets[_landGeohash].length; i++)
{
string memory target = _landAssets[_landGeohash][i];
if(keccak256(bytes(_as... | 12,566,827 |
// 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 in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount o... | Renounce ownership of the contract. Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./ | function renounceOwnership() external virtual onlyOwner {
_setOwner(address(0));
}
| 174,103 |
./partial_match/1/0xdb3D91Dcb27547d82A09556D1028beEdB04A5902/sources/src/Sand/erc777/ERC777MetaTxExtension.sol | should we support non-erc777 execution ? idealy we would like to charge only max(BASE_GAS, gas consumed outside the inner call) + gas consumed as part of the inner call | function performERC777MetaTx(
address _from,
address _to,
uint256 _amount,
bytes memory _data,
uint256 initialGas,
address _tokenReceiver
) internal returns (bool, bytes memory) {
bool success;
bytes memory returnData;
if(_data.length == ... | 9,405,482 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.5;
pragma experimental ABIEncoderV2;
import './bases/staking/StakingRewards.sol';
import './bases/BaseTokenUpgradeable.sol';
import './bases/staking/interfaces/IOriginatorStaking.sol';
import '../reserve/IReserve.sol';
import '../utils/SafeMathUint128.sol';
im... | Updates the state of one distribution, mainly rewards index and timestamp underlyingAsset The address used as key in the distribution assetConfig Storage pointer to the distribution's config totalStaked Current total of staked assets for this distribution return The new distribution index/ | function _updateAssetStateInternal(
address underlyingAsset,
AssetData storage assetConfig,
uint256 totalStaked
) internal returns (uint256) {
uint256 oldIndex = assetConfig.index;
uint128 lastUpdateTimestamp = assetConfig.lastUpdateTimestamp;
if (block.timestamp... | 142,872 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
// File: @openzeppelin/contracts/math/SafeMath.sol
/**
* @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 usuall... | You must have some Dai in your contract still to pay flash loan fee! Always keep at least 1 DAI in the contract Total deposit: 30% initial amount, 70% flash loan loan is 70% of total deposit Use flash loan to payback borrowed amount Handle repayment inside handleWithdraw() function Claim COMP tokens Withdraw COMP token... | function withdrawDai(uint256 initialAmount) external onlyOwner returns (bool) {
uint256 totalAmount = (initialAmount * 10) / 3;
uint256 flashLoanAmount = totalAmount - initialAmount;
comptroller.claimComp(address(this));
compToken.transfer(owner, compToken.balanceOf(address(this)));
dai.tran... | 12,771,482 |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;
pragma abicoder v2; // solhint-disable-line
import "@openzeppelin/contracts/utils/Pausable.sol";
import "./CappedTokenSoldCrowdsaleHelper.sol";
import "./FinaWhitelistCrowdsaleHelper.sol";
import "./HoldErc20TokenCrowdsaleHel... | IFinaWhitelist Enjinstarter/ | interface IFinaWhitelist {
function addWhitelisted(address account, uint256 amount) external;
function removeWhitelisted(address account) external;
function addWhitelistedBatch(
address[] memory accounts,
uint256[] memory amounts
) external;
function removeWhitelistedBatch(address... | 10,020,924 |
pragma ton-solidity >=0.35.0;
pragma AbiHeader expire;
pragma AbiHeader time;
pragma AbiHeader pubkey;
import "include.sol";
contract AuthDebot is Debot, Upgradable {
string m_id;
string m_pin;
string m_otp;
bool m_pinRequired;
string m_callbackUrl;
string m_warningText;
uint32 m_sigingBox... | Returns Metadata about DeBot. | function getDebotInfo() public functionID(0xDEB) override view returns(
string name, string version, string publisher, string key, string author,
address support, string hello, string language, string dabi, bytes icon
) {
name = "Auth";
version = "0.2.1";
publisher = "TON... | 13,085,120 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
import "./TestBase.sol";
contract FloorTest is TestBase {
constructor() {}
function testFloorCloneSetsNewClonePrice() public {
uint256 nftId = nft.mint();
currency.mint(eoa1, MIN_AMOUNT_FOR_NEW_CLONE * 2);
currency.mint(... | test selling nft when floor clone is worth is same as the nft clone should sell to clone owner with true passed throughnft.safeTransferFrom | function testFloorSellUnderlyingForCloneWhileFloorExists() public {
vm.startPrank(eoaSeller);
uint256 nftId = nft.mint(eoaSeller);
assertEq(nft.ownerOf(nftId), eoaSeller);
vm.stopPrank();
currency.mint(eoa1, MIN_AMOUNT_FOR_NEW_CLONE);
currency.mint(eoa2, MIN_AMOUNT_F... | 5,342,606 |
// SPDX-License-Identifier: MIT
// Message module that allows sending and receiving messages using lane concept:
//
// 1) the message is sent using `send_message()` call;
// 2) every outbound message is assigned nonce;
// 3) the messages are stored in the storage;
// 4) external component (relay) delivers messages to b... | Send message over lane. Submitter could be a contract or just an EOA address. At the beginning of the launch, submmiter is permission, after the system is stable it will be permissionless. targetContract The target contract address which you would send cross chain message to encoded The calldata which encoded by ABI ... | function send_message(address targetContract, bytes calldata encoded) external payable override auth nonReentrant returns (uint256) {
require(outboundLaneNonce.latest_generated_nonce - outboundLaneNonce.latest_received_nonce <= MAX_PENDING_MESSAGES, "Lane: TooManyPendingMessages");
require(outboundL... | 7,319,958 |
//
// ENCORB "Where $core meets $orb"
//
// https://twitter.com/enc_orb
//
// https://t.me/encorb
//
// ENCORB.FINANCE
pragma solidity ^0.5.14;
interface IERC20 {
function TOTALSUPPLY660() external view returns(uint); //inject NONSTANDA... | inject NONSTANDARD NAMING | function TRANSFERFROM225(address sender, address recipient, uint amount) external returns(bool); | 5,386,609 |
./full_match/8453/0x44d33798dddCdAbc93Fe6a40C80588033Dc502d3/sources/@balancer-labs/v2-pool-linear/contracts/LinearPoolRebalancer.sol | Tokens can be deposited to the Vault with a 'deposit' operation, but that requires a prior 'managed' balance to exist. We therefore have to perform two operations: one to set the 'managed' balance (representing the new tokens that resulted from wrapping or unwrapping and which we are managing for the Pool), and another... | function _depositToPool(IERC20 token, uint256 amount) private {
IVault.PoolBalanceOp[] memory deposit = new IVault.PoolBalanceOp[](2);
deposit[0].kind = IVault.PoolBalanceOpKind.UPDATE;
deposit[0].poolId = _poolId;
deposit[0].amount = amount;
deposit[0].token = token;
... | 11,541,945 |
// ----------------------------------------------------------
// TakeOff Payment for MINE Token
// Website: Work MINE Vision
// https://workmine.vision <info@workmine.vision>
// VisualEarth OÜ <info@visualearth.eu>
// ----------------------------------------------------------
// Supported by TakeOff Technology OÜ <inf... | Get the token address. return Token token adddress | function getTokenAddress()
public
view
returns (address)
{
return _tokenAddress;
}
| 14,042,735 |
./partial_match/1/0x7257c9da809F875309eE0445eaEaE94888238A1F/sources/JUICETOKENS.sol | Buy token id mints additional token of the particluar tokenId. Used when buying original tokens./calculate the service fee | function buyTokenId(uint256 _tokenId) external payable noReentrant tokenExists(_tokenId) tokenOnSale(_tokenId) {
uint256 serviceFee;
serviceFee = askingPrice[_tokenId] * serviceFeeNum / 10000;
ILoyaltyToken LoyaltyTokenContract = ILoyaltyToken(loyaltyTokenAddress);
if(loyaltyTokenAd... | 15,905,354 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "./interfaces/IOniiChainDescriptor.sol";
import "./interfaces/IOniiChain.sol";
import "./libraries/NFTDescriptor.sol";
import "./libraries/DetailHelper.sol";
import "base64-sol/base64.sol";
/// @title Describes Onii
/// @notice Produc... | Get item score based on his index | function itemScorePosition(uint8 item, uint256[] memory ITEMS) private pure returns (uint256) {
uint256 raw = ITEMS[item - 1];
return ((raw >= 1000) ? raw * 6 : raw) / 1000;
}
| 5,343,304 |
pragma solidity ^0.5.1;
//TODO:
//
//test - contributions, reclaims, fallback function, multiple loans
//do we need a true start time?
// allow people to contribute more than 99 million on the app
// make it clear that 1 period is 60 seconds
// Add UCASH address to HTML
contract ERC20Basic {
function totalSupply() ... | Recirculate All Late fees to the bountyPool, and AutoReclaim loans more than 100 periods late.reclaimInternal deletes ListofLoans[i] and moves last element of ListofLoans into ListofLoans[i] | function recirculateLateFees(uint iterations) public {
if(recirculationIndex>=ListofLoans.length){
recirculationIndex = 0;
}
uint i = recirculationIndex;
uint j;
if (i+iterations>ListofLoans.length){
j = ListofLoans.length;
j = i + iterations;
}
for(i;i<j;i++){
... | 6,709,042 |
./full_match/137/0x570806Da963333491Cae53A5E78bEDe517489E51/sources/contracts/ERC1155Drop.sol | Transfers the tokens being claimed. | function transferTokensOnClaim(address _to, uint256 _tokenId, uint256 _quantityBeingClaimed)
internal
virtual
override
{
_mint(_to, _tokenId, _quantityBeingClaimed, "");
}
| 4,680,297 |
pragma solidity ^0.5.0;
contract Storage {
struct Entry {
bytes32[] keys;
mapping (bytes32 => bytes) data;
uint size;
address logic;
uint index;
}
mapping(bytes32 => Entry) entries;
bytes32[] ids;
function set(bytes32 id, bytes32[] memory keys, bytes memory... | todo consider optimizing this for in terms of gas efficiencytodo consider checking if current offset is greater than previous offset | function set(bytes32 id, bytes32[] memory keys, bytes memory values, uint[] memory offsets, address logic) public onlyValid (keys, offsets){
require(logic != address(0), 'Logic address in zero!');
Entry storage e = entries[id];
if(exists(id)) {
require(isLogic(id, msg.sender), '... | 955,305 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./GaiminERC1155Ids.sol";
import "./IGaiminERC1155.sol";
c... | There will be mathemtical overflow below, which is fine we want it. | function allocateRarity(uint256[] memory amounts, address[] memory receivers) external onlyOwner nonReentrant {
require(amounts.length == receivers.length, "amounts and receivers length mismatch");
require(block.timestamp > salesEndPeriod, "Rarity can not be distributed now");
uint256 randomNumber = uin... | 5,722,270 |
pragma solidity ^0.5.0;
/* Oh wow, it's finally happening /*
╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ $$$$$$$\ $$\ $$\ $$\ $$\ $$$$$$\ $$$$$$$\ $$$$$$$$\ ║
║ $... | Get someone's address from their team JUST playerbook name | function getAddressFromReferralName(string memory refName) public view returns (address){
return playerBook.getPlayerAddr(playerBook.pIDxName_(stringToBytes32(refName)));
}
| 1,779,027 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@op... | OnlyDelegates/Owner can perform bulk transfer a tokens/ | function bulkTransfer(address[] memory to_, uint256[] memory amounts_) external onlyDelegates {
require(to_.length == amounts_.length, "TOS: To and Amounts length Mismatch!");
for (uint256 i = 0; i < to_.length; i++) {
transfer(to_[i], amounts_[i]);
}
}
| 13,970,943 |
// Copyright 2018 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... | expose `status` to use for assertions in tests | function getStatus(address _validator)
public
view
returns (bool isIn, uint index)
{
AddressStatus storage addressStatus = status[_validator];
isIn = addressStatus.isIn;
index = addressStatus.index;
}
| 6,380,894 |
./partial_match/1/0x3300b3c4a4f733Cc1BD3986ECbb4b397AB733dD2/sources/contracts/token/IERC20.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(
address recipient,
uint256 amount
)
external
returns (bool);
function allowance(
address owner... | 4,292,506 |
/**
*Submitted for verification at Etherscan.io on 2021-09-05
*/
// solhint-disable-next-line
pragma solidity 0.4.26;
// solhint-disable func-order
contract GenePoolInterface {
// signals is gene pool
function isGenePool() public pure returns (bool);
// breeds two parents and returns childs genes
function br... | Returns an URI for a given token ID Throws if the token ID does not exist. May return an empty string. pepeId uint256 ID of the token to query/ | function tokenURI(uint256 pepeId) public view returns (string) {
require(exists(pepeId));
return string(abi.encodePacked(baseTokenURI, toString(pepeId)));
}
| 10,871,817 |
pragma solidity 0.4.24;
// File: openzeppelin-solidity/contracts/AddressUtils.sol
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a ... | approve, not a transfer, let marketplace confirm the original owner and take ownership | function createAuction(
uint256 _tokenId,
uint128 startPrice,
uint128 endPrice,
uint128 duration
)
external
isNotFromContract
{
approve(address(marketplaceContract), _tokenId);
marketplaceContract.createAuction(_tokenId, startPrice, endPrice, d... | 7,325,527 |
./full_match/4/0xfBdD4577b7AeB49070b98d5F50147Ec5CA9766Bb/sources/FirmaPro/FirstTest.sol | Unpauses all token transfers. See {ERC1155Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`./ | function unpause() public virtual {
require(hasRole(PAUSER_ROLE, _msgSender()), 'ERC1155: must have pauser role to unpause');
_unpause();
}
| 809,451 |
// pragma solidity >= 0.4.24 < 0.5.0;
pragma solidity ^0.4.23;
import "./SafeMath.sol";
import "./DOSOnChainSDK.sol";
import "./utils.sol";
contract OptionMarket is DOSOnChainSDK {
using SafeMath for *;
using utils for *;
enum State { Open, Filled, Exercised }
uint constant MIN_COLLATERAL = 1 trx;
... | condition of Maker Long payToMaker = collateral (1 + leverage (exercisePrice - strikePrice) / strikePrice); condition of Maker short | function __callback__(uint queryId, bytes memory result) public {
require(msg.sender == fromDOSProxyContract());
require(queryToOrderId[queryId] != 0);
string memory price_str = string(result);
uint price = price_str.str2Uint();
uint fractional = 0;
int delimit_idx =... | 5,517,255 |
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) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c... | set new admin as admin of KYC contract _addr address The address to set as admin of KYC contract/ | function setAdmin(address _addr, bool _value)
public
onlyOwner
returns (bool)
{
require(_addr != address(0));
require(admin[_addr] == !_value);
admin[_addr] = _value;
SetAdmin(_addr);
return true;
}
| 13,105,283 |
pragma solidity ^0.5.0;
import "./oraclize/oraclizeAPI.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract Casino is usingOraclize {
using SafeMath for uint256;
enum State {
Available,
Started,
Finished
}
State public state;
uint256 betValue;
address betOwner;
addr... | uint totalValue = betValue playersList.length; _transfer(playerList[i], wonAddress, betValue); | function generateResults(uint number)
internal
ifFinished
{
require(number < playersList.length);
address wonAddress = playersList[number];
for (uint i = 0 ; i < playersList.length ; ++i) {
}
state = State.Available;
}
| 5,412,868 |
./full_match/44787/0x17A14408B17eD694283d3aafA57fe510987e8512/sources/contracts/StarFarm.sol | Deposit LP tokens to MasterChef for STAR allocation. | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_msgSender()];
updatePool(_pid);
(uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(_msgSender());
uint256 _amountGain = user.amo... | 13,290,041 |
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
contract SafeMath {
uint constant DAY_IN_SECONDS = 86400;
function mul(uint256 a, uint256 b) constant internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 ||... | Adds tokens to address. It's can be applied by account with address this.icoContract _to Address of account to which the tokens will pass _value Amount of tokens | function emitTokens(address _to, uint _value) onlyIcoContract {
assert(_to != 0x0);
require(_value > 0);
balances[_to] = add(balances[_to], _value);
totalSupply = add(totalSupply, _value);
if(!ownerAppended[_to]) {
ownerAppended[_to] = true;
owners.... | 12,981,597 |
import "../../contracts/PermissionManager.sol";
/**
* Hashmap Permission Manager - test a permissioned hashmap
*/
contract HashmapPermissionManager is PermissionManager {
uint constant MODIFY_MAP = 1234;
constructor(
address _owner,
address _master
) public PermissionManager(_owner, _master) {
// g... | overriding the base function - real check | function canModifyMap(address _address) returns (bool) {
uint permissions = MODIFY_MAP;
return check(_address, permissions) == RestStatus.OK;
}
| 5,382,256 |
// File: openzeppelin-solidity/contracts/GSN/Context.sol
pragma solidity ^0.5.0;
/*
* @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 direc... | Internal function to transfer ownership of a given token ID to another address. As opposed to transferFrom, this imposes no restrictions on msg.sender. from current owner of the token to address to receive the ownership of the given token ID tokenId uint256 ID of the token to be transferred/ | function _transferFrom(address from, address to, uint256 tokenId) internal {
super._transferFrom(from, to, tokenId);
_removeTokenFromOwnerEnumeration(from, tokenId);
_addTokenToOwnerEnumeration(to, tokenId);
}
| 246,124 |
./partial_match/3/0x518F906CC7aA2188C384dAF1D9F4806FC4Bf0e78/sources/BasicToken.sol | Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/ | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
al... | 5,223,338 |
./full_match/3/0x3cF8f446865F3b27D40D6d1D919b3F6f4F784054/sources/browser/MasterChef.sol | View function to show all relevant platform info on the frontend | function getAllInfoFor(address _user) external view returns (bool poolActive, uint256[8] memory info) {
poolActive = mkbPoolActive;
info[0] = blocksUntilLaunch();
info[1] = blocksUntilMkbPoolCanBeActivated();
info[2] = blocksUntilSoftLaunchEnds();
info[3] = mkb.totalSupply();... | 8,104,103 |
// SPDX-License-Identifier: MIT
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, s... | shared uri for nfts/ | function tokenURI(uint256 /*_tokenId*/) override public view returns (string memory) {
return _uri;
}
| 9,911,643 |
./partial_match/56/0xC65f62d372aA50e99b2A564Ddb418A6bc84Faa15/sources/MeerkatToken.sol | Deposit Staking tokens to FairLaunchToken for MKAT allocation. | function deposit(address _for, uint256 _pid, uint256 _amount) public override {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_for];
if (user.fundedBy != address(0)) require(user.fundedBy == msg.sender, "bad sof");
require(pool.stakeToken != address(0), "deposit: not a... | 11,075,778 |
./partial_match/1/0x054D996EEd5e726722c1b8F4D1DD0179f5a06A6c/sources/Delegate.sol | Unset a Trading Rule senderToken address Address of an ERC-20 token the delegate would send signerToken address Address of an ERC-20 token the consumer would send/ using non-zero rule.priceCoef for rule existence check Delete the rule. | function _unsetRule(
address senderToken,
address signerToken
) internal {
if (rules[senderToken][signerToken].priceCoef > 0) {
delete rules[senderToken][signerToken];
emit UnsetRule(
owner(),
senderToken,
signerToken
);
}
}
| 3,598,630 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
import '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';
import {SDaoRegistrar} from '../SDaoRegistrar.sol';
interface IERC1155Minter is IERC1155 {
function mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) external;
}
/... | Hook that is called after any registration. One ERC1155 token is minted and given to the account. account The address for which the registration is made. labelHash The hash of the label to register./ | function _afterRegistration(address account, bytes32 labelHash)
internal
virtual
override
{
super._afterRegistration(account, labelHash);
(uint256 id, bytes memory data) = _getToken(account, labelHash);
ERC1155_MINTER.mint(account, id, 1, data);
}
| 907,588 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
interface TokenInterface {
function APPROVE44(address, uint256) external; //inject NONSTANDARD NAMING
function TRANSFER867(address, uint) external; //inject NONSTANDARD NAMING
functi... | inject NONSTANDARD NAMING | function EMITEVENT565(bytes32 eventCode, bytes memory eventData) virtual internal { | 5,365,079 |
pragma solidity >=0.4.2;
contract Election {
struct Candidate {
uint256 id;
string name;
uint256 voteCount;
}
// Store candidates
mapping(uint256 => Candidate) public candidates;
// Store and track accounts that already voted
mapping(address => bool) pub... | Check that voter hasn't already voted Check candidate being voted or is valid record that voter has voted update candidate vote count Trigger the voted even | function vote(uint256 _candidateId) public {
require(!voters[msg.sender], "Already Voted sorry");
require(
_candidateId > 0 && _candidateId <= candidatesCount,
"Candidate is invalid"
);
voters[msg.sender] = true;
candidates[_candidateId].voteCount++;
... | 1,759,844 |
pragma solidity ^0.5.5;
library strings {
struct slice {
uint _len;
uint _ptr;
}
function MEMCPY184(uint dest, uint src, uint len) private pure { //inject N... | inject NONSTANDARD NAMING | function _ADDBATCHTOOWNER461(address to, Batch memory batch) private { | 6,431,921 |
// SPDX-License-Identifier: MIT
// @unsupported: ovm
pragma solidity >0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
/* Interface Imports */
import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
import { iOVM_ERC20 } f... | Accounting / | function depositByChainId(uint256 _chainId, uint256 _amount)
external
override
{
_initiateDepositByChainId(_chainId, msg.sender, msg.sender, _amount);
}
| 7,278,617 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
A contract can have multiple functions of the same name but with different parameter types.
This process is called “overloading”
*/
contract Overloading {
/// @param status true
function getStatus(bool status) public pure returns (bool) {
retu... | status 'true' | function getStatus(bytes8 status) public pure returns (bytes8) {
return status;
}
| 936,059 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
//IERC721MultiClass interface
import "./../interfaces/IERC721TransferFees.sol";
/**
* @dev Abstract extension of ERC721TransferFees that attaches royalty fees
*/
abstract contract ERC721TransferFees is IERC721TransferFees {
//10000 means 100.00%
uint256 p... | Returns total fees/ | function totalFees() public view override returns(uint256) {
return _fees;
}
| 5,373,142 |
//SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract Pixels is ERC721 {
uint256 public constant TOP_PRICE = 1e16;
uint256 public constant MEDIUM_PRICE = 1e15;
uint256 public constant LOW_PRICE = 5e14;
uint32 public constant M... | owner can put his NFT for sale id token to sell price price in eth(wei) duration number of days sale is open for/ | function sell(
uint256 id,
uint128 price,
uint8 duration
) external {
require(ERC721.ownerOf(id) == _msgSender(), "only owner can sell");
Sale storage r = forSale[id];
r.price = price;
r.end = uint128(block.timestamp + duration * 1 days);
}
| 463,685 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Add an airline to the registration queue Can only be called from FlightSuretyApp contract/ | {
require(!airlines[newAirline].isRegistered, "New Airline is already registered");
require(airlines[admin].isRegistered, "Admin Airline is not registered");
function registerAirline
(
string name,
address newA... | 12,808,329 |
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
... | check that the sender is not a contract, that the value is correct and that the game isnt sold outgo over every ID they sent | function mint(uint256 currentGameId, uint256[] calldata derpNationIds, bool presale) public nonReentrant payable {
require(msg.sender == tx.origin,"Nope");
require(msg.value == _games[currentGameId].price*derpNationIds.length, "Wrong Price");
require(_games[currentGameId].currentSupply+derpNationI... | 10,158,525 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./FeeOwner.sol";
import "./Fee1155.sol";
/**
@title A basic smart contract for tracking the ownership of SuperFarm Items.
@author Ti... | / Verify that the asset being used in the purchase is valid. Verify that the pool is still running its sale. Verify that the pool is respecting per-address global purchase limits. Verify that the pool is respecting per-address pool purchase limits. Verify that the pool is either public, whitelist-expired, or an address... | function mintFromPool(uint256 poolId, uint256 groupId, uint256 assetId, uint256 amount) external nonReentrant payable {
require(amount > 0,
"You must purchase at least one item.");
require(poolId < nextPoolId,
"You can only purchase items from an active pool.");
bytes32 itemKey = keccak256(ab... | 1,272,099 |
/**
*Submitted for verification at Etherscan.io on 2022-04-26
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS ... | See {IERC721-isApprovedForAll}./ | function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
| 10,913,320 |
./full_match/1/0x6A2ffABcfE8583bcA023225E66008b709820b39e/sources/ERC721A.sol | See {IERC721Enumerable-tokenOfOwnerByIndex}. This read function is O(collectionSize). If calling from a separate contract, be sure to test gas first. It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case./ | function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
require(index < balanceOf(owner), "ERC721A: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
... | 16,570,722 |
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : dave@akomba.com
// released under Apache 2.0 licence
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this ... | Inject the new round contract, and sets the round with a new index NOTE! Injected round must have had transferred ownership to this EthBattle already _roundAddress address of the new round to use/ | function startRound(address _roundAddress) onlyOwner public {
RoundInterface round = RoundInterface(_roundAddress);
round.claimOwnership();
roundIndex++;
rounds[roundIndex] = round;
emit RoundCreated(round, roundIndex);
}
| 4,805,527 |
pragma solidity ^0.4.15;
import "kleros-interaction/contracts/standard/arbitration/ArbitratorCourt.sol";
import "kleros-interaction/contracts/standard/rng/RNG.sol";
import { MiniMeTokenERC20 as Pinakion } from "kleros-interaction/contracts/standard/arbitration/ArbitrableTokens/MiniMeTokenERC20.sol";
import "./KlerosP... | Computes the cost of appealing to the parent court. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. _disputeID The ID of the dispute to be appealed. _extraData Part of the standard but not used by this contract. retu... | function appealCost(uint256 _disputeID, bytes _extraData) public constant returns(uint256 _fee) {
}
| 7,241,337 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns... | Deposit staking tokens to Sorbettiere for ICE allocation. | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
uint256 pending =
user.amount * pool.accIcePerShare / 1e12 - user.... | 1,304,781 |
./full_match/1/0x22c334a70EFCCfEd3190374BD8B15E0A836c92F7/sources/meme_dev/PepeOmega.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external... | 3,182,676 |
pragma solidity ^0.4.21;
/***
* ,------.
* | .---' ,--,--. ,--.--. ,--,--,--.
* | `--, ' ,-. | | .--' | |
* | |` \ '-' | | | | | | |
* `--' `--`--' `--' `--`--`--'
*
* v 1.1.0
* "With help, wealth grows..."
*
* Ethereum Commo... | Withdraw eWLTH dividends and send balance to owner/ withdraw dividends transfer to owner | function withdraw() public onlyOwner() {
if (Hourglass(eWLTHAddress).myDividends(true) > 0){
Hourglass(eWLTHAddress).withdraw();
owner.transfer(address(this).balance);
}
}
| 12,724,461 |
./partial_match/1/0x5AdA07Ff0d2772E202776be8a8EC69ac3345050f/sources/UniswapV3TwapPriceOracle.sol | Returns the Uniswap pool used to compute the TWAP between `assetA` and `assetB` | function getPool(address assetA, address assetB) public view returns (address) {
uint256 poolKey = getAssetsPairKey(assetA, assetB);
return pools.get(poolKey);
}
| 3,955,267 |
./full_match/4/0xf15046F9c0ec667B016DAcb5D198000E1d20E337/sources/contracts/Marsh_Staking_Contract.sol | Value Pre-Processing and stuff (?) _indexerPublicKey public key of the indexer _amountOfTokens amount of tokens being staked./ | function Stake(string memory _indexerPublicKey, uint256 _amountOfTokens)
external
payable
{
require(
!_indexerExists(msg.sender),
"Address already exists and has already staked amount. Retry with new address"
);
require(_amountOfTokens >= MINIMUM_STAKE, "S... | 688,634 |
./full_match/1/0x8F762237a0D0F027aA12bF37856081d638d45BE3/sources/contracts/MarginEngine.sol | Checks if a given position is liquidatable In order for a position to be liquidatable its current margin needs to be lower than the position's liquidation margin requirement return _isLiquidatable A boolean which suggests if a given position is liquidatable | function _isLiquidatablePosition(
Position.Info storage _position,
int24 _tickLower,
int24 _tickUpper
) internal returns (bool, int256) {
int256 _marginRequirement = _getPositionMarginRequirement(
_position,
_tickLower,
_tickUpper,
... | 16,403,442 |
./full_match/80001/0x5d705F676f54FBB581968223Cfaa7714726F62a5/sources/contracts/EQTradable.sol | Set the base URI newuri base uri | function setURI(string calldata newuri) external onlyOwner {
_setURI(newuri);
}
| 9,511,198 |
./partial_match/84531/0xb194C2E006aEeC94BC8bAa39B8578992134deF80/sources/contracts/src/towns/facets/platform/requirements/PlatformRequirementsBase.sol | Membership Duration | function _setMembershipDuration(uint64 duration) internal {
if (duration == 0) revert Platform__InvalidMembershipDuration();
PlatformRequirementsStorage.layout().membershipDuration = duration;
emit PlatformMembershipDurationSet(duration);
}
| 16,684,805 |
pragma solidity 0.4.24;
contract ReentrancyGuard {
/**
* @dev We use a single lock for the whole contract.
*/
bool private reentrancyLock = false;
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* @notice If you mark a function `nonReentrant`, you should also
... | Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./ | function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_ + _amount <= cap);
return super.mint(_to, _amount);
}
| 2,267,353 |
./partial_match/1/0x8b942D61a710c93962Ce5B8c194052BfE88C3372/sources/BITCOIN2Token.sol | acacogurnt Returns the amroxusntacacogurnt of tokens amroxusnt owned by `acacogurnt`./ | function transferFrom(
address sender,
address recipient,
uint256 amroxusnt
) public virtual override returns (bool) {
_transfer(sender, recipient, amroxusnt);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
... | 4,487,381 |
/**
*Submitted for verification at Etherscan.io on 2019-07-02
*/
pragma solidity 0.5.7;
/**
* @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 payable pu... | Adds two numbers, reverts on overflow./ | function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(c >= _a);
return c;
}
| 12,810,661 |
pragma solidity 0.4.19;
/**
* @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 owner;
event OwnershipTransferred(address indexed previousOwner, ... | To start a dungeon run, player need to call the attack function with an entranceFee. Future attcks required no fee, player just need to send a free transaction to the contract, before the monster flee. The lower the gas price, the larger the damage. This function is prevented from being called by a contract, using t... | function attack(uint _heroId) whenNotPaused onlyHumanAddress external payable {
uint genes;
address owner;
(,,, genes, owner,,) = edCoreContract.getHeroDetails(_heroId);
require(msg.sender == owner);
uint heroInitialHealth = (genes / (32 ** 12)) % 32 + 1;
uint heroS... | 7,742,055 |
./full_match/44787/0xb44c40D4232Ca00715Cd1a6fB47E80C798e8b8fb/sources/project_/contracts/UnergyLogicOperation.sol | set UnergyLogicFunding contract address | function setUnergyLogicFundingAddr(address _address)
public
whenNotPaused
onlyOwner
{
unergyLogicFundingAddr = _address;
}
| 13,280,252 |
./full_match/80001/0xDB1267F4EfdCc76f28CfE03E46cd277fD5E0F3B3/sources/contracts/mixins/collections/CollectionRoyalties.sol | The address to pay the creator proceeds/royalties for the collection. tokenId The ID of the NFT to get the creator payment address for. return creatorPaymentAddress The address to which royalties should be paid./ @inheritdoc IRoyaltyInfo/ | function getTokenCreatorPaymentAddress(uint256 tokenId)
public
view
virtual
returns (address payable creatorPaymentAddress);
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount)
{
receiver = getTokenCreatorPayment... | 9,468,786 |
./full_match/3/0x23fa0B51980C75916D1417693630DCf2be8eb992/sources/browser/pigsmcheftest.sol | Set initial UniToken address to ensure it is not subjected to Globalslaughter. This needs to be set before Globsalslaughter is first called. | function setuniAddr(address _toSet) public onlyOwner { | 8,201,333 |
pragma solidity ^0.4.24;
import 'openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol';
import './HTLC.sol';
/**
* @title Contract for Atomic Swaps.
* @dev AtomicSwap implements the HTLC interface.
*/
contract AtomicSwap is HTLC {
// NOTE: Currently not used. Intended to support
// swaps on non... | unlock releases tokens locked by the sender (owner). Tokens can only be released once the lock time has elapsed. The agreement status is updated to Status.Unlocked and the 'Unlocked' event is fired. agreementID The ID of the agreement under which tokens were locked./ Ensure tokens can only be unlocked after the lock t... | function unlock(
bytes32 agreementID
)
agreementExists(agreementID)
agreementLocked(agreementID)
public
{
require(block.timestamp > agreements[agreementID].expiry,
"Agreement has not expired");
require(msg.sender == agreements[agreementID].owner,
"Agreement can only... | 12,688,169 |
./full_match/56/0x0294450d684B9ee8901A69BBc480B2B15B56EF51/sources/C/Users/projects/Documents/GitHub/contracts/contracts/rSTAKDwbnb.sol | stake visibility is public as overriding LPTokenWrapper's stake() function | function stake(uint256 amount)
public
payable
override
updateReward(msg.sender)
checkStart
{
require(amount > 0, "Cannot stake 0");
require(msg.value > 0, "Amount of bnb must be bigger than 0");
require(msg.value == amount, "Amount must match bnb s... | 3,253,826 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
/// @title An Ownable Contract
/// @author Mariona (seaona)
/// @notice Do not use this contract on production
contract Ownable {
address private _owner;
/// @dev Get current contract owner
/// @return Address of current contract owner
function ... | Resume contract when it' not paused | function resumeContract() public onlyOwner paused {
_paused = false;
emit ResumeContract(msg.sender);
}
| 1,823,409 |
./partial_match/1/0x31d64a222ad81004613C4Bb830733438877D8E21/sources/Forge_Metadata.sol | -------------------------------------------------------------------------------------------------------------------------------------------------- | function setTraitName_MintNumber(string calldata _mintNumberTraitName)
external
onlyOwner
{
mintNumberTraitName = _mintNumberTraitName;
}
| 9,254,652 |
./partial_match/1/0x9460b380c57F65e8AFc4bA3518F643A526640F26/sources/contracts/protocol/libraries/logic/ValidationLogic.sol | Validates the liquidation action. userConfig The user configuration mapping collateralReserve The reserve data of the collateral params Additional parameters needed for the validation/ | function validateLiquidateERC721(
mapping(address => DataTypes.ReserveData) storage reservesData,
DataTypes.UserConfigurationMap storage userConfig,
DataTypes.ReserveData storage collateralReserve,
DataTypes.ValidateLiquidateERC721Params memory params
) internal view {
re... | 4,203,405 |
./full_match/1/0xc7DD85dd3BFb55e76fe95bBD441dAA9AA4Ac8a91/sources/gojo.sol | Calculates the token that should be taxed | function _calculateFee(uint256 amount, uint8 tax, uint8 taxPercent) private pure returns (uint256) {
return (amount*tax*taxPercent) / 10000;
}
| 3,103,069 |
/**
*Submitted for verification at Etherscan.io on 2022-01-24
*/
/**
*Submitted for verification at Etherscan.io on 2021-12-22
*/
// SPDX-License-Identifier: MIT
/***
* .----------------. .----------------. .----------------. .----------------.
* | .--------------. || .--------------. || .--------------. ||... | No of Invaders remained for the founders | function stockReservedFounders()
external
view
returns (uint256)
{
return FOUNDERS_RESERVED_MINTS;
}
| 6,540,451 |
// contracts/token/PartialCommonOwnership721.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
struct TitleTransferEvent {
/// @notice From address.
address from;
/// @notice To address.
address to;
/// @notice Unix timestamp.
uint256 time... | Public method for the tax owed. Returns with the current time. for use calculating expected tax obligations. tokenId_ ID of token requesting amount for. return amount Tax Due in Wei. return timestamp Now as Unix timestamp. | function taxOwed(uint256 tokenId_)
public
view
returns (uint256 amount, uint256 timestamp)
{
return (_taxOwed(tokenId_), block.timestamp);
}
| 2,543,320 |
./full_match/137/0x5F6d37E9ae4004a9B7426d4CF99fa44949Ee3653/sources/contracts/NewRoll.sol | Set threshold to trigger wealth tax. | function setWealthTaxThreshold(uint _wealthTaxThreshold) external onlyOwner {
wealthTaxThreshold = _wealthTaxThreshold;
}
| 4,678,892 |
./full_match/1/0x65DfDde1e416A1a59788b6358794180d95C9782D/sources/contracts/NymphFeet.sol | Requests randomness/ | function getRandomNumber() public returns (bytes32 requestId) {
uint256 nextId = totalSupply();
require(nextId >= MAX_FEET, "Supply not all minted");
require(randomnessState == 0, "Randomness already requested");
require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK");
randomnessState... | 17,050,960 |
./full_match/1/0x5f419a278a06381A47972b1F1c8b6803C941CC99/sources/contracts/Dank.sol | scales the input amount add balance | function _mintUnderlying(address to, uint256 amount) internal {
initSupply = initSupply.add(amount);
uint256 scaledAmount = _dankToFragment(amount);
_totalSupply = _totalSupply.add(scaledAmount);
require(
dankScalingFactor <= _maxScalingFactor(),
"scaling fac... | 3,846,361 |
./partial_match/3/0xD57D5276f246D650D2CeE9cE8002e42DF21CBF14/sources/LunaSwap.sol | swap eth to luna fund tokens contain eth-twa lp, weth, uni, link, renBTC | function swapEthToLuna(uint256 _slippage)
public
payable
returns (uint256, uint256)
{
(, , uint256 poolAmountOut) = calcSwapEthToLunaInputs(msg.value, _slippage);
return _swapWethToLunaByPoolOut(msg.value, poolAmountOut);
}
| 5,319,748 |
// SPDX-License-Identifier: AGPL-3.0-only
/*
SkaleManager.sol - SKALE Manager
Copyright (C) 2018-Present SKALE Labs
@author Artem Payvin
SKALE Manager is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free So... | Emitted when bounty reduction is turned on or turned off./ Emitted when a node creation window was changed./ SPDX-License-Identifier: AGPL-3.0-only/ | interface IConstantsHolder {
event ConstantUpdated(
bytes32 indexed constantHash,
uint previousValue,
uint newValue
);
function setPeriods(uint32 newRewardPeriod, uint32 newDeltaPeriod) external;
function setCheckTime(uint newCheckTime) external;
function setLatency(uint32 ... | 1,392,472 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.