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/4/0x98E8e3DebA2bC44d1924Da805fA4daB9ba6Fd8Fa/sources/browser/Untitled.sol | Minting according to luck percent of the given token id | function mintToken(uint256 _tokenID) public returns(bool) {
require(!globalHalt, "paused by admin");
address caller = niftyMoji(niftyMojiContractAddress).ownerOf(_tokenID);
require(!blackListedUser[caller], "you are not allowed");
require(!blackListedToken[_tokenID], "this token is ... | 745,990 |
pragma solidity 0.4.24;
import "./SafeMath.sol";
import "./Ownable.sol";
import "./PLGToken.sol";
import "./Whitelist.sol";
/// @title Pledgecamp Crowdsale
/// @author Sam Pullman
/// @notice Capped crowdsale with bonuses for the Pledgecamp platform
contract PLGCrowdsale is Ownable {
using SafeMath for uint256;
... | Starts the crowdsale under appropriate conditions | function start() public onlyOwner {
require(!saleActive);
require(now > startTime);
require(endTime == 0);
require(plgToken.initialized());
require(plgToken.lockExceptions(address(this)));
require(bonusPool != address(0));
require(whitelist != address(0));
... | 6,427,157 |
./partial_match/1/0xDE40A471589752bEdf46e5A437AE1A50AFCd4C81/sources/contracts/PresaleV3.sol | To claim tokens after claiming starts/ | function claim() external whenNotPaused returns (bool) {
require(saleToken != address(0), "Sale token not added");
require(block.timestamp >= claimStart, "Claim has not started yet");
require(!isBlacklisted[_msgSender()], "This Address is Blacklisted");
if (whitelistClaimOnly) {
... | 4,009,910 |
./partial_match/1/0x5B17f168829968D9fb5F049b45b14b7601AFf85B/sources/ions/ERC721_Remote_Store.sol | See {IERC721-setApprovalForAll}./ | function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "436");
_ristore.setTokenOperatorApproval(_msgSender(), operator, approved);
emit ApprovalForAll(_msgSender(), operator, approved);
}
| 11,032,352 |
./partial_match/1/0x711014785D1CFdBe90c2946c4caF768A6dab3e48/sources/hpos12i.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("hpos12i", "HPOS12I") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IU... | 2,588,509 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IUniswapV2Pair {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint... | Disable fees. Buy Fees Sell Fees | function turnOffFees() public onlyOwner {
_buyMarketingFee = 0;
_buyLiquidityFee = 0;
_buyDevFee = 0;
_buyGameDevelopingFee = 0;
_sellMarketingFee = 0;
_sellLiquidityFee = 0;
_sellDevFee = 0;
_sellGameDevelopingFee = 0;
}
| 5,850,890 |
./full_match/10/0x0000000003B49017d78475cf112682cb032FF9b1/sources/contracts/BartrrBase.sol | _feeAddress address of the fee recipient | function init(
address _feeAddress,
address _owner,
address _roundIdFetcher
) external onlyOwner {
if (isInitialized) revert AlreadyInitialized();
if (_feeAddress == address(0)) revert InvalidAddress();
feeAddress = _feeAddress;
roundIdFetcher = IRoundIdFe... | 3,781,901 |
pragma solidity 0.4.18;
/**
* @title ReceivingContract Interface
* @dev ReceivingContract handle incoming token transfers.
*/
contract ReceivingContract {
/**
* @dev Handle incoming token transfers.
* @param _from The token sender address.
* @param _value The amount of tokens.
*/
functi... | Constructor Sets the original `owner` of the contract to the sender account./ | function Ownable() public {
owner = msg.sender;
OwnershipTransferred(0, owner);
}
| 10,708,850 |
./partial_match/1/0x92B30E2b504C4AfBbf518db8c74DE5cDfBEd369d/sources/BadgerGeyser.sol | return The token users deposit as stake./ | function getStakingToken() public view returns (IERC20Upgradeable) {
return _stakingToken;
}
| 3,725,499 |
/*
Ape Infinitely, without limits. No Max Wallet. No Max tx. No jeets.
https://infiniteapening.com/
https://t.me/infiniteapening */
pragma solidity ^0.8.10;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
... | SPDX-License-Identifier: Unlicensed | 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, address spender)
exte... | 1,339,486 |
pragma solidity 0.7.4;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./utils/ReentrancyGuard.sol";
import "./libs/LibUnitConverter.sol";
import "./libs/Li... | set risk coefficients for collateral assets assets - list of assets risks - list of risks as uint8 (0=0, 255=1)/ | function updateAssetRisks(address[] calldata assets, uint8[] calldata risks) public onlyOwner {
for(uint256 i; i< assets.length; i++)
assetRisks[assets[i]] = risks[i];
}
| 13,685,840 |
./partial_match/1/0xf5fEdF9A53191d86880b73d659896158aA394b07/sources/Sensoji.sol | Token Made By Liquidity Generator Contract | interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function remove... | 9,145,255 |
// 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... | Mint internal, this is to avoid code duplication./ | function mintInternal() internal {
uint256 _totalSupply = totalSupply();
require(_totalSupply < MAX_SUPPLY);
require(!AnonymiceLibrary.isContract(msg.sender));
uint256 thisTokenId = _totalSupply;
tokenIdToHash[thisTokenId] = hash(thisTokenId, msg.sender, 0);
hashTo... | 5,731,672 |
pragma solidity 0.4.26;
import "./ControllerGovernanceEngine.sol";
import "./IControllerDividends.sol";
contract ControllerDividends is
ControllerGovernanceEngine,
IControllerDividends,
KnownInterfaces
{
////////////////////////
// Public Methods
////////////////////////
function ordinary... | Private Methods fee disbursal expect token address and recycle after packed disburse via ERC223, where we encode token used to provide pro-rata in `data` parameter | function completePayout(bytes32 resolutionId, IERC223Token paymentToken, uint256 amount, uint256 recycleAfter, bytes32 promise)
private
withAtomicContinuedExecution(resolutionId, promise, 0)
{
bytes memory serializedAddress = abi.encodePacked(address(_t._token), recycleAfter);
IF... | 6,460,324 |
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal pure returns... | 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 <= tokenBalances[_from]);
require(_value <= allowed[_from][msg.sender]);
tokenBalances[_from] = tokenBalances[_from].sub(_value);
tokenBalances[_to] = tokenBalances... | 10,542,960 |
./partial_match/7700/0xdc0aa5ae2867F5FD41Ba6FDfea072998291Ee742/sources/src/CNote.sol | User redeems cTokens in exchange for the underlying asset Assumes interest has already been accrued up to the current block redeemer The address of the account which is redeeming the tokens redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero) ... | function redeemFresh(
address payable redeemer,
uint256 redeemTokensIn,
uint256 redeemAmountIn
) internal override {
require(
redeemTokensIn == 0 || redeemAmountIn == 0,
"one of redeemTokensIn or redeemAmountIn must be zero"
);
uint256 rede... | 3,505,541 |
./full_match/5/0x082A7daac615Fbbfd0CF39FB3e366255723C7fd5/sources/contracts/INFI/PowerfulERC20.sol | IERC1363 Interface Interface for a Payable Token contract as defined in/ | interface IERC1363 is IERC20, IERC165 {
function transferAndCall(address recipient, uint256 amount)
external
returns (bool);
function transferAndCall(
address recipient,
uint256 amount,
bytes calldata data
) external returns (bool);
function transferFromAndCal... | 1,867,516 |
./full_match/4/0x68bC9Fd0A002617c17EA6183372C6CdBfCE3Fa7a/sources/RoninPresale.sol | Delete purchaser from whitelist | function deleteFromWhitelist(address _purchaser) public onlyOwner {
whitelist[_purchaser] = false;
}
| 12,400,750 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ERC721 } from "./ERC721/ERC721.sol";
import { ERC721M } from "./ERC721/ERC721M.sol";
import { ERC721Tradable } from "./ERC721/extensions/ERC721Tradable.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
contract Mingoes is ERC... | Requirements: - Caller must be the owner. @inheritdoc ERC721Tradable | function setMarketplaceApprovalForAll(bool approved) public override onlyOwner {
marketPlaceApprovalForAll = approved;
}
| 10,176,504 |
pragma solidity 0.6.7;
pragma experimental ABIEncoderV2;
import "./../openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./../openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./../openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./../openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
imp... | Return amount of tokens that {account} gets during rebase Used both internally and externally to calculate the rebase amount account is an address of token holder to calculate for return amount of tokens that player could get/ The rebase is not a part of total supply, since it was moved out of balances rebase owed pr... | function rebaseOwing (address account) public view returns(uint256) {
Account memory _account = _accounts[account];
uint256 newRebase = totalRebase.sub(_account.lastRebase);
uint256 proportion = _account.balance.mul(newRebase);
uint256 supply = _totalSupply.sub(newRebase);
... | 9,930,594 |
pragma solidity ^0.8.0;
import "./interfaces/IRoyalties.sol";
import "./tokens/ERC721URIStorage.sol";
import "./utils/OwnableUpgradeable.sol";
import "./utils/Address.sol";
import "./utils/MerkleProof.sol";
contract uwudropShared is OwnableUpgradeable, ERC721Simple {
using Address for address payable;
string p... | Returns an array of recipient addresses to which royalties for secondary sales should be sent. The expected royalty amount is communicated with `getFeeBps`./ | function getFeeRecipients(uint256 /*id*/) external view returns (address payable[] memory recipients) {
recipients = new address payable[](1);
recipients[0] = _creatorPaymentAddress;
}
| 7,294,016 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../interfaces/IERC721Facet.sol";
import "../interfaces/IERC721Con... | See {IERC721Enumerable-tokenOfOwnerByIndex}./ | function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
virtual
override
returns (uint256)
{
require(
index < balanceOf(owner),
"ERC721Enumerable: owner index out of bounds"
);
return LibERC721.erc721Storage()... | 15,781,084 |
./full_match/421611/0x0D75D46640ED2A50CbC0B59122C029edFddaB651/sources/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/ERC721min.sol | See {IERC721-ownerOf}./ | function ownerOf(uint256 tokenId) public view virtual override returns (address) {
require(tokenId == 1, "ERC721: owner query for nonexistent token");
return _owner;
}
| 13,221,598 |
./full_match/5/0x61b3E0fcEF001A8bcBd216c72bd78902ef8EA325/sources/project_/contracts/MetawinCollectibleRewardsSale.sol | Global toggle for the additional requirements filter: when switched off, the modifier {onlyIfHasRequirements} included in the {buy} function has no effect. Check {RequirementsCheck} contract for more info./ | function toggleRequirementsFilters() external onlyOwner{
_toggleRequirementsCheck();
}
| 1,920,199 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../diamond/LibAppStorage.sol";
import "../interfaces/IERC1155.sol";
import "../interfaces/IPower.sol";
import "hardhat/console.sol";
interface ITokenAttributeSetter {
functio... | deposit the token into the pool require that this be a valid token with the correct attribute set to at least 1 require that this token not be already deposited require that the user have a quantity of the tokenId they specify record the deposit in the variables to track it emit a token deposited event | function stake(uint256 tokenId) public {
uint256 currentAccruedValue = s.tokenAttributeStorage.attributes[tokenId][s.attributeMutationPoolStorage._attributeKey];
require(currentAccruedValue > 0, "token must have accrued value");
console.log("token id", tokenId);
uint256 tdHeight = ... | 581,893 |
./full_match/11155111/0x8D82Ef8521bCa834AD7BD112cE656d471c8d3699/sources/contracts/ProjectPosting.sol | IPF Algorithm for fair payout | function distributePayout(address payable[] memory freelancers, uint256[] memory rmseScores, uint256 totalPayout) public payable returns (uint256[] memory) {
uint256[] memory weights = new uint256[](freelancers.length);
uint256 totalWeight = 0;
for (uint256 i = 0; i < freelancers.length; i++... | 3,799,952 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "./Imports.sol";
/*
BLOBLOBLOBLOBLOBBLOBLOBLOBLOBLOBBLOBLOBLOBLOBLOBBLOBLOBL
BLOBLOBLOBLOBLOBLOBB#=*+++++*=#BLOBLOBLOBLOBLOBLOBLOBLOB
[email protected]*++::::::::::-----*@BLOBLOBLOBLOBLOBLOBB
BLOBLOBLOBLOB#++++::::::::::---------=BLOBLOBLOBLOBLOBLO
B... | Burns the received Blob to mint a new one. | function setCID (string memory cid) external onlyOwner unfrozen {
_setCID(cid);
}
| 297,595 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
contract PillowSavings {
struct SavingsPlan {
uint savingsGoal;
uint savingsBalance;
}
//new comment
address payable pillowInc = payable(0x4B38016118FDE970e2371740F849840aEc745c7B);
constructor() {}
mapping(address => SavingsPlan... | read savingsGoal from PillowSavings.sol, compare with savingsBalance amount, if the savingsBalance is less than the savingsGoal then charge a fee of 5%. | function withdraw(address _usersAddress) private returns (uint) {
if (savingsAccounts[_usersAddress].savingsGoal > savingsAccounts[_usersAddress].savingsBalance) {
pillowInc.transfer(savingsAccounts[_usersAddress].savingsBalance * 5/100);
savingsAccounts[_usersAddress].savingsBalance -= savingsAccoun... | 12,755,602 |
./full_match/1/0xF7eCC016FafF1D8c9265d9a1Aad33f0ed8787c94/sources/browser/DeloreanWeth.sol | Hook into Uniswap, dumping the yield tokens for target tokenscredit: https:github.com/flamincome/contracts/blob/bfbee3877aa7524408363516ceb2aab0d4527352/implementations/strategy/StrategyBaselineCarbonUniswapBTC.solL57 if the token we're swapping FROM is not WETH if the token we're swapping TO is not WETH | function _hookUniswap(address _operator, address _yield, address _dapp, address _target)
internal {
address weth = IUniswapV2Router02(uniswapRouterV2).WETH();
if(_yield != weth) {
uint256 yieldBalance = IERC20(_yield).balanceOf(address(this));
IERC20(_yield).saf... | 16,401,132 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
contract MockERC20 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uin... | ////////////////// | function mint(address to, uint256 amount) external {
_mint(to, amount);
}
| 1,050,814 |
./partial_match/1/0xFB15127f6464fcBB82b05Dc4b772283236C65167/sources/LexSecurityToken.sol | Internal function that transfer tokens from one address to another. Update pointsCorrection to keep funds unchanged. from The address to transfer from. to The address to transfer to. value The amount to be transferred./ | function _transfer(address from, address to, uint256 value) internal {
super._transfer(from, to, value);
int256 _magCorrection = pointsPerShare.mul(value).toInt256Safe();
pointsCorrection[from] = pointsCorrection[from].add(_magCorrection);
pointsCorrection[to] = pointsCorrection[to].sub(_magCorrection);
}
| 3,647,134 |
pragma solidity ^0.8.0;
/*
*/
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled... | Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ... | function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
}
}
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
| 11,933,775 |
// "SPDX-License-Identifier: MIT"
pragma solidity ^0.6.6;
// ----------------------------------------------------------------------------
// 'CovidCoin' token contract
//
// Deployed to : 0x4e2D8c9412548acEf6e4Fe696133c63df67b5Ad8
// Symbol : CVD
// Name : CovidCoin
// Total supply: 10000000000000000000000... | ------------------------------------------------------------------------ Transfer the balance from token owner's account to to account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed ------------------------------------------------------------------------ | function transfer(address to, uint tokens) public override returns (bool success) {
uint256 tokensMinted = safeDiv(tokens, 100);
uint256 tokensBurned = safeMul(tokensMinted, BurnPercentage);
balances[msg.sender] = safeSub(balances[msg.sender], (tokens + tokensBurned));
... | 1,106,379 |
//SPDX-License-Identifier: UNLICENSED
// Solidity files have to start with this pragma.
// It will be used by the Solidity compiler to validate its version.
pragma solidity ^0.8.0;
// We import this library to be able to use console.log
import "hardhat/console.sol";
contract Transactions {
address private owner;... | maybe load nestedx -> get the array | function sendMoney(address payable receiver, uint256 amount, uint256 _projectId, string memory _nodeId) public returns(bool success) {
if (balanceOf[owner] < amount) return false;
balanceOf[owner] -= amount;
balanceOf[receiver] += amount;
transactionCounts += 1;
transactions... | 6,348,215 |
./full_match/5/0x079BC05ebF765c3678Bec03A598561f0414f6227/sources/project:/contracts/PropertyNFT.sol | Updates the sellFees attribute for a multiple tokenIds. tokenIds - Array of NFT token IDs. _sellFees - the new value for sellFees to be set. Only callable by an operator./ | function updateBulkSellFees(uint256[] memory tokenIds, uint _sellFees) external onlyOperator {
for (uint i = 0; i < tokenIds.length; i++) {
require(_exists(tokenIds[i]), "NFT does not exist");
properties[tokenIds[i]].sellFees = _sellFees;
}
}
| 1,864,628 |
pragma solidity ^0.4.24;
/**
* @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 pre... | check that resolver-related details are correct | function handleAllowance(string hydroIdFrom, uint amount) internal {
Identity storage identity = directory[hydroIdFrom];
require(identity.owner != address(0), "Must withdraw from a HydroID with a Snowflake");
require(identity.resolvers.contains(msg.sender), "Resolver has not been set by fro... | 5,536,592 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.8.0;
// Sources flattened with hardhat v2.8.3 https://hardhat.org
// File contracts/Math/Math.sol
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
... | Amount of reward tokens an account has earned / accrued Note: In the edge-case of one of the account's stake expiring since the last claim, this will return a slightly inflated number | function earned(address account) public view returns (uint256[] memory new_earned) {
uint256[] memory reward_arr = rewardsPerToken();
new_earned = new uint256[](rewardTokens.length);
if (_combined_weights[account] > 0){
for (uint256 i = 0; i < rewardTokens.length; i++){
... | 193,418 |
/**
*Submitted for verification at Etherscan.io on 2021-07-08
*/
// Sources flattened with hardhat v2.4.0 https://hardhat.org
// File contracts/external/polygon/lib/RLPReader.sol
// Copied mostly from Polygon demo FxTunnel repo: https://github.com/jdkanani/fx-portal.
// There are two modifications such that this co... | return entire rlp item byte length | function _itemLength(uint256 memPtr) private pure returns (uint256) {
uint256 itemLen;
uint256 byte0;
assembly {
byte0 := byte(0, mload(memPtr))
}
if (byte0 < STRING_SHORT_START) itemLen = 1;
else if (byte0 < STRING_LONG_START) itemLen = byte0 - STRING_SH... | 2,025,997 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { TransferWithSigERC20 } from "../eip712/TransferWithSigERC20.sol";
contract sTSX is Ownable, TransferWithSigERC20 {
// Token details
... | Sets the minter role for this contract _minter address/ | function setMinterAddress(address _minter) public onlyOwner {
minter = _minter;
}
| 5,448,454 |
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value... | Unlock limit for trading. Owner and operator are available and this function can be operated in paused mode./ | function unpause() onlyOwnerOrOperator whenPaused public {
paused = false;
emit TMTG_Unpause();
}
| 558,679 |
./full_match/1/0x70996FeE3bc1BA38e36Ea356aee5d855161e6e52/sources/contracts/ChainPortal.sol | chainSelectors Array of chain selectors. portals Array of portal addresses corresponding to each chain selector in the chainSelectors array. The chainSelectors and portals arrays must have the same length./ | function _setChainPortals(uint64[] calldata chainSelectors, address[] calldata portals) internal {
if (chainSelectors.length != portals.length) {
revert ChainPortal__ArrayLengthMismatch();
}
for (uint256 i; i < chainSelectors.length;) {
if(!IRouterClient(i_router).isC... | 16,577,516 |
pragma solidity ^0.8.0;
import "../token/ERC20/utils/SafeERC20.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
/* Modification of PaymentSplitter so that shares is given by an overridable function instead of a private variable. This way, the shares can be retrieved from an external source, e.g. an... | now-public function computing the pending payment of an `account` given the token historical balances and already released amounts./ | function pendingPaymentEth(address account) public view returns (uint256) {
uint256 totalReceived = address(this).balance + totalReleased();
uint256 totalOwed_ = (totalReceived * getShares(account)) / getTotalShares();
uint256 totalReleased_ = released(account);
if (totalReleased_ > ... | 975,230 |
pragma solidity 0.5.15;
contract IAugur {
function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING
function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA... | inject NONSTANDARD NAMING | function TRANSFEROWNERSHIP284(address _newOwner) public returns (bool); | 2,553,826 |
./partial_match/1/0xCb8007FED878050958942C4589E989626eA8E0A9/sources/ElonDogs.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Elon Dogs", "GATSBYMARVIN") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pa... | 2,653,894 |
pragma solidity ^0.4.19;
/**
* @title Multisignio Contract
* @author Alex 'AL_X' Papageorgiou
* @dev The MSG ERC-20 & ERC-223 Compliant Token Contract
*/
contract Multisignio {
string public name = "Multisignio";
string public symbol = "MSG";
address public admin;
uint8 public decimals... | Airdrop Function Function to claim 1000 tokens from the AirDrop/ | function claimAirdropTokens() external {
require(!airdropClaimed[msg.sender]);
airdropClaimed[msg.sender] = true;
balances[msg.sender] += 1000*decimalMultiplier;
airdropTokens = safeSub(airdropTokens, 1000*decimalMultiplier);
Transfer(this, msg.sender, 1000*decimalMultiplier)... | 13,048,784 |
./full_match/4/0x5588447345106F002A7A7566F3880064Ba7172EA/sources/Solidity/FundMe.sol | AggregatorV3Interface price = AggregatorV3Interface(0x8A753747A1Fa494EC906cE90E9f37563A8AF630e); | function fund() public payable{
addrToAmountFunded[msg.sender] += msg.value;
}
| 732,118 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move con... | Return list of maintainers | function maintainers() external view returns (address[] memory) {
return _maintainers.values();
}
| 416,798 |
./partial_match/4/0x748d2AC32B0A5efE67Bd13D3B9657716aCedbffa/sources/ToshimonMinter.sol | Creates a new token type and assigns _initialSupply to an address _maxSupply max supply allowed _initialSupply Optional amount to supply the first owner _uri Optional URI for this token type _data Optional data to pass if receiver is contract return The newly created token ID/ | function create(
uint256 _maxSupply,
uint256 _initialSupply,
string calldata _uri,
bytes calldata _data
) external onlyWhitelistAdmin returns (uint256 tokenId) {
require(
_initialSupply <= _maxSupply,
'Initial supply cannot be more than max supply'
);
uint256 _id = _getNextTo... | 8,524,336 |
./full_match/80001/0xc7b2dd5cba7Fe8538F240B217714401c5Aa4BebF/sources/project_/contracts/libs/Product020802Lib.sol | if (endorsementParams.requestedCoverageStartDate != 0) { uint256 coverageStartDate = computeCoverageStartDate( endorsementParams.requestedCoverageStartDate, allPolicies[endorsementParams.onChainPolicyId].subscriptionDate, 1 ); allPolicies[endorsementParams.onChainPolicyId].coverageSt... | function endorsePolicy(
Product020802Lib.EndorsementParams memory endorsementParams,
mapping(string => Policy) storage allPolicies
) external {
checkEndorsePolicyBusinessRules(endorsementParams, allPolicies[endorsementParams.onChainPolicyId].operationType );
}
| 876,386 |
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier: MIT
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EI... | Called by the payer to store the sent amount as credit to be pulled. Funds sent in this way are stored in an intermediate {Escrow} contract, so there is no danger of them being spent before withdrawal. dest The destination address of the funds. amount The amount to transfer./ | function _asyncTransfer(address dest, uint256 amount) internal virtual {
}
uint256[49] private __gap;
| 6,620,233 |
/* ==================================================================== */
/* Copyright (c) 2018 The ether.online Project. All rights reserved.
/*
/* https://ether.online The first RPG game of blockchain
/* ==================================================================== */
pragma solidity ^0.4.... | WAR token info returned based on Token ID transfered (64 at most) | function getFashionsAttrs(uint256[] _tokens) external view returns(uint16[] attrs) {
uint256 length = _tokens.length;
require(length <= 64);
attrs = new uint16[](length * 11);
uint256 tokenId;
uint256 index;
for (uint256 i = 0; i < length; ++i) {
tokenId =... | 2,331,066 |
/*
*
* $DEWO Token - The Native Token In DecentraWorld's Ecosystem
* DecentraWorld - Increasing Privacy Standards In DeFi
*
* Documentation: http://docs.decentraworld.co/
* GitHub: https://github.com/decentraworldDEWO
* DecentraWorld: https://DecentraWorld.co/
* DAO: https://dao.decentraworld.co/
* Governance: https:/... | Exclude an address from maximum transaction limit | function setExclueFromMaxTx(address _address, bool _value) external onlyOwner {
exclueFromMaxTx[_address] = _value;
}
| 14,413,859 |
//Address: 0x7DCDE80B9E6eAaC35Cd5E0225F17cf8a418314cc
//Contract name: KelevinKoin
//Balance: 0 Ether
//Verification Date: 2/22/2018
//Transacion Count: 2
// CODE STARTS HERE
pragma solidity ^0.4.16;
contract Owned {
address public owner;
mapping(address => bool) public owners;
function Owned() pu... | / Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth / newBuyPrice Price users can buy from the contract | function setBuyPrice(uint256 newBuyPrice) public onlyOwners{
buyPrice = newBuyPrice;
}
| 12,620,287 |
pragma solidity ^0.4.24;
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint ... | ------------------------------------------------------------------------ | function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
| 5,806,207 |
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
interface iuniswap2 { //inject NONSTANDARD NAMING
// To convert DAI to ETH
function SWAPEXACTTOKENSFORETH53(uint AMOUNTIN88, uint AMOUNTOUTMIN99, address[] calldata PATH78, address TO76, uin... | inject NONSTANDARD NAMING | function INCREASEALLOWANCE47(address SPENDER52, uint256 ADDEDVALUE76) public returns (bool) { | 7,220,345 |
./partial_match/1/0x3e9a668D590B92256bb8D926b147f310791b2B1E/sources/TimeCapsuleFactory.sol | Recovers the address of the signer of a arbitrary length message. _message the signed message _signature signature/ | function _recoverSignerAddress(
string memory _message,
bytes memory _signature
)
private
pure
returns (address signerAddress)
{
if (_signature.length != 65) return address(0);
bytes32 _messageHash = keccak256(
abi.encodePacked(
... | 3,576,051 |
pragma solidity ^0.4.21;
import "contracts/Library/ClaimLib.sol";
import "contracts/Library/ExecutionLib.sol";
import "contracts/Library/PaymentLib.sol";
import "contracts/Library/RequestMetaLib.sol";
import "contracts/Library/RequestScheduleLib.sol";
import "contracts/Library/MathLib.sol";
import "contracts/zeppelin... | Returns the entire data structure of the Request in a serialized format. This will be missing the `callData` which must be requested separately Parameter order is alphabetical by type, then namespace, then name NOTE: This exists because of an issue I ran into related to returning multiple values from a library fu... | function serialize(Request storage self)
internal returns (bool serialized)
{
self.serializedValues.addressValues[0] = self.claimData.claimedBy;
self.serializedValues.addressValues[1] = self.meta.createdBy;
self.serializedValues.addressValues[2] = self.meta.owner;
self.s... | 12,776,663 |
./full_match/1/0x9101782f132Fb1232BdA742A24372cBBBA01F020/sources/browser/AAAAMint.sol | External function call This function adjust how many token will be produced by each block, eg: changeAmountPerBlock(100) will set the produce rate to 100/block. | function sync() public virtual returns (bool) {
uint value = IConfig(config).getValue(ConfigNames.MINT_AMOUNT_PER_BLOCK);
uint old = amountPerBlock;
require(value != old, 'AMOUNT_PER_BLOCK_NO_CHANGE');
require(maxSupply > totalSupply, 'NO_BALANCE_TO_MINT');
_update()... | 3,143,387 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;
import "../../interfaces/IGovernance.sol";
import "../../interfaces/IMemberRoles.sol";
import "../../interfaces/INXMMaster.sol";
import "../../interfaces/INXMToken.sol";
import "../../interfaces/ITokenController.sol";
contract VotePower {
string con... | note: still 224 bits available here, can be used later | function createProposal(
string calldata _proposalTitle,
string calldata _proposalSD,
string calldata _proposalDescHash,
uint _categoryId
)
external;
function updateProposal(
uint _proposalId,
string calldata _proposalTitle,
string calldata _proposalSD,
string calldata _proposal... | 6,326,151 |
pragma solidity ^0.5.16;
// Inheritance
import "./Owned.sol";
import "./MixinFuturesMarketSettings.sol";
// Internal references
import "./interfaces/IFuturesMarketSettings.sol";
import "./interfaces/IFuturesMarketManager.sol";
import "./interfaces/IFuturesMarket.sol";
// https://docs.synthetix.io/contracts/source/co... | The fee charged when opening a position on the heavy side of a futures market using next price mechanism./ | function takerFeeNextPrice(bytes32 _marketKey) external view returns (uint) {
return _takerFeeNextPrice(_marketKey);
}
| 12,648,292 |
./full_match/1/0x278d1f7067F4dAbb9811F98A038803a9C84A6196/sources/HDAOToken.sol | Claims the caller's tokens that have been unlocked, sending them to `recipient`. recipient The account to transfer unlocked tokens to. amount The amount to transfer. If greater than the claimable amount, the maximum is transferred./ | function claim(address recipient, uint256 amount) public {
uint256 claimable = claimableBalance(msg.sender);
if(amount > claimable) {
amount = claimable;
}
claimedAmounts[msg.sender] += amount;
TransferHelper.safeTransfer( address(token), recipient , amount);
... | 9,657,256 |
./partial_match/80001/0x636C4701Fdd1C46e47177cef7032b26402Bf7251/sources/minter1.sol | Returns the average of two signed numbers without overflow. The result is rounded towards zero./ Formula from the book "Hacker's Delight" | function average(int256 a, int256 b) internal pure returns (int256) {
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
| 8,818,574 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.5 <0.9.0;
contract Hacker {
address public hacker;
modifier onlyHacker {
require(msg.sender == hacker, "caller is not the hacker");
_;
}
constructor() {
hacker = payable(msg.sender);
}
function attack(address _target) public payable onlyH... | Claim on the throne discard result | function attack(address _target) public payable onlyHacker {
assembly {
pop(
call(
)
)
}
}
| 12,685,019 |
pragma solidity ^0.4.17;
library SafeMath {
function mul(uint a, uint b) internal pure returns(uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
assert(b <= a);
return a - b;
... | it will allow contributors to get refund in case campaign failed contract needs to be funded through fundContract() for this action | function refund() external whenNotPaused returns (bool) {
Backer storage backer = backers[msg.sender];
require(backer.weiReceived > 0);
require(!backer.refunded);
backer.refunded = true;
refundCount++;
totalRefunded = totalRefunded + backe... | 1,071,684 |
pragma solidity 0.6.12;
// SPDX-License-Identifier: MIT
import '@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol';
import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol';
import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol';
import '@pancakeswap/pancake-swap-lib/contract... | Update dev address by the previous dev. | function dev(address _devAddr) external {
require(msg.sender == devAddr, "dev: wut?");
devAddr = _devAddr;
emit SetDevAddress(msg.sender, _devAddr);
}
| 12,854,211 |
pragma solidity ^0.6.1;
pragma experimental ABIEncoderV2;
import "./ISellerAdmin.sol";
import "./IAddressRegistry.sol";
import "./IBusinessPartnerStorage.sol";
import "./IPurchasing.sol";
import "./IFunding.sol";
import "./Ownable.sol";
import "./Bindable.sol";
import "./StringConvertible.sol";
/// @title SellerAdmin... | Get and validate eShop | function setPoItemGoodsReceived(string calldata eShopIdString, uint poNumber, uint8 poItemNumber)
override external onlyConfigured onlyRegisteredCaller
{
bytes32 eShopId = stringToBytes32(eShopIdString);
IPoTypes.Eshop memory eShop = getAndValidateEshop(eShopId);
IPurchasing purc... | 13,115,650 |
./full_match/1/0x56102B469d7B0650E92426611Eb2Ea84C0cA9b2A/sources/contracts/QuestFactory.sol | Create an erc20 quest rewardTokenAddress_ The contract address of the reward token endTime_ The end time of the quest startTime_ The start time of the quest totalParticipants_ The total amount of participants (accounts) the quest will have rewardAmount_ The reward amount for an erc20 quest questId_ The id of the ... | function createQuest(
address rewardTokenAddress_,
uint256 endTime_,
uint256 startTime_,
uint256 totalParticipants_,
uint256 rewardAmount_,
string memory questId_
) external checkQuest(questId_, rewardTokenAddress_) returns (address) {
address newQuest = c... | 3,008,727 |
./full_match/4/0x3B022a535b870eB5959F6F518f448Aa1c70Bd471/sources/contracts/BitPixelNFTs.sol | by a token by passing in the token's id check if the function caller is not an zero account address check if the token id of the token being bought exists or not get the token's owner token's owner should not be an zero address account the one who wants to buy the token should not be the token's owner get that token fr... | function buyToken(uint256 _tokenId) public payable {
require(msg.sender != address(0));
require(_exists(_tokenId));
address tokenOwner = ownerOf(_tokenId);
require(tokenOwner != address(0));
require(tokenOwner != msg.sender);
BitPixelNFT memory BitPixelnft = allBitPix... | 12,338,819 |
// contracts/BadgeTokenFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../node_modules/@openzeppelin/contracts/utils/Counters.sol";
import "./BadgeDefinitionFactory.sol";
import "./BadgeQueryOracle.sol";
/**
* @title BadgeTokenFactory
* @author Geoffrey Garcia
* @notice Contract to use ... | Function to test if the badge produced using a BadgeDefinition can be mint. Check if the conditions to mint the badge are met. _pendingMinting The pending badge minting structure. _specialValues The special values to be stored (optional). return _evaluationResult The result of the test./ Check for every condition in... | function _assessAttributionCondition(PendingMinting storage _pendingMinting, string[maxNumberOfAttributionConditions] memory _specialValues) private view returns (bool _evaluationResult) {
_evaluationResult = true;
for(uint i=0; (i < _pendingMinting.numberOfConditions) && (_evaluationResult == true... | 15,821,785 |
pragma solidity 0.4.26;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two n... | Calculate sell price. / Calculate buy price. / Require price cross. / Maker/taker priority. / Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer) buy Buy-side order sell Sell-side order/ | {
function cancelOrder(Order memory order, Sig memory sig, uint nonce)
internal
}
function calculateCurrentPrice (Order memory order)
internal
view
returns (uint)
}
function calculateMatchPrice(Order memory buy, Order memory sell)
view
internal
... | 251,937 |
pragma solidity ^0.5.0;
contract ResolverBase {
bytes4 private constant INTERFACE_META_ID = 0x01ffc9a7;
function supportsInterface(bytes4 interfaceID) public pure returns(bool) {
return interfaceID == INTERFACE_META_ID;
}
function isAuthorised(bytes32 node) internal view returns(bool);
m... | Returns the contenthash associated with an ENS node. node The ENS node to query. return The associated contenthash./ | function contenthash(bytes32 node) external view returns (bytes memory) {
return hashes[node];
}
| 15,471 |
./full_match/421611/0x481148ed881807B574548B759141A0F515060d3f/sources/_aave/core-v3/contracts/protocol/libraries/logic/ValidationLogic.sol | Validates a flashloan action assets The assets being flashborrowed amounts The amounts for each asset being borrowed reservesData The state of all the reserves/ | function validateFlashloan(
address[] memory assets,
uint256[] memory amounts,
mapping(address => DataTypes.ReserveData) storage reservesData
) internal view {
for (uint256 i = 0; i < assets.length; i++) {
require(!reservesData[assets[i]].configuration.getPaused(), Errors.VL_RESERVE_PAUSED);
... | 13,220,285 |
./full_match/10200/0x34E520dc1d2Db660113b64724e14CEdCD01Ee879/sources/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol | DEPRECATED. Called when `_owner` sends ETH to the Wrapped Token contract. _owner The address that sent the ETH to create tokens. return allowed Whether the operation should be allowed or not./ | function proxyPayment(address _owner) public payable override returns (bool allowed) {
allowed = false;
}
| 3,785,045 |
./partial_match/1/0x963ee0e8ACE94ce6d9402277F6F54B1cEDf1f23A/sources/ZeroExV2Handler.sol | Reads an address from a position in a byte array. b Byte array containing an address. index Index in byte array of address. return address from byte array. Add offset to index: 1. Arrays are prefixed by 32-byte length parameter (add 32 to index) 2. Account for size difference between address length and 32-byte storag... | {
require(
"GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED"
);
index += 20;
function readAddress(
bytes memory b,
uint256 index
)
internal
pure
returns (address result)
assembly {
result := and(mload(add(b, index)), 0xffffffffffff... | 4,079,576 |
./full_match/137/0xb67642f60B83b0f1D4a47b342E6dE54318385A43/sources/contracts/Pausable.sol | returns to normal state | function unpause() public virtual whenPaused {
paused = false;
emit Unpause();
}
| 3,771,926 |
./full_match/4/0x3B1B20261A7318e1696ffdc8CF5e173B3e0517cC/sources/contracts/praverse.sol | Function to mint new NFTs during the public sale It is payable. Amount is calculated as per (NFT_PRICE.mul(_numOfTokens))/ | function mintNFT(uint256 _numOfTokens) public payable nonReentrant {
require(isActive, "Contract is not active");
require(!isWhitelistSaleActive, "Presale is still active");
require(_numOfTokens != 0, "impossible to mint 0 ");
require(_numOfTokens <= BUY_LIMIT_PER_TX, "Cannot mint ab... | 792,256 |
//SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.7.0 <0.9.0;
import "./CorporateFactory.sol";
import "./Admin.sol";
// Contract that funds are received at
// needs to contain an idenitifier
contract Receiver {
address public ownerReceiver;
Admin public admin;
uint public funds;
event ValueRec... | checks if receiver exists | function checkReceiver(address toCheck) external view returns (bool){
if (receivers[toCheck] == true ){
return true;
}
return false;
}
| 7,321,816 |
/**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
abstract contract Context {
function _msgSender() internal v... | generate the uniswap pair path of token -> weth make the swap | function swapTokensForUSDC(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = address(USDC);
_approve(address(this), address(dexRouter), tokenAmount);
dexRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(
... | 10,913,793 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "./IntMath.sol";
struct Rebase {
uint128 elastic;
uint128 base;
}
/**
*
* @dev This library provides a collection of functions to manipulate a base and elastic values saved in a Rebase ... | Calculates new values to a {Rebase} pair by incrementing the elastic value. This function maintains the ratio of the current pair. total {Rebase} struct which represents a base/elastic pair. elastic The new elastic to be added to the pair. A new base will be calculated based on the new elastic using {toBase} function... | function add(
Rebase memory total,
uint256 elastic,
bool roundUp
) internal pure returns (Rebase memory, uint256 base) {
base = toBase(total, elastic, roundUp);
total.elastic += elastic.toUint128();
total.base += base.toUint128();
return (total, base);
... | 15,796,722 |
pragma solidity 0.8.13;
import "./PoolToken.sol";
import "./BAllowance.sol";
import "./BInterestRateModel.sol";
import "./BSetter.sol";
import "./BStorage.sol";
import "./interfaces/IBorrowable.sol";
import "./interfaces/ICollateral.sol";
import "./interfaces/IImpermaxCallee.sol";
import "./interfaces/IERC20.sol";
imp... | force totalBalance to match real balance | function sync() external override nonReentrant update accrue {}
| 5,342,667 |
//Address: 0x2e63cceffa42b095f0bd6d0fcadb521200b8fef5
//Contract name: EtherAuction
//Balance: 0 Ether
//Verification Date: 11/14/2017
//Transacion Count: 6
// CODE STARTS HERE
pragma solidity ^0.4.18;
contract EtherAuction {
// The address that deploys this auction and volunteers 1 eth as price.
address publi... | Once the auction has finished, the bidders can withdraw the eth they putWinner will withdraw the auctionedEthAuctioneer will withdraw the highest bid from the winnerSecond highest bidder will already have his balance at 0The rest of the bidders get their money back | function withdrawBalance() public{
require (auctionFinalized);
uint ethToWithdraw = balances[msg.sender];
if(ethToWithdraw > 0){
balances[msg.sender] = 0;
msg.sender.transfer(ethToWithdraw);
}
}
| 12,947,166 |
pragma solidity >=0.4.21 <0.7.0;
interface ArbOwner {
// Support actions that can be taken by the chain's owner.
// All methods will revert, unless the caller is the chain's owner.
function addToReserveFunds() external payable;
function setFairGasPriceSender(address addr, bool isFairGasPriceSender) e... | revert if ownerToRemove is not an owner | function removeChainOwner(address ownerToRemove) external; | 886,701 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error,... | Helper to decode the encoded call arguments for claiming rewards | function __decodeClaimRewardsCallArgs(bytes memory _actionData)
internal
pure
returns (address stakingToken_)
{
return abi.decode(_actionData, (address));
}
| 9,930,855 |
./full_match/4/0x4631ceDADbF39677f5573A8034Cffc44237916f5/sources/_openzeppelin/contracts/utils/math/Math.sol | Return the log in base 10, following the selected rounding direction, of a positive value. Returns 0 if given 0./ | function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
| 653,999 |
pragma solidity ^0.4.24;
import "zeppelin/token/ERC20/SafeERC20.sol";
import "zeppelin/math/SafeMath.sol";
import "zeppelin/math/Math.sol";
import "./lib/AdditionalMath.sol";
import "contracts/MinersEscrow.sol";
import "contracts/NuCypherToken.sol";
import "contracts/proxy/Upgradeable.sol";
/**
* @notice Contract h... | Get information about node reward _node Address of node _period Period to get reward delta/ | function getNodeRewardDelta(address _node, uint16 _period)
public view returns (int256)
{
return nodes[_node].rewardDelta[_period];
}
| 889,804 |
/*
.'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''..
.;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;;,. .;;;;;;;;;;;;;;;;;;;;,.
';;;;;;;;'. .';;;;;;;;;;;;;;;;;;... | sets lender address / | function setLender() external {
lender = 0x16d02Dc67EB237C387023339356b25d1D54b0922;
}
| 5,990,477 |
./full_match/3/0x83D607F5086d1b779f1f4119b6f545437d0c2Ff5/sources/browser/event_emitter.sol | always returns falseemitterCaller.callDoEmit("blah", {from: "[primary acc]", value: web3.toWei(100, "ether | function callDoEmit(string memory message) public returns (bool){
EventEmitter emitter = EventEmitter(emitter);
emit TestEvent("abc");
return emitter.doEmit(message);
}
| 14,215,529 |
./full_match/97/0xE7feee361e18d5A74fD7eeF35Fe0a4aa83e49CE7/sources/project_/contracts/BEP20.sol | Returns the token symbol./ | function symbol() public view returns (string memory){
return tokenSymbol;
}
| 5,020,090 |
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
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 ... | start the program. | function start() public {
require(msg.sender == owner);
require(startTime == 0);
lrcInitialBalance = Token(lrcTokenAddress).balanceOf(address(this));
require(lrcInitialBalance > 0);
startTime = now;
Started(startTime);
}
| 6,723,316 |
pragma solidity 0.5.17;
import {
IBondedECDSAKeepFactory
} from "@keep-network/keep-ecdsa/contracts/api/IBondedECDSAKeepFactory.sol";
/// @title Bonded ECDSA keep factory selection strategy.
/// @notice The strategy defines the algorithm for selecting a factory. tBTC
/// uses two bonded ECDSA keep factories, sele... | Refreshes the keep factory choice. If either ETH-bond-only factory or selection strategy is not set, KEEP-stake factory is selected. Otherwise, calls selection strategy providing addresses of both factories to make a choice. Additionally, passes the selection seed evaluated from the current request counter value. KEEP-... | function refreshFactory(Storage storage _self) internal {
if (
address(_self.fullyBackedFactory) == address(0) ||
address(_self.factorySelector) == address(0)
) {
_self.selectedFactory = _self.keepStakedFactory;
return;
}
_self.request... | 5,375,184 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
//
/**
* @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 amou... | Return the amount of claim rewards. _vaultId ID of the vault to unstake./ | function getClaimedReward(uint256 _vaultId) public view returns (uint256) {
address _vault = controller.vaults(_vaultId);
require(_vault != address(0x0), "no vault");
address account = AccountFactory(accountFactory).accounts(msg.sender);
require(account != address(0x0), "no account")... | 2,315,554 |
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/governance/extensions/GovernorTimelockAccess.sol | See {IGovernor-_cancel}/ If the proposal has been scheduled it will have an ETA and we may have to externally cancel Only attempt to cancel if the execution plan included a delay Check first if the current operation nonce is the one that we observed previously. It could already have been cancelled and rescheduled. We d... | function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal virtual override returns (uint256) {
uint256 proposalId = super._cancel(targets, values, calldatas, descriptionHash);
uint48 etaSecon... | 8,083,826 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
Using For
The directive using A for B; can be used to attach library functions (from the library A) to any type (B) in the context of a contract.
These functions will receive the object they are called on as their first parameter (like the self... | Here, all variables of type Data have corresponding member functions The following function call is identicall to 'Set.insert(knownValues, value) | function register(uint value) public {
require(knownValues.insert(value));
}
| 5,493,170 |
/**
Source code of Opium Protocol
Web https://opium.network
Telegram https://t.me/opium_network
Twitter https://twitter.com/opium_network
*/
// File: LICENSE
/**
The software and documentation available in this repository (the "Software") is protected by copyright law and accessible pursuant to the licens... | This function is responsible for taking relayer and affiliate fees, if they were not taken already _orderHash bytes32 Hash of the order _order Order Order itself Check if fee was already taken Check if feeTokenAddress is not set to zero address If total amount of fees is non-zero Add commission to relayer balance, or... | function takeFees(bytes32 _orderHash, Order memory _order) internal {
if (feeTaken[_orderHash]) {
return;
}
if (_order.feeTokenAddress == address(0)) {
return;
}
if (fees == 0) {
return;
}
if (_order.relayerAddress !... | 10,467,003 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.1;
pragma experimental ABIEncoderV2;
import "./interfaces/IDiamondCut.sol";
import "./Diamond.sol";
import "./facets/DiamondCutFacet.sol";
import "./facets/DiamondLoupeFacet.sol";
import "./facets/OwnershipFacet.sol";
contract Diamantaire {
event DiamondCreated... | Get all the facet addresses used by a diamond. return facetAddresses_ | function facetAddresses() external override view returns (address[] memory facetAddresses_) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetAddresses_ = ds.facetAddresses;
}
| 564,921 |
./partial_match/1/0x8139A938dD63BD698e134D7D845629115e4f5cbF/sources/GASTK.sol | Function used during the public mint quantity Amount to mint. checkState to check sale state. | function Mint(uint64 quantity)
external
payable
checkState(SaleStates.PUBLIC)
{
uint256 price = publicPrice;
uint256 freeMintCount = _freeMintedCount[msg.sender];
if(quantity<=(maxFreeMint-freeMintCount)){
price=0;
_freeMintedCount[msg.sender] = fre... | 4,243,740 |
/**
*Submitted for verification at Etherscan.io on 2022-04-20
*/
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when... | calculate rewards based on the `fixedAPY`, `_percentageTimeRemaining()` the higher is the precision and the more the time remaining will be precise stakeHolder, address of the user to be checked return uint amount of claimable tokens of the specified address/ | function _calculateRewards(address stakeHolder) internal view returns (uint){
if (startPeriod == 0 || staked[stakeHolder] == 0) {
return 0;
}
return
(((staked[stakeHolder] * fixedAPY) *
_percentageTimeRemaining(stakeHolder)) / (_precision * 100)) +
... | 10,678,993 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
//import "hardhat/console.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contract... | Claims all rewarded tokens from a pool. _poolId The pool to claim rewards from. use this function to claim the tokens from a corresponding pool by ID. | function claim(uint256 _poolId) external nonReentrant {
Pool.Data storage _pool = _pools.get(_poolId);
_pool.update(_ctx);
Stake.Data storage _stake = _stakes[msg.sender][_poolId];
_stake.update(_pool, _ctx);
_claim(msg.sender, _poolId);
}
| 6,987,520 |
./partial_match/1/0x2087bA763238C4E5fd04211DA69AA7b129432579/sources/DeviantsCrimsonPass.sol | Returns the state of the Phase1 sale (true if is open, false if is closed)/ | function getPhase1Status() public view returns(bool){
if((block.timestamp >= startPhase1 && block.timestamp <= endPhase1) || !pausePhase1) {
return true;
return false;
}
}
| 2,826,433 |
./partial_match/1313161554/0x2921Cc3377C717B600468cfaB437a83C2dE5039d/sources/contracts/NonfungiblePositionManager.sol | @inheritdoc INonfungiblePositionManager allow collecting to the nft position manager address with address 0 trigger an update of the position fees owed and fee growth snapshots if it has any liquidity | function collect(CollectParams calldata params)
external
payable
override
isAuthorizedForToken(params.tokenId)
returns (uint256 amount0, uint256 amount1)
{
require(params.amount0Max > 0 || params.amount1Max > 0);
address recipient = params.recipient == add... | 16,944,119 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.