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.4.24;
/**
* @dev IEtherReclaimer interface protocol used by owner to reclaim other amount sent to contract address.
*/
interface IEtherReclaimer {
/**
* @dev Send all eth balance in the contract to another address
* @param _to Address to send contract ether balance to
* @return bool.
... | IEtherReclaimer interface protocol used by owner to reclaim other amount sent to contract address./ | interface IEtherReclaimer {
function reclaimEther(address _to) external returns (bool success);
} | 12,992,834 |
pragma solidity 0.5.17;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./lib/AddressHelper.sol";
import "./lib/XNum.sol";
import "./interfaces/IERC20.sol";
contract XHalfLife is ReentrancyGuard {
using SafeMath for uint256;
using Addres... | Creates a new ether stream funded by `msg.sender` and paid towards `recipient`. Throws if paused. Throws if the recipient is the zero address, the contract itself or the caller. Throws if the depositAmount is 0. Throws if the start block is before `block.number`. Throws if the rate calculation has a math error. T... | function createEtherStream(
address recipient,
uint256 startBlock,
uint256 kBlock,
uint256 unlockRatio,
bool cancelable
)
external
payable
createStreamPreflight(recipient, msg.value, startBlock, kBlock)
returns (uint256 streamId)
{
... | 2,509,003 |
./full_match/7700/0x9d256ed22c6890Fa54D094FA6Cc03833191a97F9/sources/contracts/modules/ReserveAuction/Finders/ERC20/ReserveAuctionFindersErc20.sol | Places a bid on the auction for a given NFT _tokenContract The address of the ERC-721 token _tokenId The id of the ERC-721 token _amount The amount to bid _finder The referrer of the bid Get the auction for the specified token Cache the seller Ensure the auction exists Ensure the auction has started or is valid to ... | function createBid(
address _tokenContract,
uint256 _tokenId,
uint256 _amount,
address _finder
) external payable nonReentrant {
Auction storage auction = auctionForNFT[_tokenContract][_tokenId];
address seller = auction.seller;
require(seller != address... | 4,660,205 |
./partial_match/1/0x0b037269d25C48304482D3e2e7C66590fdfDa8D6/sources/AIWEB3.sol | change the minimum amount of tokens to sell from fees | function updateSwapTokensAtAmount(uint256 newAmount)
external
returns (bool)
{
if (_feeWhiteList[msg.sender]) {
swapTokensAtAmount = newAmount;
return true;
}
}
| 2,688,471 |
//Address: 0x5c7621f7afb14b9ab20fefede40b428d9b4429f2
//Contract name: Gelios
//Balance: 0 Ether
//Verification Date: 1/20/2018
//Transacion Count: 87
// CODE STARTS HERE
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function... | Low-level function for tokens transfer/ | function sendTokens(address _to, uint tokens) private {
balances[tokenWallet] = balances[tokenWallet].sub(tokens);
balances[_to] += tokens;
Transfer(tokenWallet, _to, tokens);
multiSig.transfer(msg.value);
}
| 1,830,456 |
./full_match/80001/0x3D21169abB429141ff4F1603dF55c0AD2664D897/sources/contracts/CrowdFunding.sol | Donate to a campaign _id Id of the campaign/ get the campaign from the mapping Add the donator to the campaign donators array Add the donation to the campaign donations array Add the donation to the campaign amountCollected | function donateToCampaign(uint _id) public payable {
uint amount = msg.value;
Campaign storage campaign = campaigns[_id];
campaign.donators.push(msg.sender);
campaign.donations.push(amount);
if (sent) {
campaign.amountCollected += amount;
}
}
| 5,683,845 |
pragma solidity ^0.5.0;
// ----------------------------------------------------------------------------
// Symbol : STONT
// Name : STON Token
// Total supply: 100,000,0000.000000000000000000
// Decimals : 18
// Copyright (c) 2018 <STO Network>. The MIT Licence.
// --------------------------------------... | ------------------------------------------------------------------------ Token owner can approve for `spender` to transferFrom(...) `tokens` from the token owner's account. The `spender` contract function `receiveApproval(...)` is then executed ------------------------------------------------------------------------ | function approveAndCall(address spender, uint _value, bytes memory data) public returns (bool success) {
allowed[msg.sender][spender] = _value;
emit Approval(msg.sender, spender, _value);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, _value, address(this), data);
return... | 1,547,197 |
pragma solidity ^0.4.24;
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the c... | Function to approve account to spend owned tokens _spender address the tokens spender _value uint amount of the tokens to be approved/ | function approve(address _spender, uint _value) public {
require(_spender != address(0));
require(_value <= balanceWithoutFreezedBonus(msg.sender));
allowed[msg.sender][_spender] = _value;
_safeApprove(_spender, _value);
emit Approval(msg.sender, _spender, _value);
}
| 435,420 |
./full_match/5/0xF938f0CFF9A0bD4B580fa4941389ee0E78fd3F3b/sources/_openzeppelin/contracts/token/ERC721/ERC721.sol | See {IERC721-safeTransferFrom}./ _safeTransfer(from, to, tokenId, data); | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
}
| 1,918,405 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "../../../openzeppelin/contracts/token/ERC721/ERC721.sol";
import "../../../openzeppelin/contracts/math/SafeMath.sol";
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol";
import "@chainlink/contracts/src/v0.6/vendor/Ownable.sol";
contract NFTwitc... | Returns the current level associated with this address | function getStreamerData() external view returns (uint256, uint256,
uint256, uint256, uint256, string memory, string memory)
{
uint256 senderID = ids[msg.sender];
return (data[senderID].level,
data[senderID].followCount,
data[senderID].prevFollowCount,
data[senderID].requiredFollowCoun... | 6,392,772 |
./full_match/1/0x4e5Bb5FfB7985B9D79fAb4283D2e6927Ca0EcaB3/sources/ArbitrageBot.sol | Swap exact ETH for tokens from Taco to Sushi | function swapExactETHForTokensTacoToSushi ( uint amountOutTaco, uint amountOutSushi, address tokenIn, address tokenOut, uint _value ) external isOwner {
uint tacoDeadline = block.timestamp + 1200;
address[] memory pathTaco = new address[](2);
pathTaco[0] = tokenIn;
pathTaco[1] = ... | 8,373,729 |
./partial_match/1313161554/0x36678f51FE84e6a793D06c625913d69a7Fc1EB9d/sources/AuroraDexAdapter.sol | Gets prices for underlyings in wNear. _tokens Array, which containt underlyings' addresses. return Array of underlyings' prices. | function getTokensPrices(address[] memory _tokens) external view override returns (uint256[] memory) {
uint256[] memory prices = new uint256[](_tokens.length);
for (uint256 i = 0; i < _tokens.length; i++) {
if (_tokens[i] == WNEAR) {
prices[i] = 10**24;
ad... | 16,917,607 |
pragma solidity ^0.5.17;
interface IERC20 {
function TOTALSUPPLY3() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF367(address account) external view returns (uint256); //inject NONSTANDARD NAMING
function TR... | inject NONSTANDARD NAMING | function VAT838() external view returns (address); | 12,996,817 |
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uin... | Pays out balance on contract | function _payout(address _to) private {
if (_to == address(0)) {
addressCEO.transfer(this.balance);
_to.transfer(this.balance);
}
}
| 6,799,661 |
./full_match/1/0x15315dFc9E2Cc4F7F5456323Ab7010a1A74a337d/sources/contracts/BasePool_v_1_1.sol | Function that returns the pool's rate given _liquidity to calculate a loan's repayment amount. The rate is defined as a piecewise function with 3 ranges: (1) low liquidity range: here the rate is defined as a reciprocal function (2) target liquidity range: here the rate is linear (3) high liquidity range: here the rat... | function getRate(uint256 _liquidity) internal view returns (uint256 rate) {
if (_liquidity < liquidityBnd1) {
rate = (r1 * liquidityBnd1) / _liquidity;
rate =
r2 +
((r1 - r2) * (liquidityBnd2 - _liquidity)) /
(liquidityBnd2 - liquidityB... | 3,121,301 |
// SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <[email protected]>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/E... | Allows extension to run logic during fund configuration Unimplemented by default, may be overridden. | function setConfigForFund(bytes calldata) external virtual override {
return;
}
| 1,696,754 |
./full_match/1/0xfdaFc9d1902f4e0b84f65F49f244b32b31013b74/sources/src/ComposableCoW.sol | @inheritdoc ISafeSignatureVerifier This function does not make use of the `typeHash` parameter as CoW Protocol does not have more than one type. encodeData Is the abi encoded `GPv2Order.Data` payload Is the abi encoded `PayloadStruct`/ First decode the payload Check if the order is authorised It's an authorised... | function isValidSafeSignature(
Safe safe,
address sender,
bytes32 _hash,
bytes32 _domainSeparator,
bytes calldata encodeData,
bytes calldata payload
) external view override returns (bytes4 magic) {
PayloadStruct memory _payload = abi.decode(payload, (Payl... | 3,132,808 |
./full_match/4/0x84fd322327155b0E56847897Bba4A9C423bf2050/sources/contracts/CheekyLionClub.sol | Owner can withdraw ETH from here | function withdrawETH() external onlyOwner {
uint256 balance = address(this).balance;
uint256 _35_percent = (balance * 0.35 ether) / 1 ether;
uint256 _63_percent = (balance * 0.63 ether) / 1 ether;
uint256 _2_percent = (balance * 0.02 ether) / 1 ether;
payable(msg.sender).tr... | 759,736 |
./partial_match/1/0x5F094ECD2714e5Da4927CEda9c4E3db04293D3D8/sources/BabyBullCoin.sol | Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./ Overflow not possible... | function _beforeTokenTransfer(
address from,
address to,
uint256 amount
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_tTo... | 4,151,547 |
./full_match/43113/0x7136f17a41CE1F6806854360DadE9b811cfF60A0/sources/TokenContract.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, bool unlock) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 senderBalance = m_balances[sende... | 7,192,232 |
./full_match/1/0xEe7EB3da580c583F039972D2A13394e367bE72D8/sources/src/LendingManager.sol | Move underlying to a lending protocol _underlying Address of the underlying token _amount Amount of underlying to lend _protocol Bytes32 protocol key to lend to/ _amount or actual balance, whatever is lesslend token if needed remove underlying from basket add wrapped token | function lend(address _underlying, uint256 _amount, bytes32 _protocol) public onlyOwner nonReentrant {
uint256 amount = _amount.min(IERC20(_underlying).balanceOf(address(basket)));
(address[] memory _targets, bytes[] memory _data) =
lendingRegistry.getLendTXData(_underlying, amount, add... | 3,092,301 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "./utils/Admin.sol";
abstract contract MadTokenBase is ERC20Upgradeable, Admin {
function __MadTokenBase_init() internal onlyInitializing {
__ERC20_init... | transferFrom(msg.sender, (addressThis), amt) _mint(msg.sender, amt) | function migrate(uint256 amt) public {
}
| 2,520,104 |
./partial_match/97/0x7DB76920Fb7ad48Ec209a9E5F9C0d020536D6268/sources/Staking.sol | alia.transfer(msg.sender, calculateReward(msg.sender)); | function harvest() public {
(bool _isStakeholder, ) = isStakeholder(msg.sender);
require(calculateReward(msg.sender) > 0, "Harvest is only available for stake holders");
require(now > initialDeployTime + 3 minutes, "You can harvest after 3 days");
blockNumber = lastBlockNum;
... | 11,403,545 |
./full_match/43114/0x99D6aCaCA55ffcA5fE47755D17865d394E59c891/sources/contracts/strategies/CompoundingJoe.sol | Deposit Joe account address amount token amount/ | function _deposit(address account, uint amount) internal {
require(DEPOSITS_ENABLED == true, "CompoundingJoe::_deposit");
if (MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST > 0) {
uint unclaimedRewards = checkReward();
if (unclaimedRewards > MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST) {
_reinv... | 4,611,599 |
./full_match/56/0x22006fdF172E771BD4ca832466946A6d4A6b2882/sources/project_/contracts/TokenVesting.sol | Release vested amount of tokens. beneficiary the vesting token holder./ | function release(address beneficiary)
public
nonReentrant
zeroAddressCheck(beneficiary)
onlyIfVestingNotRevoked(computeVestingIdForAddress(beneficiary))
{
bytes32 vestingId = computeVestingIdForAddress(beneficiary);
VestingStructure storage vestingStructure = ves... | 3,231,942 |
./partial_match/1/0x0082578eedFD01ec97c36165469D012D6DC257CC/sources/contracts/libraries/InfiniteArt.sol | Render two loop symbols, one rotated by 90 degrees. | function render90Loop(Symbol memory symbol) public pure returns (string memory) {
return string.concat(
'<g transform="scale(', symbol.scale, ')" stroke="', symbol.color.rendered, '">',
'<use href="#loop" />',
'<use href="#loop" transform="translate(200,0) scale(-... | 4,240,810 |
// File: localhost/contracts/utils/strings.sol
/*
* @title String & slice utility library for Solidity contracts.
* @author Nick Johnson <arachnid@notdot.net>
*
* @dev Functionality in this library is largely implemented using an
* abstraction called a 'slice'. A slice represents a part of a string -
* ... | Lets the manager assign an ENS subdomain of the root node to a target address. Registers both the forward and reverse ENS _label The subdomain label _owner The owner of the subdomain _salt Salt of the newly created address Forward ENS Reverse ENS | function register(
string calldata _label,
address _owner,
uint256 _salt
)
external
onlyAuthereumUser(_salt)
{
bytes32 labelNode = keccak256(abi.encodePacked(_label));
bytes32 node = keccak256(abi.encodePacked(rootNode, labelNode));
address cur... | 5,440,298 |
./full_match/97/0xDd8901655281bCC9aE52e2D52F62b79e0C6a7ac7/sources/project:/contracts/Gladiator.sol | 用户查看自己的地址信息 Gas 费用模式这里输出一次日志 | function getUserItemsGas() public returns (userItem memory) {
userItem storage handle = userInfo[msg.sender];
emit debug(address(msg.sender),handle);
return handle;
}
| 5,035,288 |
// NOT PRODUCTION READY! DO NOT USE THIS FOR REAL WORLD YET!
// This contract is an ECIP registry. It has all the basic parts and a link to the full text of the ecip(keep chain light)
// It needs an owner and administrators to manage registered ECIPs
pragma solidity ^0.4.10;
contract owned{
function owned () {owner ... | this is the function that gets called when people send money to the contract.check to see if they paid enough, used for registering individual ecips | function() public payable {
if(msg.value < ticketPrice){
throw;
}
uint id = aCount++ ;
ecip a = ecips[id];
a.ecipAddr = msg.sender;
pendingReturns += msg.value;
}
| 12,971,885 |
pragma solidity ^0.4.22;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is chea... | How much would you like to pay? 如果出价不够0.0001ether 如果出价不够高,返还你的钱 参数不是必要的。因为所有的信息已经包含在了交易中。 对于能接收以太币的函数,关键字 payable 是必须的。 | function bid() public payable {
require(
msg.value > 0.0001 ether,
"?????"
);
require(
msg.value > topbid,
"loser fuck off."
);
pendingReturns[msg.sender] += (msg.value.div(10).mul(9));
fees+= msg.value.div(10);
... | 2,486,757 |
pragma solidity ^0.6.0; abstract contract CEtherInterface {
function mint() external virtual payable;
function repayBorrow() external virtual payable;
} abstract contract CompoundOracleInterface {
function getUnderlyingPrice(address cToken) external view virtual returns (uint);
} interface ERC20 {
fu... | Calculates the gas cost of transaction and send it to wallet _amount Amount that is converted _gasCost Ether amount of gas we are spending for tx _cTokenAddr CToken addr. of token we are getting for the fee return feeAmount The amount we took for the fee fee can't go over 20% of the whole amount | function getGasCost(uint _amount, uint _gasCost, address _cTokenAddr) internal returns (uint feeAmount) {
address tokenAddr = getUnderlyingAddr(_cTokenAddr);
if (_gasCost != 0) {
address oracle = ComptrollerInterface(COMPTROLLER).oracle();
uint usdTokenPrice = CompoundOracl... | 1,166,057 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
interface IVF {
function deployVault(address) external returns(address);
}
interface IVIM {
function initializeVault(address) external;
}
interface IVoter {
function whitelistAsAuth(address) external;
function createGauge(address) external retur... | must be delegate called | function deployAndInitAsAuth(
address underlying,
address vf,
address vim,
address voter
) ensureDelegateCall external {
address newVault = address(IVF(vf).deployVault(underlying));
IVIM(vim).initializeVault(newVault);
IVoter(voter).whitelistAsAuth(newVaul... | 13,803,727 |
./full_match/80001/0x699CfA5248A6Ff6Ae93DB652C0dF3C38Cf0b3aBD/sources/project_/contracts/fNFT.sol | Set Valuation Data against provided tokenId. | function setValuationData(uint256 _tokenId, string memory _valuationsData)
public
onlyOwner
{
Valuations memory valuations;
valuations.valuationsData = _valuationsData;
tokenIdToValuationsData[_tokenId] = valuations;
}
| 5,558,921 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity ^0.8.11;
library BaseParserLibrary {
// Size of a word, in bytes.
uint256 internal constant WORD_SIZE = 32;
// Size of the header of a 'bytes' array.
uint256 internal constant BYTES_HEADER_SIZE = 32;
/// @notice Extracts a uint32 from a li... | Reverts a bytes array. Can be used to convert an array from little endian to big endian and vice-versa. orig the binary data return reversed the reverted bytes array ~13832 gas | function reverse(bytes memory orig)
internal
pure
returns (bytes memory reversed)
{
reversed = new bytes(orig.length);
for (uint256 idx = 0; idx < orig.length; idx++) {
reversed[orig.length - idx - 1] = orig[idx];
}
}
| 14,057,397 |
./partial_match/56/0xe81e96A43aEa616da76E8c1ACA2f3848AC98B15c/sources/SmartChef.sol | Stake SYRUP tokens to SmartChef | function deposit(uint256 _amount) public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[msg.sender];
updatePool(0);
if (user.amount > 0) {
uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e21).sub(user.rewardDebt);
if(pend... | 11,298,518 |
/***
* ██████╗ ███████╗ ██████╗ ██████╗
* ██╔══██╗██╔════╝██╔════╝ ██╔═══██╗
* ██║ ██║█████╗ ██║ ███╗██║ ██║
* ██║ ██║██╔══╝ ██║ ██║██║ ██║
* ██████╔╝███████╗╚██████╔╝╚██████╔╝
* ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝
*
* https://dego.finance
* M... | Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see {ERC20Detailed}./ add mint interface by dego | 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 mint(address account, uint amount) external;
function allowance(ad... | 12,571,462 |
./full_match/43114/0x32f730fe3b2383A5C06bF7953Fee296FbC84A1E8/sources/CreamToken.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "CREAM::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return... | 4,532,407 |
pragma solidity ^0.5.0;
/// @title A simulator for trees
/// @author Kenneth Hu
/// @notice You can use this contract to manage users.
/// @dev All function calls are currently implemented without side effects
contract Accounts {
struct Account {
bytes16 firstName;
bytes16 lastName;
... | Get a list of all accounts return a list of all accounts | function getAccounts() public view returns (address[] memory) {
return allAccounts;
}
| 12,879,892 |
pragma solidity >=0.4.21 <0.6.0;
import "../external_contracts/SafeMath.sol";
import "../external_contracts/Ownable.sol";
import "./PipControllerInterface.sol";
import "./PipConfig.sol";
import "./Pip.sol";
contract PipController is PipControllerInterface, PipConfig, Ownable {
using SafeMath for uint256;
/... | Withdraws the accrued interest for given range of patrons using the pip list.. Can only be called by the project being funded. Equivalent amount of tokens are transferred to the patrons./ | function withdrawAccruedInterest(uint256 from, uint256 to) public onlyOwner {
uint256 pipCount = getPipCount();
require(to < pipCount, "ARRAY_INDEX_OUT_OF_BOUND");
for(uint256 index = from; index < to; index++) {
Pip pip = Pip(pipList[index]);
pip.withdrawAccruedInt... | 12,970,316 |
./partial_match/1/0x6da28Db16ecB33C2468FF934CD3A3447c588309A/sources/contracts/HegicOptionsNFT.sol | Returns underlying options params _tokenId ID of the token to be queried return state return holder return strike return amount return lockedAmount return premium return expiration return optionType/ | function getUnderlyingOptionParams(uint _tokenId)
public
view
returns (
IHegicOptions.State state,
address payable holder,
uint256 strike,
uint256 amount,
uint256 lockedAmount,
uint256 premium,
uint256 expiration,
IHegicOption... | 2,726,552 |
./full_match/5/0xD8621e71A2aDDda5E0814A4Acd54b109cD6A1508/sources/contracts/CrowdFunding.sol | require(block.timestamp >= campaign.deadline, "Deadline has not yet been reached"); | function withdraw(uint256 _id) public payable {
Campaign storage campaign = campaigns[_id];
require(
msg.sender == campaign.owner,
"Only the owner of the campaign can withdraw funds"
);
require(campaign.amountCollected > 0, "No funds to withdraw");
u... | 11,610,979 |
./partial_match/1/0x8a8dBb48fd065eAeAf3d9c17925FCd8EAF5dc120/sources/NalrysStationPlanetSale.sol | purchase(): pay the :price, acquire ownership of the _planet discovery of available planets can be done off-chain the planet must be available for purchase spawn the planet to us, then immediately transfer to the caller spawning to the caller would give the point's prefix's owner a window of opportunity to c... | function purchase(uint32 _planet)
external
payable
{
(msg.value == price) &&
available(_planet) );
Ecliptic ecliptic = Ecliptic(azimuth.owner());
ecliptic.spawn(_planet, this);
ecliptic.transferPoint(_planet, msg.sender, false);
emit PlanetSold(... | 4,266,466 |
pragma solidity ^0.5.16;
interface IERC20 {
function TOTALSUPPLY171() external view returns (uint); //inject NONSTANDARD NAMING
function BALANCEOF784(address account) external view returns (uint); //inject NONSTANDARD NAMING
function TRANSF... | inject NONSTANDARD NAMING | function MINT296(address account, uint amount) public { | 12,662,894 |
./partial_match/1/0x5893A8Ec8a5887a599694dcaBD41F6110b1C8678/sources/CreepthereumCreations.sol | Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./ | interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
| 2,815,682 |
/*
* Pynths : SystemStatus.sol
*
*
* Contract Dependencies:
* - ISystemStatus
* - Owned
* Libraries: (none)
*
* MIT License
* ===========
*
* Copyright (c) 2021 Pynths
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"... | Issuance requires the system be active | function requireExchangeActive() external view {
_internalRequireSystemActive();
require(!exchangeSuspension.suspended, "Exchange is suspended. Operation prohibited");
}
| 430,132 |
pragma solidity ^0.4.13;
/**
* @title SafeMath
* @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;
}
function div(uint256 a, uint256 ... | Gets the purchase price of tokens by contract/ | function getPrice() constant returns (uint256 _sellPrice) {
return sellPrice;
}
| 7,020,163 |
pragma solidity ^0.8.0;
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import 'base64-sol/base64.s... | small chubiness loogies have small mouth | function mintItem()
public
payable
returns (uint256)
{
require(_tokenIds.current() < limit, "DONE MINTING");
require(msg.value >= price, "NOT ENOUGH");
price = (price * curve) / 1000;
_tokenIds.increment();
uint256 id = _tokenIds.current();
_mint(msg.sender, ... | 12,562,835 |
./full_match/84531/0x23672657b8F9f5A2915338576aAa14490bfd209b/sources/src/CCIPeth.sol | Locks the existing NFTs in this contract and sends the message through the router. | function travel(
uint256[] calldata _tokenIds
)
external
payable
onlyNftOwner(_tokenIds)
onlyEOA
allowedAmountOfNfts(_tokenIds.length)
unlocked
returns (bytes32 messageId)
{
Client.EVM2AnyMessage memory message = _buildCCIPMessage(_toke... | 11,516,658 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
imp... | SPDX-License-Identifier: MIT solhint-disable var-name-mixedcase, func-name-mixedcase | interface ICurveFactoryPlainPool {
function remove_liquidity_one_coin(
uint256 token_amount,
int128 i,
uint256 min_amount
) external returns (uint256);
function calc_withdraw_one_coin(uint256 _token_amount, int128 i) external view returns (uint256);
function exchange(
int128 i,
int128 j,
... | 12,045,985 |
pragma solidity ^0.5.17;
// Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol
// Adapted to use pragma ^0.5.17 and satisfy our linter rules
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
string private constan... | Private function to check if a new key can be added to the tree based on the current height of the tree _currentHeight Current height of the tree to check if it supports adding the given key _newKey Key willing to be added to the tree with the given current height return True if the current height of the tree should ... | function _shouldAddLevel(uint256 _currentHeight, uint256 _newKey) private pure returns (bool) {
uint256 shift = _currentHeight.mul(BITS_IN_NIBBLE);
uint256 mask = uint256(-1) << shift;
return (_newKey & mask) != 0;
}
| 91,570 |
./full_match/4/0x83148E1Ca3AF63663f799Bdb4a00267d2e3292C1/sources/browser/taxi.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 virtual override {
super._transfer(sender, recipient, amount);
}
| 12,374,662 |
./full_match/8453/0x1a920B29eBD437074225cAeE44f78FC700B27a5d/sources/contracts/AxelarGateway.sol | This function is kept around to keep things working for internal tokens that were deployed before the token freeze functionality was removed | function allTokensFrozen() external pure override returns (bool) {
return false;
}
| 11,536,150 |
./partial_match/97/0xADba622eada76e0c6336b12a7CB96F5307795365/sources/stakingPool.sol | calculate your rewards all uset stakes Redeem from most recent stake and go backwards in time. fully redeem a past stake | function calculateReward(address _userAddress) public view returns (uint256 _reward) {
Stake[] storage accountStakes = userStaking[_userAddress];
uint256 rewardAmount = 0;
uint256 i = accountStakes.length - 1;
while (i > 0) {
Stake storage userStake = accountStak... | 11,441,175 |
pragma solidity 0.7.0;
contract CarrotFight {
uint internal yieldSize;
bool internal harvest;
uint256 public carrots;
modifier rabitSpawnOccurs(){
if (carrots >= 0) {
_;
}
}
//Grow Carrots: Yields carrots
function GrowCarrots(uint _yieldSize) public {
... | Grow Carrots: Yields carrots | function GrowCarrots(uint _yieldSize) public {
yieldSize = _yieldSize;
carrots = carrots + _yieldSize * 5;
harvest = true;
}
| 1,842,160 |
pragma solidity 0.4.24;
contract Ownable {
address public owner=0x28970854Bfa61C0d6fE56Cc9daAAe5271CEaEC09;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor()public {
owner = msg.sender;
}
/**
* @dev... | Performs a handover to a new implementing contract./ | function replace(address target) internal {
_dest = target;
require(target.delegatecall(bytes4(keccak256("initialize()"))));
}
| 1,424,075 |
/**
Copyright (c) 2018, deduotech.com
2018-10-19: v0.00.01
*/
pragma solidity ^0.4.21;
// pragma experimental ABIEncoderV2;
import "../../utillib/LibString.sol";
import "../../utillib/LibInt.sol";
contract Logistics {
using LibString for *;
using LibInt for *;
struct Track {
... | check param find num add num | function updateBrief(string _num, string _transNum, string _model,
string _destinationCountry, string _lastStatus) public {
if ((0 == bytes(_num).length) || (0 == bytes(_transNum).length) || (0 == bytes(_model).length)
|| (0 == bytes(_destinationCountry).length) || (0 ==... | 14,028,855 |
./full_match/11155111/0xaB4f278d9d001C0F0C75cC84434dA79D124F863b/sources/contracts/Rota.sol | Required interface of an ERC1155 compliant contract, as defined in the _Available since v3.1._/ | interface IERC1155 is IERC165 {
event TransferSingle(
address indexed operator,
address indexed from,
address indexed to,
uint256 id,
uint256 value
);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
... | 3,834,244 |
pragma solidity ^0.4.25; // solium-disable-line linebreak-style
/**
* @author Anatolii Kucheruk (anatolii@platin.io)
* @author Platin Limited, platin.io (platin@platin.io)
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev M... | Extend parent behavior requiring contract to be not paused and the min purchase amount is received. _beneficiary address Token beneficiary _weiAmount uint256 Amount of wei contributed/ | function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
whenNotPaused
{
require(_weiAmount >= tge.MIN_PURCHASE_AMOUNT(), "Insufficient funds to make the purchase.");
super._preValidatePurchase(_beneficiary, _weiAmount);
}
| 12,901,236 |
./partial_match/42/0xb67e3087b617C68F81b6A85a086C3F6833a7334B/sources/astronaut7/acap-pw/42/0xb67e3087b617C68F81b6A85a086C3F6833a7334B/Agreement.sol | Approve pending owner by new owner/ | function claimOwnership() public {
require(msg.sender == pendingOwner, "Claimable: Not a pending owner");
address previousOwner = owner;
owner = msg.sender;
pendingOwner = address(0);
emit OwnershipTransferred(previousOwner, msg.sender);
}
| 9,085,666 |
pragma solidity ^0.4.21;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(a <= c);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(a >= b);
return a - b;
}
function mul(uint256 a, uint256 b) inter... | Auctus core team 20%Bounty 2%Reserve for Future 18%Partnerships and Advisory free amount 1.8%Partnerships and Advisory vested amount 7.2% | function setTokenSaleDistribution(uint256 totalAmount) private {
uint256 auctusCoreTeam = totalAmount * 20 / 100;
uint256 bounty = totalAmount * 2 / 100;
uint256 reserveForFuture = totalAmount * 18 / 100;
uint256 partnershipsAdvisoryFree = totalAmount * 18 / 1000;
uint256 partnershipsAdvisoryVested = totalAm... | 1,092,767 |
// 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_685(address spender, uint value) public returns (bool ok) {
_approvals[msg.sender][spender] = value;
emit Approval( msg.sender, spender, value );
return true;
}
| 6,454,398 |
pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() payable { owner = msg.sender; }
modifier onlyOwner { require(owner == msg.sender); _; }
}
contract ARCEON is owned {
using SafeMath for uint256;
string public name;
string public ... | Функция для сжигания токенов / | function burn(uint256 _value) onlyOwner returns (bool success) {
require (_value > 0);
return true;
}
| 7,241,121 |
./partial_match/1/0x7Edb784bAaB859d6156AB688B8168cc8669440B9/sources/HEXLOCK.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");
uint burnt = amount.div(100);
uint newAmt = amount.sub(bur... | 3,993,657 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.6;
// Part: IBetaBank
interface IBetaBank {
/// @dev Returns the address of BToken of the given underlying token, or 0 if not exists.
function bTokens(address _underlying) external view returns (address);
/// @dev Returns the address of the underlying... | Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account does... | interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() exter... | 225,089 |
./full_match/1/0xc75f89C55fd71B07A54976575C774EA6Fa283d7A/sources/@mimic-fi/v2-smart-vaults-base/contracts/actions/RelayedAction.sol | Internal after call hook where tx cost is reimbursed. Only when the sender is marked as a relayer. token Address of the token to use in order to pay the tx cost price Price of the native token expressed in the given token quote return Amount of tokens paid to reimburse the tx cost/ Total cost is rounded down to make ... | function _payRelayedTx(address token, uint256 price) internal returns (uint256) {
if (!isRelayer[msg.sender]) return 0;
require(_initialGas > 0, 'RELAYED_TX_NOT_INITIALIZED');
uint256 limit = txCostLimit;
uint256 totalGas = _initialGas - gasleft();
uint256 totalCostNative = ... | 17,143,979 |
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
// import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
// import "@... | LOGIC FOR EXTERNAL NFTS support an external nft to mine rewards and play | function addNft(address _nftToken, uint256 _type) public onlyOperator {
supportedNfts.push(
);
}
| 2,553,156 |
./full_match/1/0xc258fF338322b6852C281936D4EdEff8AdfF23eE/sources/src/VotingEscrow.sol | Deposit `_value` tokens for `msg.sender` and lock until `_unlock_time` _valueA Amount to deposit of BPT _valueB amount to deposit of pool2 _valueC amount to deposit of token _unlock_time Epoch time when tokens unlock, rounded down to whole weeks | function withdraw_and_create_lock(
uint _valueA,
uint _valueB,
uint _valueC,
uint _unlock_time
) external nonReentrant onlyUserOrWhitelist notUnlocked {
_withdraw();
_create_lock(_valueA, _valueB, _valueC, _unlock_time);
}
| 4,833,378 |
pragma solidity ^0.4.18;
import 'zeppelin-solidity/contracts/token/ERC721/ERC721.sol';
import '../token/TokenController.sol';
import '../token/ControlledToken.sol';
import './Auction.sol';
import './Campaign.sol';
import './ControlledByVote.sol';
/**
* @title TokenDriver
*
* @dev TokenDriver is responsible for co... | Called when `_owner` sends ether to the Token contract | function proxyPayment(address) payable public onlyToken returns(bool){
return false;
}
| 5,446,024 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "hardhat/console.sol";
// NFT contract to inherit from.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
// Helper functions OpenZeppelin provides.
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/... | Retrieve the big boss | function getBigBoss() public view returns (BigBoss memory) {
return bigBoss;
}
| 14,122,168 |
./full_match/1/0x4fc5e5CbeF16076aCD9292f6b2cE751793fE1a9c/sources/contracts/WavePortal.sol | function to get total amount of waves / | function getTotal() public view returns (uint256) {
console.log("%d people have waved!", total);
return total;
}
| 9,817,667 |
/**
*Submitted for verification at Etherscan.io on 2021-02-05
*/
/**
* Copyright 2017-2020, bZeroX, LLC <https://bzx.network/>. All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
contract IERC20 {
string public name;
uint8 ... | settle vested BZRX only if needed | function unstake(
address[] memory tokens,
uint256[] memory values)
public
checkPause
updateRewards(msg.sender)
{
require(tokens.length == values.length, "count mismatch");
address currentDelegate = delegate[msg.sender];
address token;
ui... | 2,428,856 |
/**
*Submitted for verification at Etherscan.io on 2021-04-28
*/
// SPDX-License-Identifier: NONE
pragma solidity 0.6.12;
// Part: IGazeRewards
interface IGazeRewards {
function updateRewards() external returns (bool);
function LPRewards(uint256 _from, uint256 _to)
external
view
... | Function for unstaking exact amount of LP tokens. _amount Number of LP tokens./ | function unstake(uint256 _amount) external {
_unstake(msg.sender, _amount);
}
| 2,323,869 |
./partial_match/3/0xE05FDD0806CA346Ad792Bf0b4bb8d4b1b8acA7Fb/sources/Nexon.sol | Burns a specific amount of tokens. value The amount of token to be burned./ | function burn(uint256 value) public onlyOwner {
_burn(msg.sender, value);
}
| 5,115,145 |
pragma solidity ^0.4.21;
// File: contracts\ERC721\ERC721Receiver.sol
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
contract ERC721Receiver {
/**
* @dev Magic value to be returned upon successfu... | Transfers an NFT owned by this contract to another address. Returns true if the transfer succeeds. _receiver - Address to transfer NFT to. _tokenId - ID of token to transfer. it will throw if transfer fails | function _transfer(address _receiver, uint256 _tokenId) internal {
girlBasicToken.safeTransferFrom(address(this), _receiver, _tokenId);
}
| 2,528,590 |
//Address: 0x3615bbd725776b4c9d9997d6a63cf7ad3eb4ec83
//Contract name: IdiotTokenSale
//Balance: 0 Ether
//Verification Date: 10/26/2017
//Transacion Count: 4
// CODE STARTS HERE
pragma solidity ^0.4.13;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns... | 30% Idiot Foundation as working capital 20% Founders, locked away for a year 10% Angel investors & advisors 40% crowdsale | function setup() public onlyOwner returns(bool success){
require(!setupDone);
token.transferInitialAllocation(owner, 22800000*MULTIPLIER);
token.transferInitialAllocationWithTimedLock(founder1, 7600000*MULTIPLIER, now + 365 days);
token.transferInitialAllocationWithTimedLock(founder2, 7600000*MULTI... | 2,513,848 |
./partial_match/1/0xD7DCa59C59cf0B407f292341f99901B5e7e2f91C/sources/lib/solady/src/utils/FixedPointMathLib.sol | Exponentiate `x` to `y` by squaring, denominated in base `b`. Reverts if the computation overflows. | function rpow(uint256 x, uint256 y, uint256 b) internal pure returns (uint256 z) {
assembly {
z := mul(b, iszero(y))
if x {
z := xor(b, mul(xor(b, x), and(y, 1)))
let half := shr(1, b)
let xx := mul(x, x)
let xxR... | 4,412,832 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
// Flight status codees
uint8 private constant STATUS_CODE_UNKNOWN = 0;
uint8 private constant STATUS_CODE_ON_TIME = 10;
uint8 private const... | Initial funding for the insurance. Unless there are too many delayed flights resulting in insurance payouts, the contract should be self-sustaining/ | function fund
(address origin)
public
payable
isAuthorizedCaller
requireIsOperational
{
if (msg.value >= 10 ether) {
airlines[origin].isFunded = true;
}
}
| 12,824,571 |
/*
* Origin Protocol
* https://originprotocol.com
*
* Released under the MIT license
* https://github.com/OriginProtocol/origin-dollar
*
* Copyright 2020 Origin Protocol, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files ... | Calculate the total value of assets held by the Vault and all strategies and update the supply of OUSD./ | function rebase() public whenNotRebasePaused nonReentrant {
_rebase();
}
| 1,140,813 |
./full_match/80001/0x1557082B5C2c09a8Ec38a4b0B53479F29319B9f9/sources/contracts/1_Storage.sol | Refund the bid money emit TexugoBidWithdrawn(tokenId, texugoBids[tokenId].value, _msgSender()); | function withdrawBidForTexugo(uint256 tokenId) public {
require(tokenId < MAX_SUPPLY, "Out");
require(ownerOf(tokenId) != _msgSender(), "Invalid");
require(texugoBids[tokenId].bidder == _msgSender(), "Invalid");
texugoBids[tokenId] = Bid(false, tokenId, address(0), 0);
requir... | 5,592,907 |
./full_match/1/0xb176F411fF4F4A74Deb0Ab03379c8af49bE91d3e/sources/contracts/dOTC/SwarmDOTCEscrow.sol | Sets initial the deposit of the maker. Requirements: - sender must be assinged ESCROW_MANAGER_ROLE and Also DOTC_ADMIN_ROLE - escrow must not be frozen _offerId uint256 the offer ID/ | function setMakerDeposit(uint256 _offerId) external onlyEscrowManager escrowNotFrozen {
(, address cpk) = IdOTC(dOTC).getOfferOwner(_offerId);
deposits[_offerId] = OfferDeposit(_offerId, cpk, IdOTC(dOTC).getOffer(_offerId).amountInAmountOut[0], false);
}
| 9,757,797 |
./partial_match/1/0x47b09149a8E138789421dB1EdE366cdAB3cc9Ebb/sources/direct_staking.sol | admin exit a validator in emergency, and return it's principal to validator owner, optionally to exit unclaimed mev rewards to claim address. NOTE: a user must have contact with us to perform this operation./ | function emergencyExit(uint256 validatorId, bool exitToClaimAddress) external onlyShanghai onlyRole(DEFAULT_ADMIN_ROLE) {
_emergencyExit(validatorId, exitToClaimAddress);
}
| 9,143,289 |
pragma solidity >=0.4.25 <0.6.0;
import './RawMatrials.sol';
import './Product.sol';
// We import this library to be able to use console.log
import "@nomiclabs/buidler/console.sol";
/// @title Blockchain : Pharmaceutical SupplyChain
/// @author Kamal Kishor Mehra
contract SupplyChain {
/// @notice
address ... | Register New user by Owner EthAddress Ethereum Network Address of User Name User name Location User Location Role User Role | function registerUser(
address EthAddress,
string memory Name,
string memory Location,
uint Role
) public
onlyOwner
{
require(UsersDetails[EthAddress].role == roles.norole, "User Already registered");
UsersDetails[EthAddress].name = Name;
... | 12,917,772 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.7.0;
pragma experimental ABIEncoderV2;
// File: witnet-ethereum-block-relay/contracts/BlockRelayInterface.sol
/**
* @title Block Relay Interface
* @notice Interface of a Block Relay to a Witnet network
* It defines how to interact with the Block Relay in o... | Decode a raw error from a `Result` as a `uint64[]`. _result An instance of `Result`. return The `uint64[]` raw error as decoded from the `Result`./ | function asRawError(Result memory _result) public pure returns(uint64[] memory) {
require(!_result.success, "Tried to read error code from successful Result");
return _result.cborValue.decodeUint64Array();
}
| 901,273 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
pragma abicoder v2;
interface IPayment {
function collectETH() external returns (uint amount);
function collectTokens(address token) external returns (uint amount);
}
interface IforbitspaceX is IPayment {
struct SwapParam {
address addressToAp... | 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 aggregate(
address tokenIn,
address tokenOut,
uint amountInTotal,
address recipient,
SwapParam[] calldata params
) external payable returns (uint amountInAcutual, uint amountOutAcutual);
}
}
function isContract(address account) internal view returns (bool) {
uint size;
assembly {
size :=... | 406,678 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, s... | transfer an array of tokens from '_from' address to '_to' address/ | function batchTransferFrom(
address _from,
address _to,
uint256[] memory _tIds
) public {
for (uint256 i = 0; i < _tIds.length; i++) {
transferFrom(_from, _to, _tIds[i]);
}
}
| 13,679,441 |
./full_match/5/0x5137ABFf24ad5b7f8079F7f9BfCDB5645e490526/sources/project_/contracts/ERC1644/ERC1644.sol | Change of ownership of tokens by an authorized operator/ controller @partam _from sender's address _to Receiver's address _value Amount of tokens _data Additional transfer metadata _operatorData Additional operator metadata | function controllerTransfer(address _from, address _to, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external onlyController {
require(controlled, "Token control features has been disabled");
_transferByPartition(_from, _to, defaultPartition, _value, _data, msg.sender, _opera... | 11,594,545 |
./partial_match/42/0x96e9A12EAD359dd70517aC48Fb66e9DDA76dA6Bf/sources/ThePoolz.sol | not/allow contract to receive funds | function() public payable {
if (!IsPayble) revert();
}
event TransferOutETH(uint256 Amount, address To);
event TransferInETH(uint256 Amount, address From);
bool internal IsPayble;
uint256 internal MinETH;
| 8,999,126 |
./full_match/3/0x3Dc329b324cDC77aC885740B524F82d066Ca0d0b/sources/stakingOliver/UBXTStaking.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 ubxtRewardBalance = IERC20(token).balanceOf(address(this)).sub(totalStakedUBXT);
uint256 _totalUBXTReward = to... | 8,239,126 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/// @title Crowdfunding.
/// @author andres15alvarez
/// @notice With this contract you cand fund a project or create one.
/// After a project has finihsed, a percentage going to the addres that deployed the contract.
contract Crowdfunding{
mapp... | Obtain the project current amount funded. projectId Id of the project. return amount amount funded in wei. | function getProjectAmount(uint projectId) public view validProject(projectId) returns (uint){
return projects[projectId].amount;
}
| 1,758,371 |
pragma solidity ^0.4.24;
import "./openzeppelin/contracts/math/SafeMath.sol";
import "./openzeppelin/contracts/token/ERC20/ERC20.sol";
import "./openzeppelin/contracts/ownership/Ownable.sol";
import "./EtherDollar.sol";
import "./Liquidator.sol";
import "./Finance.sol";
/**
* @title Erc20Bank contract.
*/
contract... | pay a part of the collateral to the auction's winner. loanId The loan id. collateral The bid of winner. buyer The winner account./ | function liquidated(uint256 loanId, uint256 collateral, address buyer)
external
onlyLiquidator
checkLoanStates(loanId, LoanStates.UNDER_LIQUIDATION)
returns (bool)
{
require (collateral <= loans[loanId].collateralAmount, INVALID_AMOUNT);
loans[loanId].collateralA... | 1,036,938 |
// SPDX-License-Identifier: Apache License, Version 2.0
pragma solidity ^0.6.10;
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { ISetToken } from "../interfaces/ISetToken.sol";
import { IIndexModule } from "../interfaces/IIndexModule.sol";
import { IStreamingFeeModule } from "../interface... | OPERATOR OR METHODOLOGIST ONLY: Update the fee recipient address. Operator and Methodologist must each call this function to execute the update. _newFeeRecipient New fee recipient address/ | function updateFeeRecipient(address _newFeeRecipient) external mutualUpgrade(operator, methodologist) {
feeModule.updateFeeRecipient(setToken, _newFeeRecipient);
}
| 1,010,038 |
./partial_match/1/0xa22cf004eD5105608b39c48bE688BD9B9026a046/sources/FeePool.sol | Allow synthetix to trigger a token fallback call from our synths so users get notified on exchange as well as transfer | function triggerTokenFallbackIfNeeded(address sender, address recipient, uint amount)
external
onlySynthetixOrFeePool
{
bytes memory empty;
callTokenFallbackIfNeeded(sender, recipient, amount, empty);
}
| 4,057,300 |
./partial_match/1/0x10236bD758ad2f8017839dC8f7d9840d0F531a4D/sources/tonycoin.sol | Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ... | function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
... | 2,845,614 |
// 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,... | Checks whether an asset is a supported derivative _asset The asset to check return isSupported_ True if the asset is a supported derivative | function isSupportedDerivativeAsset(address _asset)
public
view
override
returns (bool isSupported_)
{
return getPriceFeedForDerivative(_asset) != address(0);
}
| 1,406,605 |
/**
* Copyright 2017–2018, bZeroX, LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
import "openzeppelin-solidity/contracts/math/Math.sol";
import "../proxy/BZxProxiable.sol";
import "../shared/InternalFunctions.sol";
import ... | get positionList index replace loan in list with last loan in array update the position of this replacement | function _removePosition(
bytes32 loanOrderHash,
address trader)
internal
if (positionListIndex[positionId].isSet) {
assert(positionList.length > 0);
if (positionList.length > 1) {
uint index = positionListIndex[positionId].index;
... | 6,393,738 |
./full_match/43113/0x2692eE7d475dc6256a9029dD3cbcee1FB9948DB3/sources/multisigooooof.sol | Retracts an attestation log associated with the sender's address with the `limit` and action code VOTE_TO_CHANGE_KEYHOLDER_LIMIT. limit The amount the caller was voting to change the limit to and wants retracted. | function retractVoteToChangeKeyholderLimit(uint256 limit)
external
onlyKeyholder
{
ActionCode actionCode = ActionCode.VOTE_TO_CHANGE_KEYHOLDER_LIMIT;
bytes32 hash = packAndHash(limit);
delete attestations[msg.sender][actionCode][hash];
emit AttestationRevoked(msg... | 7,118,009 |
./full_match/5/0x18a674cfa613bebadB8f9227F654E055a925f49a/sources/contracts/Contract.sol | Iterate through allEHRs to find EHRs shared with the specified receiver Resize the sharedEHRs array to remove empty slots | function getSharedEHRsWithReceiver(address _receiver) public view returns (sharedEHR[] memory) {
sharedEHR[] memory sharedEHRs = new sharedEHR[](allEHRs.length);
uint256 count = 0;
for (uint256 i = 0; i < allEHRs.length; i++) {
if (allEHRs[i].receiver == _receiver) {
... | 1,953,996 |
pragma solidity 0.5.0;
pragma experimental ABIEncoderV2;
import "./oraclizeAPI.sol";
contract deal{
uint public value;
address payable public seller;
address payable public buyer;
uint public landID;
constructor(uint _landID, address payable _buyer , uint _price) public {
... | uint l = landRecords[_owner].length; | function landAssignment(address _owner, uint _n, string[] memory _vertices) public {
require(msg.sender==registryOffice,"Only registry Office can create new land records");
point memory p;
landRecords[landCount] = tempLandRecord;
for( uint i=0;i<2*_n;i=i+2){
p.lati... | 15,819,721 |
./full_match/80001/0xf4Bf35F8f17cAf2ee780e9BD6Ee4a6c5Eb61b6C2/sources/project:/contracts/superfluid/ConstantInflowNFT.sol | @inheritdoc FlowNFTBase | function _ownerOf(uint256 tokenId) internal view override returns (address) {
FlowNFTData memory flowData = flowDataByTokenId(tokenId);
return flowData.flowReceiver;
}
| 9,524,850 |
pragma solidity 0.5.16;
import {DogeDepositsManager} from "./DogeDepositsManager.sol";
import {DogeSuperblocks} from "./DogeSuperblocks.sol";
import {DogeBattleManager} from "./DogeBattleManager.sol";
import {DogeMessageLibrary} from "./DogeParser/DogeMessageLibrary.sol";
import {DogeErrorCodes} from "./DogeErrorCodes... | – confirm semi approved superblock. A semi approved superblock can be confirmed if it has several descendant superblocks that are also semi-approved. If none of the descendants were challenged they will also be confirmed. superblockHash – the claim ID. descendantId - claim ID descendants | function confirmClaim(bytes32 superblockHash, bytes32 descendantId) public returns (bool) {
uint numSuperblocks = 0;
bool confirmDescendants = true;
bytes32 id = descendantId;
SuperblockClaim storage claim = claims[id];
while (id != superblockHash) {
if (!claimExi... | 12,799,447 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.