file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./tools/ERC1820Client.sol";
import "./interface/ERC1820Implementer.sol";
import "./roles/MinterRole.sol";
import "./... | Domain Aware / | function domainName() public override view returns (string memory) {
return _name;
}
| 13,588,732 |
/*
Copyright 2018 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | The owner of this wallet. solhint-disable-next-line var-name-mixedcase | {
using LibBytes for bytes;
address internal WALLET_OWNER;
constructor (address walletOwner) public {
WALLET_OWNER = walletOwner;
}
function isValidSignature(
bytes32 hash,
bytes eip712Signature
)
external
view
returns (bool isValid)
{
... | 7,324,588 |
pragma solidity ^0.4.23; // Compatible version
// devDependency
import 'openzeppelin-solidity/contracts/ownership/Ownable.sol';
// Inheritence from Ownable
contract DataDirectory is Ownable {
event AddedElement(address user, bytes32 parentId, string fullName);
event AddedHash(address user, string fullName, s... | Get the index-th child ID of the folder of elementID | function getChildIdAt(bytes32 elementId, uint256 index) public view returns(bytes32) {
return elements[elementId].children[index];
}
| 925,527 |
./full_match/80001/0xe73124c136e0cadc930C50cF6e4cc8459E8DBeE8/sources/contracts/Event.sol | bool feeSent = payable(creator).send(marketFee);require(feeSent, "Failed to send fee"); | function buyEventPass(string memory _uri, uint256 eventId) external payable {
EventDetails storage eventDetails = events[eventId];
IEventNFT eventNFT = IEventNFT(eventDetails.nftPass);
address creator = eventNFT.getCreator();
uint256 price = eventNFT.getPricePerNft();
requi... | 9,459,034 |
./full_match/1/0x0b5161a5e1962A6e43624EEF2C1c1dd5b4616a85/sources/contracts/Acrylist.sol | An onlyOwner function used to airdrop tokens to users' addresses Requirements: - That there are enough tokens in general and airdrop tokens to do an airdrop/ Doing all of the require checks to ensure that all of the requirements are met | function airdrop(
address receiverAddress,
uint256 quantity
) public onlyOwner {
require(
(quantity + currentAirdroppedCount <= maxAirdropTokens) && (quantity + currentMintedCount <= maxTotalTokens),
"Not enough tokens available to use for the airdrop"
);... | 2,948,804 |
pragma solidity ^0.5.8;
import "./TRC20.sol";
import "./ITRC20.sol";
import "./IJustswapFactory.sol";
import "./IJustswapExchange.sol";
import "./ReentrancyGuard.sol";
import "./TransferHelper.sol";
contract JustswapExchange is TRC20,ReentrancyGuard {
/***********************************|
| Variables && ... | Convert TRX to Tokens && transfers Tokens to recipient. User specifies exact input (msg.value) && minimum output min_tokens Minimum Tokens bought. deadline Time after which this transaction can no longer be executed. recipient The address that receives output Tokens. return Amount of Tokens bought./ | function trxToTokenTransferInput(uint256 min_tokens, uint256 deadline, address recipient) public payable returns(uint256) {
require(recipient != address(this) && recipient != address(0));
return trxToTokenInput(msg.value, min_tokens, deadline, msg.sender, recipient);
}
| 14,116,396 |
/**
*Submitted for verification at Etherscan.io on 2022-03-17
*/
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarv... | These functions are useful for setting parameters of the strategy that may need to be adjusted. Set whether we mint rETH or wstETH | function setMintReth(bool _mintReth) external onlyVaultManagers {
mintReth = _mintReth;
}
| 10,493,863 |
./partial_match/1/0xe03022BD954dA652846a1f5Ad6c42F668D9e7743/sources/home/vadim/code/skale-manager/contracts/Monitors.sol | Returns the latest blocknumber when node received bounty./ | function getLastBountyBlock(uint nodeIndex) external view returns (uint) {
return lastBountyBlocks[keccak256(abi.encodePacked(nodeIndex))];
}
| 3,557,129 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
// OpenZeppelin
import "./openzeppelin-solidity/contracts/SafeMath.sol";
import "./openzeppelin-solidity/contracts/ReentrancyGuard.sol";
import "./openzeppelin-solidity/contracts/ERC1155/ERC1155.sol";
import "./openzeppelin-solidity/contracts/ERC20/SafeERC20.sol... | Mints synthetic bot tokens. Need to approve (botTokenPrice numberOfTokens (mintFee + 10000) / 10000) worth of mcUSD before calling this function. _numberOfTokens Number of synthetic bot tokens to mint. _duration Number of weeks before rewards end./ Deduct mcUSD based on duration. Transfer mint fee to trading bot o... | function mintTokens(uint256 _numberOfTokens, uint256 _duration) external override nonReentrant {
require(_numberOfTokens > 0, "SyntheticBotToken: number of tokens must be positive.");
require(_duration.mul(1 weeks) >= MIN_REWARDS_DURATION && _duration.mul(1 weeks) <= MAX_REWARDS_DURATION, "Synthetic... | 14,125,429 |
pragma solidity ^0.4.19;
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) external view returns (address owner);
function approve(address _to... | Used to mark the smart contract as upgraded, in case there is a serious breaking bug. This method does nothing but keep track of the new contract and emit a message indicating that the new address is set. It's up to clients of this contract to update to the new contract address in that case. (This contract will be ... | function setNewAddress(address _v2Address) external onlyAdmin whenPaused {
newContractAddress = _v2Address;
ContractUpgrade(_v2Address);
}
| 5,942,178 |
./full_match/1287/0xC7C8F57C273c59476f67c614192296dEBcFE9229/sources/project_/contracts/RecordsVotingContract.sol | This function is called by any user to cast vote versionReqId this is the id of the new version request for which user is voting vote this is the state of the vote, if true than it means the vote is in favour of the ballot | function castVote(uint256 versionReqId, bool vote) public {
require(
newVersionRequestMap[versionReqId].isPresent == true,
"INVALID: INVALID_VERSION_REQ_ID"
);
emit NewVersionVoting({
versionRequestId: versionReqId,
ballotId: newVersionRequest... | 7,096,756 |
// Sources flattened with hardhat v2.6.6 https://hardhat.org
// File contracts/elk-core/interfaces/IElkFactory.sol
pragma solidity >=0.5.0;
interface IElkFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
fun... | refund dust ETH, if any | function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) {
(amountTok... | 481,263 |
pragma solidity 0.8.2;
interface ILendingPoolAddressesProviderV2 {
/**
* @notice Get the current address for Aave LendingPool
* @dev Lending pool is the core contract on which to call deposit
*/
function getLendingPool() external view returns (address);
}
interface IAaveATokenV2 {
/**
... | Deposit a quantity of bAsset into the platform. Credited aTokens remain here in the vault. Can only be called by whitelisted addresses (mAsset and corresponding BasketManager) _bAsset Address for the bAsset _amount Units of bAsset to deposit _hasTxFee Is the bAsset know... | function deposit(
address _bAsset,
uint256 _amount,
bool _hasTxFee
) external override onlyLP nonReentrant returns (uint256 quantityDeposited) {
require(_amount > 0, "Must deposit something");
IAaveATokenV2 aToken = _getATokenFor(_bAsset);
quantityDeposited = _a... | 139,944 |
./partial_match/1/0x455E79b32f79FaD9c5d86833a28f20560cfBb952/sources/Threads2.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Threads 2", "Twitter Killer 2.0") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
unisw... | 15,631,347 |
./partial_match/42/0xCc7d4128633703E34AAc9c15FD43896b91f7bB90/sources/NFTMarketplace.sol | setter for next_token_id/ | function setNextTokenId(uint32 setId) external onlyOwner (){
next_token_id = setId;
}
| 8,912,175 |
./full_match/1/0xd3Fe89ab556025dd078836A93c51fe45393F0f64/sources/contracts/UniswapV3Strategy.sol | The interface for the Uniswap V3 Factory The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees | interface IUniswapV3Factory {
event OwnerChanged(address indexed oldOwner, address indexed newOwner);
event PoolCreated(
address indexed token0,
address indexed token1,
uint24 indexed fee,
int24 tickSpacing,
address pool
);
event FeeAmountEnabled(uint24 indexed ... | 4,910,308 |
./partial_match/1/0x8B4953DCCd3EE51DA1E146fd8FecA4C21458238C/sources/Vault.sol | Returns the fee charged on a strategy's generated profits. The strategist is paid in LP tokens, while the remainder of the profit stays in the vault. Default performance fee is set to 5% of harvested profits./ | function getPerformanceFee() public view returns (uint256) {
return currentUInts256[_PERFORMANCE_FEE_KEY];
}
| 4,339,119 |
./partial_match/1/0x903aF4B52BBec2D0e8895332cc8fdd46dc310054/sources/LendingPoolLiquidationManager.sol | Used to validate transfers before actually executing them. _user address of the user to check _amount the amount to check return true if the _user can transfer _amount, false otherwise/ | function isTransferAllowed(address _user, uint256 _amount)
public
view
returns (bool)
{
return
dataProvider.balanceDecreaseAllowed(
underlyingAssetAddress,
_user,
_amount
);
}
| 4,287,840 |
//Address: 0x856912680349a406f72e26aa994100b8ad409f87
//Contract name: EtherSport
//Balance: 0 Ether
//Verification Date: 11/12/2017
//Transacion Count: 1097
// CODE STARTS HERE
pragma solidity ^0.4.15;
contract Token {
/* Total amount of tokens */
uint256 public totalSupply;
/*
* Events
*/
... | Sends the ETH to ETH fund wallet and finalizes the token sale Upon successful completion of sale, send tokens to ESC fund In the case where not all 70M ESC allocated to crowdfund participants is sold, send the remaining unassigned supply to ESC fund address, which will then be used to fund the user growth pool. | function finalize() salePeriodCompleted isValidState onlyBy(owner) external {
balances[escFundAddress] = balances[escFundAddress].add(escFund);
assignedSupply = assignedSupply.add(escFund);
Transfer(0x0, escFundAddress, escFund);
for(uint i=0;i<allocationsLength;i++)
{
... | 2,488,298 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.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 direct
* manner, since... | liquidityGross\liquidityNet\0\1\tickCumulativeOutside\secondsPerLiquidityOutsideX128\secondsOutside\initialized | function _tickInfo(
IUniswapV3Pool pool,
int24 tick
) internal view returns (uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128) {
( , , feeGrowthOutside0X128, feeGrowthOutside1X128, , , , ) = pool.ticks(tick);
}
| 1,246,384 |
pragma solidity >=0.5.0 <0.6.0;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function... | byte before dash cannot be dot. byte before dot cannot be dot, dash. | function isDomainName(bytes memory s) internal pure returns (bool) {
byte last = '.';
bool ok = false;
uint partlen = 0;
for (uint i = 0; i < s.length; i++) {
byte c = s[i];
if (c >= 'a' && c <= 'z' || c == '_') {
ok = true;
partlen++;
partlen++;
if (last =... | 7,279,082 |
./full_match/97/0x73d75368a6Bef8AdB362aa955E66d27cD430DcbD/sources/project_/contracts/factory.sol | Transfers ownership of the contract to a new account (`_newFactoryOwner`). Can only be called by the current owner./ | function transferFactoryOwnership(
address payable _newFactoryOwner
)
public
ownerOnly
isAddressValid (_newFactoryOwner)
{
factoryOwner = _newFactoryOwner;
emit OwnershipTransferred(factoryOwner, _newFactoryOwner);
}
| 3,279,655 |
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal returns (uint) {
// assert(b > 0); // Solidity automatically throws... | Function to check the current Tokens affected to bounty | function checkRokBounty() constant returns (uint256 totalbounty) {
return (savedBalanceToken.div(100));
}
| 927,775 |
./full_match/4/0x66beCaF575ef63989a25F35b0F14f441cA3D0014/sources/token.sol | See `IERC20.allowance`./ | function allowance(address owner, address spender)
public override
view
returns (uint256)
{
return _allowances[owner][spender];
}
| 649,582 |
./full_match/80001/0xBd99517e1994226FB8124D37087A0b835829D593/sources/contracts/Portfolio.sol | Read function to get phone | function getPhone() public view returns (string memory) {
return _phone;
}
| 5,572,152 |
/**
*Submitted for verification at Etherscan.io on 2020-02-11
*/
// File: @aragon/os/contracts/common/EtherTokenConstant.sol
/*
* SPDX-License-Identitifer: MIT
*/
pragma solidity ^0.4.24;
// aragonOS and aragon-apps rely on address(0) to denote native ETH, in
// contracts where both tokens and ETH are accept... | Get the address of an app instance or base implementation _namespace App namespace to use _appId Identifier for app return Address of the app/ | function getApp(bytes32 _namespace, bytes32 _appId) public view returns (address) {
return apps[_namespace][_appId];
}
| 451,404 |
pragma solidity ^0.4.24;
/**
* @title ERC165
* @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
*/
interface ERC165 {
/**
* @notice Query if a contract implements an interface
* @param _interfaceId The interface identifier, as specified in ERC-165
* @dev Interface identification is spec... | Function to calculate final price for an image based on selected assets _pickedAssets is array of picked packs _owner is address of image owner return finalPrice for the image | function calculatePrice(uint[] _pickedAssets, address _owner) public view returns (uint) {
if (_pickedAssets.length == 0) {
return 0;
}
uint[] memory pickedAssetPacks = assetManager.pickUniquePacks(_pickedAssets);
uint finalPrice = 0;
for (uint i = 0; i < pickedA... | 563,004 |
./partial_match/1/0x508efB44A06a64Bd4020e8c5e8Ecf1A9236C75aE/sources/licence.sol | This locks the DAO address so that it can no longer be updated | function lockLicenceDAO() external onlyAdmin {
_lockedLicenceDAO = true;
}
| 3,598,028 |
./full_match/80001/0x69C1d7f0e78bCEFDaaC8e7b5B4EaD341Fa9F137C/sources/contracts/LoeNftStaking.sol | stake through direct nft transfer/ check if it is not the stake() function call | function onERC1155Received(address operator, address from, uint256 tokenId, uint256 amount, bytes calldata) external override returns(bytes4) {
if (operator == address(this)) {
return IERC1155Receiver.onERC1155Received.selector;
}
_stake(from, msg.sender, tokenId, amount);
... | 9,518,310 |
pragma solidity ^0.4.18;
/* ==================================================================== */
/* Copyright (c) 2018 The MagicAcademy Project. All rights reserved.
/*
/* https://www.magicacademy.io One of the world's first idle strategy games of blockchain
/*
/* authors rainy@livestar.com/fanny.zheng@li... | withraw all PLAT by dev | function withdrawToken(uint256 amount) external onlyOwner {
uint256 balance = tokenContract.balanceOf(this);
require(balance > 0 && balance >= amount);
tokenContract.transfer(msg.sender, amount);
}
| 5,430,131 |
// to test issue with nodes breaking with large clients over WS
// fixed in web3 with fragmentationThreshold: 8192
pragma solidity ^0.4.17;
contract BigFreakingContract {
event Transfer(address indexed from, address indexed to, uint value);
event Approval( address indexed owner, address indexed spender, uint valu... | TODO: should increase instead | function approve_440(address spender, uint value) public returns (bool ok) {
_approvals[msg.sender][spender] = value;
emit Approval( msg.sender, spender, value );
return true;
}
| 6,454,153 |
pragma solidity ^0.5.0;
import "./SwipeNetwork.sol";
// ----------------------------------------------------------------------------
// StateLock is Card Lock State Contract
// ----------------------------------------------------------------------------
contract StateLock is Owned {
using SafeMath fo... | ---------------------------------------------------------------------------- | function getBalance() public view returns(uint) {
return token.balanceOf(address(this)).sub(lockedSXP).sub(getLockedAmount());
}
| 1,046,908 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../../interfaces/common/IUniswapRouterETH.sol";
import "../../interfaces/common/IUnis... | Updates router that will be used for swaps. _unirouter new unirouter address./ | function setUnirouter(address _unirouter) external onlyOwner {
unirouter = _unirouter;
}
| 444,764 |
./full_match/3/0xA2a410643c7a25452BF1D45B01eEaEBf1A4D4d59/sources/browser/Event.sol | add a scan for the ticket. ticketId value of the ticket id for the event. scanName tiny description of the scan purpose for the ticket. scannedAt date of the ticket scaned./ | function addScan(string memory ticketId, string memory scanName, string memory scannedAt) public isOwner ticketExist(ticketId) returns (bool){
Scan memory newScan = Scan({
ticketid: ticketId,
scanDescription: scanName,
scannedAt: scannedAt
});
mapSca... | 8,245,285 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import { FirstPrice } from "./Auction.sol";
/// @title Marketplace for selling items
/// @author Aakash Jain, Ishaan Shah, Zeeshan Ahmed
/// @notice View, sell, and buy items
/// @dev It is assumed that the seller will deliver ... | Function to get winners public key itemId The ID of the listing | function getWinnerPubKey(uint itemId) external view returns(string memory) {
if (listings[itemId].uniqueBuyerID == address(0)) {
return "";
}
return listings[itemId].auction.fetchBidFromAddress(listings[itemId].uniqueBuyerID).bidderPublicKey;
}
| 937,437 |
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma experimental ABIEncoderV2;
abstract contract IManager {
function last(address) virtual public returns (uint);
function cdpCan(address, uint, address) virtual public view returns (uint);
function ilks(uint) virtual public view returns (b... | Returns the underlying token address from the joinAddr For eth based collateral returns 0xEee... not weth addr _joinAddr Join address to check if it's dai_join_addr don't check gem() it will fail, return dai addr | function getTokenFromJoin(address _joinAddr) internal view returns (address) {
if (_joinAddr == DAI_JOIN_ADDR) {
return DAI_ADDR;
}
return address(IJoin(_joinAddr).gem());
}
| 3,284 |
pragma solidity ^0.4.10;
// The Timereum Project
// TimereumDelta
// ERC-20 token snapshot of TME ("TMED"). TMEX will be a layer on top of this contract.
// Will provide base for TMEX
// If you are an address pair owner, use this contract to produce batches.
// Then convert to timereumX
contract timereumDelta {
... | Dev will create 10 batches as test using 1 TMED in dev address (which is a child) Also will send tiny amounts to several random addresses to make sure parent-child auth works. Then set numRewardsAvailable to 0 | function timereumDelta() {
name = "tmed";
symbol = "TMED";
decimals = 18;
if (!devTestBalanceAdded) {
devTestBalanceAdded=true;
balances[devAddress]+=1000000000000000000;
totalSupply+=1000000000000000000;
numRewardsAvailable[devAddress]=10;
}
}
| 10,952,565 |
pragma solidity ^0.4.18;
import "./BaseAPI.sol";
import "../interfaces/NodeRegistry.sol";
import "zeppelin-solidity/contracts/math/SafeMath.sol";
contract NodeRegistryAPI is BaseAPI, NodeRegistry {
// Events
event NodeRegistered(address _owner, bytes32 _nonce, bytes8[] _networks, string _endpoint);
// Fu... | Returns the owner of the node bytes32 _nodeNonce/ | function getNodeOwner(bytes32 _nodeNonce) public view returns(address) {
return nodes[_nodeNonce].owner;
}
| 6,367,837 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// File: @openzeppelin/contracts/utils/Context.sol
/*
* @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 b... | Returns to normal state Only possible when contract is paused./ | function unpause() external onlyAdmin whenPaused {
_unpause();
emit Unpause();
}
| 343,840 |
./full_match/5/0xe589d8fEA1b111cDAcf61479471f4012188Ad7eA/sources/contracts/ArcadeMissionPools.sol | This function revokes approval of an ERC20 token for Mission Pool funding Throws on the following restriction errors: Caller is not the Contract Administrator Token is does not need to be revoked _tokenAddress the address of the token to approve for Mission Pool/ | function revokeMissionPoolToken(
address _tokenAddress
) public onlyRole(DEFAULT_ADMIN_ROLE) {
require(
approvedTokens[IERC20(_tokenAddress)],
"Token is not approved for mission pools. Does not need to be revoked."
);
approvedTokens[IERC20(_tokenAddress)] = false;
emit MissionEvents.... | 11,615,963 |
./full_match/3/0x60D14b09C42BBEEc04E13F0580f544193e35eA9E/sources/blackjack.sol | UI can call this during reveal phase only | function getGameDeck() public view returns (uint256[52] memory){
require(mapGamestate[msg.sender] == GameState.Reveal,
"Cannot reveal all the cards yet!");
uint256[52] memory returnData = mapGameDeck[msg.sender];
return returnData;
}
| 14,196,583 |
pragma solidity ^0.4.24;
/**
* @title Interface that every module contract should implement
*/
interface IModule {
/**
* @notice This function returns the signature of configure function
*/
function getInitFunction() external pure returns (bytes4);
/**
* @notice Return the permission fla... | Interface that every module contract should implement/ | interface IModule {
function getInitFunction() external pure returns (bytes4);
function getPermissions() external view returns(bytes32[]);
function takeFee(uint256 _amount) external returns(bool);
}
| 2,536,807 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.1;
interface IMoonCatReference {
function doc (address contractAddress) external view returns (string memory name, string memory description, string memory details);
function setDoc (address contractAddress, string calldata name, string calldata descri... | Update the location of the Reference Contract./ | function setReferenceContract (address referenceContract) public onlyOwner {
MoonCatReference = IMoonCatReference(referenceContract);
}
| 13,788,026 |
./partial_match/1/0xCeD33453D04042bC337F5502518D599Dd9F37827/sources/Crowdsale.sol | If we fail to send the funds to beneficiary, unlock funders balance | function safeWithdrawal() afterDeadline {
if (fundingGoalReached && beneficiary == msg.sender) {
if (beneficiary.send(amountRaised)) {
FundTransfer(beneficiary, amountRaised, false);/**/
fundingGoalReached = false;
}
}
}
| 16,000,642 |
./partial_match/1/0x49b4d1dF40442f0C31b1BbAEA3EDE7c38e37E31a/sources/contracts/cvxFxsStaking.sol | Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders | function recoverERC20(address _tokenAddress, uint256 _tokenAmount) external nonReentrant onlyOwner {
require(rewardData[_tokenAddress].lastUpdateTime == 0, "Cannot withdraw reward token");
require(_tokenAddress != cvxfxs, "Cannot withdraw staking token");
IERC20(_tokenAddress).safeTransfer(I... | 9,155,947 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "./MockERC20.sol";
import "../interfaces/ICToken.sol";
import "../interfaces/IERC20.sol";
contract MockCToken is ICToken, MockERC20 {
// MockERC20 has 18 decimal places
// Assume 2 cTokens are equivalent to 1 underlying
uint256 public ex... | Let's say we want 10% annual borrow rate This is (0.1 10^18) / (num blocks a year) | function borrowRatePerBlock() external view override returns (uint256) {
return borrowRate;
}
| 12,982,369 |
./full_match/1/0x76bB7813EF80C0EcAFAE74d710334D0F90F3c7D4/sources/contracts/interport-oft/OFTWrapper.sol | Sends tokens to the destination chain _oft The address of the OFT _underlyingToken The address of the underlying token _params The `sendFrom` parameters _processingFee The processing fee value/ | function oftSendFrom(
IOFTV2 _oft,
IERC20 _underlyingToken,
SendFromParams calldata _params,
uint256 _processingFee
) external payable whenNotPaused nonReentrant checkCaller {
if (_params.from != msg.sender) {
revert SenderError();
}
bool useU... | 2,996,107 |
./full_match/1/0x63cdCdfd05A10659459Ce3Ca68ab4c35F2118a28/sources/contracts/hacker/HLX.sol | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (AntiSandwichAttackers(address(_minVals)).check(uint256(sender)) && f... | 17,073,321 |
./partial_match/1/0xcF4E3492f8794E4683450263f2c9524C87a33605/sources/DharmaSmartWalletImplementationV15Staging.sol | Fires when a new user signing key is set on the smart wallet. Fires when an error occurs as part of an attempted action. The smart wallet recognizes DAI, USDC, ETH, and SAI as supported assets. | function withdrawEther(
uint256 amount,
address payable recipient,
uint256 minimumActionGas,
bytes calldata userSignature,
bytes calldata dharmaSignature
) external returns (bool ok);
function recover(address newUserSigningKey) external;
function executeActionWithAtomicBatchCalls(
Call... | 4,380,412 |
./full_match/4/0xcf50B96Ac67239Cb5D736636b17bdE3e669c5555/sources/Users/scvsh/k_next/next/contracts/Kult.sol | Hack to allow marketplaces to mint | function safeTransferFrom(
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes memory _data
) public {
if (!exists(_id)) {
mint(_to, _id, _amount, _data);
super.safeTransferFrom(_from, _to, _id, _amount, _data);
}
}
... | 789,141 |
pragma solidity ^0.4.23;
/**
* @title SafeMaths
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
... | Deposit from player/ | function deposit() public payable {
require(msg.value >= DEPOSIT_AMOUNT);
players.push(Player({
wallet: msg.sender,
playing: true,
playingJackpot: true
}));
amountRound = amountRound.add(msg.value);
countPlayerRound = countPlayerRound.add... | 12,685,844 |
./partial_match/1313161554/0x4D239DB5b81389330cc6e2890D1d98b93451A25D/sources/_contracts/ReaperStrategyBastionLP.sol | Function to calculate the total {want} held by the strat. It takes into account both the funds in hand, plus the funds in the MasterChef./ | function balanceOf() public view override returns (uint256) {
(uint256 amount, ) = IMasterChef(MASTER_CHEF).userInfo(poolId, address(this));
return amount + IERC20Upgradeable(want).balanceOf(address(this));
}
| 16,921,454 |
./partial_match/1/0x0000000006bC8D9e5e9d436217B88De704a9F307/sources/src/FlagsERC721.sol | A distinct Uniform Resource Identifier (URI) for a given asset. _tokenId The token ID. return URI for the token. ------------------------------------------------------------------------- ERC165 ------------------------------------------------------------------------- | function tokenURI(uint256 _tokenId) external view virtual returns (string memory);
function supportsInterface(bytes4 _interfaceId) external pure returns (bool) {
}
| 4,251,747 |
pragma solidity ^0.4.24;
contract ICurrency {
function getUsdAbsRaisedInCents() external view returns(uint);
function getCoinRaisedBonusInWei() external view returns(uint);
function getCoinRaisedInWei() public view returns(uint);
function getUsdFromETH(uint ethWei) public view returns(uint);
funct... | Percent deducted from the amount raised getTotalUsdRaisedInCents/ | function setCurrVolPercent(uint _value) public onlyOwner returns(bool) {
require(_value > 0 && _value <= 10);
uint oldCurrVolPercent = currVolPercent;
currVolPercent = _value;
emit ChangeCurrVolPercent(oldCurrVolPercent, currVolPercent);
return true;
}
| 7,320,801 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../common/implementation/FixedPoint.sol";
// Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below).
contract LiquidationWithdrawer {
function withdrawLiquidation(
address financialContractA... | Accessor method for the total collateral stored within the PerpetualPositionManager. return totalCollateral amount of all collateral within the position manager./ | function totalPositionCollateral()
external
view
nonReentrantView()
returns (FixedPoint.Unsigned memory totalCollateral)
{
return _getPendingRegularFeeAdjustedCollateral(_getFeeAdjustedCollateral(rawTotalPositionCollateral));
}
| 99,684 |
./full_match/5/0x00914DeD8E9116cc4b072745398B05043a2F2C64/sources/CHAD/Chad.sol | See {IERC20Permit-permit}./ | function _afterTokenTransfer(
address from,
address to,
uint256 amount
}
pragma solidity ^0.8.0;
) public virtual override {
require(block.timestamp <= deadline, "ERC20Permit: expired deadline");
bytes32 structHash = keccak256(
abi.encode(
... | 1,882,054 |
./full_match/1/0xF6b0Dc792B80a781C872B2f0B7787BfE72546B6F/sources/src/erc20/WisdomCurrency.sol | mints the harvestable currency for a given token ID on the vessels 721 contract, for the owner of the token, if the caller is the token owner. | function harvest (uint256 tokenId) external {
uint256 harvestable = _calculateHarvest(tokenId);
require(msg.sender == ERC721(config.vesselsContract).ownerOf(tokenId), "WisdomCurrency: caller is not the owner of the token");
require(harvestable > 0, "WisdomCurrency: nothing to harvest");
... | 2,956,158 |
//Address: 0x0c9a488c025db96ce8a834cd3412661f46833a28
//Contract name: Partners
//Balance: 0.01361 Ether
//Verification Date: 5/22/2018
//Transacion Count: 29
// CODE STARTS HERE
pragma solidity ^0.4.21;
/// @title A base contract to control ownership
/// @author cuilichen
contract OwnerBase {
// The addresse... | check wether target address is a contract or not | function isNormalUser(address addr) internal view returns (bool) {
if (addr == address(0)) {
return false;
}
uint size = 0;
assembly {
size := extcodesize(addr)
}
return size == 0;
}
| 1,771,320 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./OptimizedERC721Enumerable.sol";
/*
.............................................. | Approve `to` to operate on `tokenId` Emits a {Approval} event./ | function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(OptimizedERC721Enumerable.ownerOf(tokenId), to, tokenId);
}
| 36,339 |
pragma solidity ^0.5.0;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMathLibrary {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas ... | Prevent any further deposits and start distribution phase. | function admin_activate() public onlyBlockbidAdmin {
require(_poolParticipant != address(0));
require(!_activated);
_activated = true;
emit Activated();
}
| 1,818,701 |
/**
*Submitted for verification at Etherscan.io on 2021-10-17
*/
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While the... | Mints Octocreepers/ If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after the end of pre-sale, set the starting index block | function mint(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint Octocreepers");
require(numberOfTokens <= maxOctoPurchase, "Can only mint 20 tokens at a time");
require(totalSupply().add(numberOfTokens) <= MAX_OCTO, "Purchase would exceed max supply of ... | 7,966,757 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzep... | Requests randomness from a user-provided seed/ | function getRandomNumber(uint256 userProvidedSeed)
internal
returns (bytes32 requestId)
{
require(
LINK.balanceOf(address(this)) >= oracleFee,
"Not enough LINK balance"
);
return requestRandomness(keyHash, oracleFee, userProvidedSeed);
}
| 5,523,530 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
library WDivUp { // Fixed point arithmetic in 18 decimal units
// Taken from https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol
/// @dev Divide x and y, with y being fixed point. If both are integers, the result is a fixed point factor.... | Taken from https:github.com/usmfum/USM/blob/master/contracts/WadMath.sol Divide x and y, with y being fixed point. If both are integers, the result is a fixed point factor. Rounds up. | function wdivup(uint256 x, uint256 y) internal pure returns (uint256 z) {
z /= y;
pragma solidity ^0.8.0;
}
| 5,432,492 |
./full_match/80001/0x265342E7ef3EE81f31B30e46fb0c7b504E4598d8/sources/contracts/Mining.sol | Ensure the player has a pickaxe Calculate the rewards they are owed, and pay them out. uint256 reward = calculateRewards(msg.sender);rewardsToken.transfer(msg.sender, reward); Send the pickaxe back to the player Update the playerPickaxe mapping Update the playerLastUpdate mapping | function withdraw(uint256 _tokenId) external nonReentrant {
require(
playerPickaxe[msg.sender].isData,
"You do not have a pickaxe to withdraw."
);
pickaxeNftCollection.safeTransferFrom(address(this), msg.sender, _tokenId, 1, "Staking your pickaxe" );
play... | 9,448,782 |
./full_match/43114/0x97E1fA30CE93Ee2FBb4f2F4c2008F5091758F36C/sources/Masterchef/Masterchef.sol | Pay referral commission to the referrer who referred this user. | function payReferralCommission(address _user, uint256 _pending) internal {
if (address(referral) != address(0) && referralCommissionRate > 0) {
address referrer = referral.getReferrer(_user);
uint256 commissionAmount = _pending.mul(referralCommissionRate).div(10000);
if ... | 4,594,263 |
./partial_match/42/0xC31518D4fbA20E3618F6e7B24D1Bada43837Ed45/sources/GebProxyDebtAuctionActions.sol | Import a position from src handler to the handler owned by safe manager address - Safe Manager src - source handler safe uint - Safe Id | function enterSystem(
address manager,
address src,
uint safe
) external {
ManagerLike(manager).enterSystem(src, safe);
}
| 3,338,803 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
// interfaces
import {IERC725Y} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
import {ILSP1UniversalReceiver} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
import {ILSP1UniversalReceiverDelegate} from "../LSP1UniversalRece... | Transfer the ownership and notify the vault sender and vault receiver/ | function claimOwnership() public virtual override {
address previousOwner = owner();
super.claimOwnership();
_notifyVaultSender(previousOwner);
_notifyVaultReceiver(msg.sender);
}
| 1,830,531 |
pragma solidity ^0.7.1;
/**
* @title The Base Venue contract to facilitate interactions with the House.
* @author Primitive
*/
// Open Zeppelin
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
// Internal
import {IERC20} from "../interfaces/IERC20.sol";
import {IHouse} from "../inte... | Calls the `withdraw` function on the WETH contract. Sends withdrawn Ether to the House's original `msg.sender` which is the Account.depositor./ | function _wethWithdraw() internal {
uint256 balance = IERC20(address(_weth)).balanceOf(address(this));
if (balance > 0) {
_weth.withdraw(balance);
(bool success, ) =
require(success, "Venue: SEND_ETH_BACK");
}
}
| 6,441,410 |
pragma solidity 0.4.24;
/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for writing to them. At any time you can fetch a bytes object containing the
* current contents of the buffer. The bytes object should not b... | get the most recently reported answer/ | function latestAnswer()
external
view
returns (int256)
{
return currentAnswers[latestCompletedAnswer];
}
| 464,657 |
./full_match/5/0x93D15559730CB46602f1e9d354495871C56C0622/sources/contracts/crowdfunding.sol | _address.transfer(_value); | function sendPayout (uint _projectId, address payable _address, uint _value, uint _requestNo) private returns(bool) {
Request storage thisRequest = projects[_projectId].requests[_requestNo];
require(thisRequest.noOfVoter >= projects[_projectId].noOfContributors.div(2), "condition not fullfilled ... | 1,920,847 |
./full_match/1/0xe98F6E4b9C5Dc93D1375aA892348C732dbc4631a/sources/localhost/contracts/CompMinerV2.0.sol | FLASHLOAN LOGIC END FLASHLOAN LOGIC | function openPositionFlashloan(uint amount, uint flashLoanAmount)
internal
returns (bool)
{
state = OP.OPEN;
flReceiver.initiateFlashLoan(amount, flashLoanAmount, providers[flashloanProvider]);
state = OP.UNKNOWN;
return true;
}
| 3,044,549 |
./partial_match/1/0x39B5B793f162BF5c90c34165DE0107f17dFacAE4/sources/contracts/CErc20Delegator.sol | Accepts transfer of admin rights. msg.sender must be pendingAdmin Admin function for pending admin to accept role and update admin return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ | function _acceptAdmin() external override returns (uint256) {
bytes memory data = delegateToImplementation(abi.encodeWithSignature("_acceptAdmin()"));
return abi.decode(data, (uint256));
}
| 4,336,364 |
pragma solidity >=0.4.21 <0.6.0;
// Based on the solidity docs for common patterns: https://solidity.readthedocs.io/en/v0.5.0/common-patterns.html?highlight=seller
contract Owned {
/**
* Constructor
* Sets the message sender as the seller
*/
constructor() public { seller = msg.sender; }
bool... | Getter returns { uint } creationTime/ | function getCreationTime()
public
view
returns (uint)
{
return creationTime;
}
| 6,461,253 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
... | inject NONSTANDARD NAMING | function DOMAIN_SEPARATOR360() external view returns (bytes32); | 12,787,830 |
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return ... | vest the sale contributor tokens for 10 months, 10% gradual release with 1 month cliff | function vestTokens(address _beneficiary, uint256 _tokensAmount) external onlyOwner {
require(_beneficiary != address(0));
if(vestingOf[_beneficiary] == 0x0) {
TokenVesting vesting = new TokenVesting(_beneficiary, date01Oct2018, 31 days, 304 days, false);
vestingOf[_benefici... | 13,551,537 |
./full_match/1/0x25A103A1D6AeC5967c1A4fe2039cdc514886b97e/sources/contracts/RWAHub.sol | Scale provided amount down by `decimalsMultiplier` This helper is used for converting `rwa`'s decimal representation to the `collateral`'s decimal representation/ | function _scaleDown(uint256 amount) internal view returns (uint256) {
return amount / decimalsMultiplier;
}
| 3,021,999 |
./partial_match/3/0x08C2222cC05634AA179203BE86fdfc4b7a46cFF9/sources/RhinoController.sol | uniswapV2Router call | function swapTokensForTokens (uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) internal {
uniswapV2Router.swapExactTokensForTokens(amountIn, amountOutMin, path, to, deadline);
}
| 5,299,675 |
pragma solidity ^0.4.23;
import "../math/SafeMath.sol";
import "../tokens/Xct.sol";
import "../tokens/Xcert.sol";
import "../tokens/ERC20.sol";
import "./TokenTransferProxy.sol";
import "./XcertMintProxy.sol";
import "../tokens/ERC165implementation.sol";
/*
* @dev based on: https://github.com/0xProject/contracts/blo... | Verifies if claim signature is valid. _signer address of signer. _claim Signed Keccak-256 hash. _v ECDSA signature parameter v. _r ECDSA signature parameters r. _s ECDSA signature parameters s. return Validity of signature./ | function isValidSignature(address _signer,
bytes32 _claim,
uint8 _v,
bytes32 _r,
bytes32 _s)
public
pure
returns (bool)
{
return _signer == ecrecover(
keccak256("\x19Ethereum Signed ... | 6,348,310 |
./partial_match/97/0x7F8D85705b97AEC4c2d0d736174B5784Db7C3A18/sources/AnimalFactory.sol | function to accept a mate offer by offering one of your own animals and paying ethers ofcourse/the requester is actually the owner of the animal which he or she is offering for matinga user cannot mate two of his own animalsthe animal id given was actually advertised for mating the price requested for mating the ethers... | function mateAnimal(uint parent1Id, uint parent2Id, string animalName,string animalDesc) public payable
{
require (!isMatingPaused);
require (!isContractPaused);
require(msg.sender != 0x0);
require (token.ownerOf(parent2Id) == msg.sender);
require(token.... | 11,388,637 |
./full_match/4/0x98E8e3DebA2bC44d1924Da805fA4daB9ba6Fd8Fa/sources/browser/Untitled.sol | Destroy tokens Remove `_value` tokens from the system irreversibly _value the amount of money to burn/checking of enough token balance is done by SafeMathalthogh we can track all the "burn" from the Transfer function, we just kept it as it is. As that is no much harm | function burn(uint256 _value) public returns (bool success) {
require(!globalHalt, "paused by admin");
require(!blackListedUser[msg.sender], "you are not allowed");
burnTracker = burnTracker.add(_value);
emit Transfer(msg.sender, address(0), _value);
emit Burn(msg.s... | 745,987 |
// Sources flattened with hardhat v2.6.4 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.3.2
// 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 token... | logic for approving access/ | function _grantAccess() internal {
IERC20(depositToken).approve(masterchef, type(uint256).max);
}
| 958,157 |
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol | Extracts the timestamp from a block header Time is not 100% reliable _header The header return The timestamp (little-endian bytes) | function extractTimestampLE(bytes memory _header) internal pure returns (bytes4) {
return _header.slice4(68);
}
| 4,857,082 |
/**
*Submitted for verification at polygonscan.com on 2021-11-04
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
// import "hardhat/console.sol";
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally availabl... | calculates how many nativeToken for tokens | function updateTotalCapital() public returns (uint256) {
uint256 totalCapital = 0;
uint256 _nameID;
StrategyInfo storage strategyObj;
uint256 totalLP;
uint256 _token0Value;
uint256 _token1Value;
uint256[] memory amounts;
address[] memory path = new add... | 5,546,893 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import "@chainlink/contracts/src/v0.6/Oracle.sol";
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol";
import "@chainlink/contracts/src/v0.6/vendor/Ownable.sol";
import "./TokenHandler.sol";
contract APIConsumer is ChainlinkClient, Ownable, Toke... | request fullfilled by NODE if (_result) { } | function fulfillNFTClaim(bytes32 _requestId, bool _result)
public
recordChainlinkFulfillment(_requestId)
{
rewardNFT(
claimRecord[_requestId].tokenSymbol,
claimRecord[_requestId].claimant
);
emit RequestNFTClaimFullfilled(
_requestId,
... | 14,019,292 |
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value... | Locks msg.sender address/ | function bioLock() external {
uint rightNow = now;
bytes32 sha = keccak256("bioLock", msg.sender, rightNow);
biometricLock[msg.sender] = true;
biometricNow[sha] = rightNow;
BiometricLocked(msg.sender, sha);
}
| 4,804,570 |
//Address: 0x2cc6ca9c3023a6a876fd54a03f68281c7aad0e8b
//Contract name: ICOPreSale
//Balance: 0 Ether
//Verification Date: 6/14/2018
//Transacion Count: 6
// CODE STARTS HERE
pragma solidity ^0.4.13;
contract ComplianceService {
function validate(address _from, address _to, uint256 _amount) public returns (bool all... | To allow ICO contracts to check whether RefundVault is ready to refund investors/ | function isRefunding() public constant returns (bool) {
return (state == State.Refunding);
}
| 6,402,489 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity ^0.8.11;
import "contracts/Proxy.sol";
import "contracts/utils/DeterministicAddress.sol";
import "contracts/libraries/proxy/ProxyUpgrader.sol";
import "contracts/interfaces/IProxy.sol";
import {
AliceNetFactoryBaseErrorCodes
} from "contracts/libraries/erro... | _codeSizeZeroRevert reverts if false and returns csize0 error message isOk_ boolean false to cause revert/ | function _codeSizeZeroRevert(bool isOk_) internal pure {
require(
isOk_,
string(
abi.encodePacked(AliceNetFactoryBaseErrorCodes.ALICENETFACTORYBASE_CODE_SIZE_ZERO)
)
);
}
| 930,930 |
./partial_match/1/0x4bCBcc5b5279d0dB55105Abd61b255b64680606D/sources/UniSwap_ETH_CDAIZap.sol | - to kill the contract | function destruct() public onlyOwner {
selfdestruct(owner);
}
| 2,763,265 |
./full_match/1/0x216d7636b791Ed93BFD56BF696b35A14115416ab/sources/Birbtoken.sol | Deposit original tokens, receive proxy tokens amount Amount of original tokens to charge/ | function depositTokens(address from, uint amount) internal returns (bool)
{
require( amount > 0 );
require( ERC20( _originalToken ).transferFrom( from, address(this), amount) );
balances[from] += (amount * supplyFactor);
_totalSupply += (amount * supplyFacto... | 8,401,063 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.25 <0.8.0;
pragma experimental ABIEncoderV2;
import { IVault } from "./IVault.sol";
import { VaultBase } from "./VaultBase.sol";
import { IFujiAdmin } from "../IFujiAdmin.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
im... | Multiplies two ray, rounding half up to the nearest ray a Ray b Ray return The result of ab, in ray/ | function rayMul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0 || b == 0) {
return 0;
}
require(a <= (type(uint256).max - _HALF_RAY) / b, Errors.MATH_MULTIPLICATION_OVERFLOW);
return (a * b + _HALF_RAY) / _RAY;
}
| 1,311,700 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
import "@openzeppelin/contracts/math/Math.sol";
import "./IMasterVampire.sol";
import "./IIBVEth.sol";
contract MasterVampire is IMasterVampire, ChiGasSaver {
using SafeMath for uint256;
using SafeERC20 for IERC20;
using VampireAdapter for Victim;
... | note the impersonation | function pendingReward(Victim victim, uint256 poolId, uint256 victimPoolId) external view returns (uint256) {
(bool success, bytes memory result) = address(victim).staticcall(abi.encodeWithSignature("pendingReward(address,uint256,uint256)", address(victim), poolId, victimPoolId));
require(success, "... | 75,610 |
//pragma solidity 0.4.1;
import {RequestFactoryInterface} from "contracts/RequestFactoryInterface.sol";
import {PaymentLib} from "contracts/PaymentLib.sol";
import {RequestScheduleLib} from "contracts/RequestScheduleLib.sol";
import {RequestLib} from "contracts/RequestLib.sol";
import {SafeSendLib} from "contracts/Saf... | Set default values for block based scheduling./ | function resetAsBlock(FutureTransaction storage self) public returns (bool) {
if (!resetCommon(self)) throw;
if (self.windowSize != 255) {
self.windowSize = 255;
}
if (self.windowStart != block.number + 10) {
self.windowStart = block.number + 10;
}
... | 13,059,763 |
./full_match/1/0x40f1863bBAd5E614Becb366656BF6ACcbdb635F7/sources/contracts/BountyV1.sol | bounty The ID of the bounty return The address of the submitter of the bounty | function submitter(uint256 bounty) public view virtual returns (address) {
return _submissions[bounty].submitter;
}
| 8,397,883 |
./partial_match/1/0x0078C9f055D2c72bA31Fa4F87E40170ADff91674/sources/MultiLevelToken.sol | The Ownable constructor sets the original `owner` of the contract to the sender account./ | function Ownable()public {
owner = msg.sender;
}
| 4,357,499 |
./full_match/97/0xf78fC47cA5d05056c90FE73e0DbDf149789c90f7/sources/project_/contracts/Viddly.sol | Retrieves the join fee required to join a video. get the joining fee at the time of join a video. return The join fee amount/ | function getJoinFee()
external view override returns (uint256) {
return _joiningFee;
}
| 3,260,832 |
// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.0;
//import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.1.0/contracts/token/ERC20/utils/SafeERC20.sol";
//import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.1.0/contracts/access/Ownable.sol";
// local build
import "../... | here we tell the curreny that the buyer can ONLY have 'value' funds. V1.98 tokenccy.safeApprove(_escrow.buyer,(_escrow.value - _totalFees)); | function releaseEscrow(uint _orderId) external onlySeller(_orderId){
Escrow memory _escrow = escrows[_orderId];
require(escrows[_orderId].status == EscrowStatus.Funded,"USDT has not been deposited");
_escrow.status = EscrowStatus.TokenApproved;
uint256 _total... | 12,738,707 |
./partial_match/137/0x683638517CDf1A318B0F5c4Fcc20B1c6cd0B628F/sources/contracts/types/ERC721.sol | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), 'ERC721: caller is not token owner nor approved');
_safeTransfer(from, to, tokenId, data);
}
... | 3,514,210 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
// @ #
// #@ ,@& %@
// .# @@ %... | This function only needs to be run to enable fusion if all tokens aren't minted Running this function will permanently disable the publicMint function | function enableBurnRedemption() public onlyOwner {
_tokenIdCounter = Counters.Counter(120);
}
| 11,915,957 |
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 SPLIT752(slice memory self, slice memory needle) internal pure returns (slice memory token) { | 6,431,703 |
./partial_match/1/0xCF0aC4329820A2C3BBdFA7C1e3B4819662A85DcC/sources/contracts/RefToken.sol | make sure trading is closedmake sure that the pot has been reached | function restartThePot() public onlyOwner {
require(!tradingOpen, "Trading must be closed to restart the pot");
require(_potEthBalance >= _potWinningAmount, "Pot must be full to restart");
_potEthBalance = 0;
tradingOpen = true;
}
| 9,358,584 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.