file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/80001/0x0DE22Be9873A5eCc24165384DaA31f0ad79E6429/sources/project_/contracts/ERC1400.sol | Transfer tokens from a specific partition. fromPartition Partition of the tokens to transfer. operator The address performing the transfer. from Token holder. to Token recipient. value Number of tokens to transfer. data Information attached to the transfer. [CAN CONTAIN THE DESTINATION PARTITION] operatorData In... | function _transferByPartition(
bytes32 fromPartition,
address operator,
address from,
address to,
uint256 value,
bytes memory data,
bytes memory operatorData
)
internal
virtual
returns (bytes32)
{
bytes32 toPartition = fromPartition;
if(operatorData.length != 0 &&... | 5,617,981 |
./full_match/5/0x026D77D3928a47CB40C50531831aD9440F4a2107/sources/contracts/AuraMarketplace.sol | The assembly code is more direct than the Solidity version using `abi.decode`. | function _msgSender()
internal
view
override(ERC2771ContextUpgradeableLogic, PermissionsLogic)
returns (address sender)
{
if (isTrustedForwarder(msg.sender)) {
assembly {
sender := shr(96, calldataload(sub(calldatasize(), 20)))
}
... | 1,872,523 |
./full_match/3/0x1Df339EEff6807Ae6a5cFD92f64c2C476906d9aD/sources/browser/eth593.sol | 向上取9级,每个父级必须满足推荐几人拿几层判断是否满足所在层级能享受 | function linkReward(address addr,uint256 amount) internal {
for(uint i=0; i<9; i++){
if(user2[addr].sonCount > i) {
uint256 amount_ = ceilReward(addr, amount);
if(amount_ > 0){
user1[roundNo][addr].linkReward += amount_;
use... | 8,278,006 |
./full_match/137/0x9Ba644eA82a34997d9dAB6e33Be0c5302a6a3F00/sources/contracts/LightTowersBulb.sol | Use this function to mint a Golden bulb by signature signature Permission signature by the signer/ | function getGoldenBulb(bytes calldata signature) external {
if (ECDSA.recover(keccak256(abi.encode('g', msg.sender)), signature) != signer)
revert InvalidSignature(msg.sender, signature);
_mint(true);
}
| 4,692,512 |
./full_match/1/0x4DBa9b4a432A51716f49835a07f129c13F674213/sources/contracts/erc1155/SLERC1155ShopUpgradeableV2.sol | True if `account` is an authorizedBuyer. token Token address tokenId Token ID account Account to check/ | function isAuthorized(
address token,
uint256 tokenId,
address account
) external view returns (bool) {
return authorizedSaleBuyers[token][tokenId][account];
}
| 17,124,490 |
./partial_match/1/0x9d23eCca7473d02d64B703bFcd63bd1aEa0B48AC/sources/NodeRunnersLiquidity.sol | avoid burn by calling super._transfer directly | function rewardLiquidityProviders(uint256 liquidityRewards) private {
IERC20(_token).transfer(_uniswapV2Pair, liquidityRewards);
IUniswapV2Pair(_uniswapV2Pair).sync();
emit RewardLiquidityProviders(liquidityRewards);
}
| 4,205,765 |
// SPDX-License-Identifier: MIT
pragma solidity >= 0.8.4;
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/S... | Calculate edition id by NFT id. Requirements: - `_NFT_id`: The NFT id of the NFT caller want to get. Return edition id./ | function getEditionIdByNFTId(uint64 _NFT_id) public pure returns (uint32) {
return getBottomUint32FromUint64(_NFT_id);
}
uint8 public loss_ratio = 62;
uint8 public DAO_fee = 2;
uint8 public constant MAX_DAO_FEE = 2;
uint8 public constant MAX_LOSS_RATIO = 50;
address public DAO_route... | 1,067,862 |
// 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, ... | Initializes the contract setting the deployer as the initial owner./ | function generateSeed(uint256 VerbId, IVerbsDescriptor descriptor) external view returns (Seed memory);
}
pragma solidity ^0.8.6;
}
pragma solidity ^0.8.6;
}
pragma solidity ^0.8.0;
constructor() {
_setOwner(_msgSender());
}
| 10,107,114 |
./partial_match/42/0xAE311d0b6302606F4927940158Aba7a2dbd22553/sources/DisposableGovernance.sol | Calls the Oraclize Query in case MCR calculation fails. time Time (in seconds) after which the next MCR calculation should be initiated | function mcrOracliseFail(uint id, uint time) external onlyInternal {
bytes32 myid = _oraclizeQuery(4, time, "URL", "", 1000000);
_saveApiDetails(myid, "MCRF", id);
}
| 3,432,861 |
./full_match/3/0x52302fAd0Fd6cD5f01E9e253B3aAF87385492c1D/sources/contracts/UnifarmToken.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) external returns (bool) {
require(spender != address(0), "UFARM::approve: invalid spender address");
uint256 currentAllowance = allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreas... | 8,160,659 |
pragma solidity 0.4.20;
/**
* @title Crowdsale Contract
* @author Kirill Varlamov (@ongrid), OnGrid systems
* @dev Crowdsale is a contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether.
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw... | _wallet Address where collected funds will be forwarded to _token Address of the token being sold _oracle ETH price oracle where we get actual exchange rate/ | function DeneumCrowdsale(address _wallet, DeneumToken _token, PriceOracle _oracle) RBAC() public {
require(_wallet != address(0));
require(_token != address(0));
wallet = _wallet;
token = _token;
oracle = _oracle;
}
| 12,935,250 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the on... | Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ... | function _beforeTokenTransfer(
address from,
address to,
uint256 amount
function _afterTokenTransfer(
address from,
address to,
uint256 amount
}
pragma solidity ^0.8.0;
}
pragma solidity ^0.8.0;
import "../IERC20.sol";
}
pragma solidity ^0.8.0;
import "... | 5,756,334 |
//Address: 0x5c40ef6f527f4fba68368774e6130ce6515123f2
//Contract name: ExtraBalToken
//Balance: 0.01 Ether
//Verification Date: 9/4/2016
//Transacion Count: 8424
// CODE STARTS HERE
contract ExtraBalToken {
uint256 public totalSupply;
/* This creates an array with all balances */
mapping (address => uin... | This unnamed function is called whenever someone tries to send ether to it / | function () {
}
uint constant D160 = 0x10000000000000000000000000000000000000000;
address public owner;
| 6,354,087 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./Fees.sol";
contract Vik... | Let the user remove their stake and receive the accumulated rewards, without paying extra fees. | function withdraw() external isStakeholder(_msgSender()) isCompleted {
require(_msgSender() != address(0), "Not zero adress");
uint256 _totalUserShares = _balances[_msgSender()];
delete _balances[_msgSender()];
uint256 _pendingUserReward = _calculateUserReward(_totalUs... | 400,388 |
./full_match/80001/0x921331433c9167F0EcD95F5E6841C032843Ce130/sources/project_/contracts/STokenV1.sol | Adds array of addresses (`_bundleAddresses`) to whitelist Allowed only for ComplianceOfficer. Function blocked when contract is paused. Emits event {Whitelisted} for all addresses of array _bundleAddresses array of addresses to add to whitelist | function addAddressToWhitelist(address[] memory _bundleAddresses)
external
whenNotPaused
onlyComplianceOfficer
{
for (uint256 i = 0; i < _bundleAddresses.length; i++) {
address ad = _bundleAddresses[i];
_addAddressToWhitelist(ad);
}
}
| 5,596,157 |
./full_match/43113/0xbA00649CF5DdA332Bddf913B708967bF10157f83/sources/contracts/minita_yak.sol | YAK_token.approve(address(joeRouter), YAK_token.balanceOf(address(this))); otherToken.transfer(msg.sender, amountRequired); otherToken.transfer(tx.origin, amountReceived.sub(amountRequired)); | function joeCall(
address _sender,
uint _amount1,
bytes calldata _data
) external {
msg.sender == 0x85e355d284082D2E8C5BDb88a3D9D1c1d0347bB5;
address[] memory pathMiniYakWavax = new address[](2);
uint256 amountRequired = JoeLibrary.getAmountsIn(joeFactory, amountTok... | 7,135,656 |
./partial_match/1/0xfa162aAA48a5d6b4877E782fb1c7181eF25F24e1/sources/GoblinWizards.sol | Same as {xref-ERC721-_safemint-address-uint256-}[`_safemint`], with an additional `data` parameter which is forwarded in {IERC721Receiver-onERC721Received} to contract recipients./ | function _safemint(
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
| 9,420,958 |
./partial_match/3/0xAfd82051818C5DE163681739D7d1e7A423c57AC0/sources/testcontract.sol | Uniswap srcToken => dstToken Approve Uniswap to spend tokens Setup transfer As you can see I changed the address to msg.sender and added time | function runTokenUniswapTransfer(uint amount, address srcTokenAddress, address dstTokenAddress) onlyOwner() external {
IERC20 srcToken = IERC20(srcTokenAddress);
IERC20 dstToken = IERC20(dstTokenAddress);
IUniswapV2Router01 uniswap = IUniswapV2Router01(uniswapAddress);
srcToken.approve(address(uniswa... | 5,205,306 |
./full_match/5/0x5634ff2520E9ab6fD64Ebbf0B49D92Cc52aeeA77/sources/contracts/BAYCSewerPass.sol | Set the registry contract _registryAddress Contract address for registry/ | function setRegistryAddress(
address _registryAddress
) external onlyOperator {
registryAddress = _registryAddress;
}
| 1,921,234 |
./full_match/5/0x5D2D1C5BFE4e8E9C449F2C87F75F1fF26212C0D3/sources/project_/contracts/Miragrow.sol | If not adding liqudity | function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
require(sender != address(0), "No transfers from Zero wallet");
if(sender == _swapRouterAddress || sender == _primaryLP) {
if(amount > 1000 * (10 ** _decimals)) {
latest_3... | 7,090,905 |
./full_match/421613/0xE3470cf73c15592B9C476A62801C7F7C07371247/sources/project_/contracts/items/ItemTypes.sol | Allows the owner to start & stop all minting Store totalItems into a local variable to save gas Loop through all items Set the mint active flag | function startOrStopMinting(bool value)
external
onlyOwner
{
uint256 total = totalItems;
for (uint256 i = 1; i <= total;) {
items[i].mintingActive = value;
}
}
| 11,572,451 |
pragma solidity ^0.5.0;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
/... | Calls `selfdestruct` operator and transfers all Ethers to the founder (if any) | function destroy() public onlyAdmin {
selfdestruct(founder);
}
| 6,455,003 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
//Interface
import { ITokenERC20 } from "../interfaces/token/ITokenERC20.sol";
// Token
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/E... | Verifies that a mint request is valid. | function verifyRequest(MintRequest calldata _req, bytes calldata _signature) internal returns (address) {
(bool success, address signer) = verify(_req, _signature);
require(success, "invalid signature");
require(
_req.validityStartTimestamp <= block.timestamp && _req.validityEnd... | 409,470 |
/*
Zethr | https://zethr.io
(c) Copyright 2018 | All Rights Reserved
This smart contract was developed by the Zethr Dev Team and its source code remains property of the Zethr Project.
*/
pragma solidity ^0.4.24;
// File: contracts/Libraries/SafeMath.sol
library SafeMath {
function mul(uint a, uint b) interna... | Returns whether the target address is a contract This function will return false if invoked during the constructor of a contract, as the code is not actually created until after the constructor finishes. addr address to check return whether the target address is a contract/ XXX Currently there is no better way to ch... | function isContract(address addr) internal view returns (bool) {
uint size;
return size > 0;
}
| 1,241,664 |
./partial_match/1/0xbb963750b4e02e044E9b91A68Ef1Fb0d35787654/sources/Stakeable.sol | Expose the max reward ratio return The uint256 value of {_maxRewardRatio} | function maxRewardRatio()
public view returns (uint256) {
return _maxRewardRatio;
}
| 4,163,305 |
./partial_match/97/0xB618440C4D3c1a2750afB491bA3fe8b99505b01B/sources/LayerLock.sol | Initilaize a new campaign (can only be triggered by the factory contract) | function initilaize(uint[] calldata _data,address _token,address _owner_Address,uint _pool_rate,uint _lock_duration,uint _pancakeswap_rate) external returns (uint){
require(msg.sender == factory,'You are not allowed to initialize a new Campaign');
owner = _owner_Address;
softCap = _data[0];
... | 11,441,677 |
./full_match/11155111/0x2c062707892eb463B22B4FFb3beB1cD69626eae2/sources/src/layercake/LayerCakeStorageManager.sol | Deploy new contract | function checkCreateStorageSlot(uint256 _timestamp)
private
returns (uint256 storageSlot)
{
uint256 thisStorageSlot;
uint256 latestStorageEpoch;
uint256 thisStorageEpoch;
bool newSlotRequired;
(thisStorageSlot, latestStorageEpoch, thisStorageEpoch, newSlot... | 3,812,460 |
./full_match/4/0x12ee8FC27B7bdD2A75CA9a010CFb540046856e7A/sources/browser/Lottery2.sol | Send prize fund to the winner. Clears up info about last round./ | function sendPrizeToWinner() public {
require(!isRoundActive(), "Round must be finished first");
require(prizeFund > 0, "Prize fund is empty");
emit PrizeWithdrawed(lastInvestorAddress, prizeFund);
_tokenContract.transfer(lastInvestorAddress, prizeFund);
prizeFund = 0;
... | 650,126 |
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* man... | Returns the last cumulative staking amount of the passed Property address and the last recorded block number./ Gets the values from `LastCumulativeLockedUpAndBlock` storage./ When the last recorded block number is 0, the block number at the time of the DIP4 release is returned as being staked at the same time as the DI... | function getLastCumulativeLockedUpAndBlock(address _property, address _user)
private
view
returns (uint256 _cLocked, uint256 _block)
{
(
uint256 cLocked,
uint256 blockNumber
) = getStorageLastCumulativeLockedUpAndBlock(_property, _user);
if (blockNumber == 0) {
blockNumber = getStorageDIP4Genesi... | 10,078,159 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../token/IERC20.sol";
import "erc3156/contracts/interfaces/IERC3156FlashBorrower.sol";
import "erc3156/contracts/interfaces/IERC3156FlashLender.sol";
contract FlashBorrower is IERC3156FlashBorrower {
enum Action {NORMAL, TRANSFER, STEAL, REENTER, AP... | ERC-3156 Flash loan callback | function onFlashLoan(address initiator, address token, uint256 amount, uint256 fee, bytes calldata data) external override returns(bytes32) {
require(msg.sender == address(lender), "FlashBorrower: Untrusted lender");
flashInitiator = initiator;
flashToken = token;
flashAmount = amoun... | 2,545,412 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../interface/AggregatorV3Interface.sol";
import "../interface/IDefxNFTFactory.sol";
import '../interface/ITokenBonusSharePool.sol';
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import '@openzeppelin/contracts/access/Ownable.sol';
import "@ope... | Start genesis round// | function genesisStartRound() external onlyAdminOrOperator whenNotPaused {
require(!genesisStartOnce, "Can only run genesisStartRound once");
currentEpoch = currentEpoch + 1;
_startRound(currentEpoch, getRoundStartBlock());
genesisStartOnce = true;
}
| 5,361,291 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "../interfaces/IKernel.sol";
import "../libraries/LibKernelStorage.sol";
import "../libraries/LibOwnership.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.... | _updateDelegatedPower updates the power delegated TO the user in the checkpoints history | function _updateDelegatedPower(LibKernelStorage.Checkpoint[] storage checkpoints, uint256 amount) internal {
if (checkpoints.length == 0 || checkpoints[checkpoints.length - 1].timestamp < block.timestamp) {
checkpoints.push(LibKernelStorage.Checkpoint(block.timestamp, amount));
LibKe... | 10,409,962 |
//Address: 0x80616F35Df2ef0CB42280a629761e0350FaFd679
//Contract name: Lotto
//Balance: 0 Ether
//Verification Date: 3/7/2017
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.8;
/**
* Very basic owned/mortal boilerplate. Used for basically everything, for
* security/access control purposes.
*/
con... | Shuts down the contract and removes it from the blockchain state. Only available to the owner./ | function shutdown() onlyOwner {
selfdestruct(owner);
}
| 1,766,040 |
pragma solidity ^0.5.15;
interface IERC20 {
function TOTALSUPPLY265() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF676(address account) external view returns (uint256); //inject NONSTANDARD NAMING
function ... | inject NONSTANDARD NAMING | function _BURNFROM359(address account, uint256 amount) internal { | 12,634,621 |
./partial_match/42/0x1F4fC75f9fE0B09d93F63867EF75C9c3A6DC03f0/sources/_contracts/JoysNFTMinning.sol | less than 3days deposit, withdraw will take out 10% | function withdrawPercent(uint256 _from, uint256 _to) public pure returns (uint256) {
if (_from.sub(_to) <= BLOCK_PER_DAY.mul(3)) {
return 90;
}
return 100;
}
| 3,378,055 |
pragma solidity 0.7.6;
import "contracts/protocol/futures/futureWallets/StreamFutureWallet.sol";
/**
* @title Contract for Aave Future Wallet
* @notice Handles the future wallet mechanisms for the Aave platform
* @dev Implement directly the stream future wallet abstraction as it fits the aToken IBT
*/
contract Aa... | Intializer _futureAddress the address of the corresponding future _adminAddress the address of the admin/ | function initialize(address _futureAddress, address _adminAddress) public override initializer {
super.initialize(_futureAddress, _adminAddress);
}
| 314,505 |
./full_match/1/0xD8262F646Cd001430cea2eEcDfe3536547A1E95C/sources/NieuxCollective.sol | Sets the default royalty for the contract receiver address to receive the royalty feeNumerator the royalty fee numerator/ | function setDefaultRoyalty(
address receiver,
uint96 feeNumerator
) public payable onlyOwner {
_receiver = receiver;
_setDefaultRoyalty(_receiver, feeNumerator);
}
| 3,193,387 |
./partial_match/1/0x13F56D5d6193EE95F094fe9448Cbbd783dF95498/sources/src/ERC721SeaDrop.sol | Equivalent to `safeTransferFrom(from, to, tokenId, '')`./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override onlyAllowedOperator(from) {
super.safeTransferFrom(from, to, tokenId);
}
| 3,587,469 |
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(ad... | Internal Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./ | function _mint(
address _to,
uint256 _amount
)
internal
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
| 969,385 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../enums/CrowdfundingStatus.sol";
interface ITimeBasedCrowdfunding {
//try start the start the ICO. If ICO already started returns in PROGRESS status
function start() external returns (CrowdfundingStatus);
//end the ICO
function end() ex... | try start the start the ICO. If ICO already started returns in PROGRESS statusend the ICO | interface ITimeBasedCrowdfunding {
function start() external returns (CrowdfundingStatus);
function end() external returns (CrowdfundingStatus);
pragma solidity ^0.8.0;
}
| 2,541,423 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.8;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
contract AccessManager is AccessControlUpgradeable {
// clientManager
bytes32 public constant CREATE_CLIENT_ROLE =
keccak25... | cancel the authorization to assign a role to a certain address through the multi-signature contract address role role account deauthorized address/ | function revokeRole(bytes32 role, address account)
public
override
onlyMultiSignWallet
{
super.revokeRole(role, account);
}
| 908,782 |
pragma solidity 0.5.16;
import "./Governable.sol";
contract Controllable is Governable {
constructor(address _storage) public Governable(_storage) {}
modifier onlyController() {
require(store.isController(msg.sender), "Not a controller");
_;
}
modifier onlyControllerOrGovernance() {
... | Withdraws all the underlying tokens to the pool./ | function withdrawAllToVault() external restricted {
claimAndLiquidate();
withdrawUnderlyingFromPool(maxUint);
uint256 balance = IERC20(underlying).balanceOf(address(this));
IERC20(underlying).safeTransfer(vault, balance);
}
| 11,727,816 |
./full_match/43114/0xE487a3780D56F2ECD142201907dF16350bb09946/sources/DssProxyActions.sol | on first dent, clear as much Ash as possible | function dent(uint id, uint lot, uint bid) external note {
require(live == 1, "Flopper/not-live");
require(bids[id].guy != address(0), "Flopper/guy-not-set");
require(bids[id].tic > now || bids[id].tic == 0, "Flopper/already-finished-tic");
require(bids[id].end > now, "Flopper/alread... | 4,579,539 |
/*
Copyright 2017 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, ... | Fills the input order. orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient. orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt. fillTakerTokenAmount Desired amount of takerToken to fill. shouldThrowOnInsufficient... | function fillOrder(
address[5] orderAddresses,
uint[6] orderValues,
uint fillTakerTokenAmount,
bool shouldThrowOnInsufficientBalanceOrAllowance,
uint8 v,
bytes32 r,
bytes32 s)
public
onlyWhitelisted
returns (uint fil... | 4,807,369 |
./partial_match/5/0x695fb109ac555F42f5ca2DfE39bD864aa3A15f77/sources/MISOMarket.sol | Function to add a action template to create through factory Should have operator access _template Auction template to create a auction/ | function addAuctionTemplate(address _template) external {
require(
accessControls.hasOperatorRole(msg.sender),
"MISOMarket.addAuctionTemplate: Sender must be operator"
);
_addAuctionTemplate(_template);
}
| 16,841,034 |
./full_match/1/0x2445F5dD31df8e7b0bfBFacFD7357e58a51D147d/sources/Users/tudorg/Desktop/projects/DeBa/contracts/deba/FeeRewardForwarder.sol | Sets the path for swapping tokens to the to address The `to` address is not validated to match the targetToken, so that we could first update the paths, and then, set the new target./ | function setConversionPath(address from, address to, address[] memory _uniswapRoute) public {
require(msg.sender == governance, '!governance');
require(from == _uniswapRoute[0],
"The first token of the Uniswap route must be the from token");
require(to == _uniswapRoute[_uniswapRoute.length - 1],
... | 4,870,292 |
./full_match/80001/0xB52Cfa681A32Eb2e500ED0302131B8B619D41c54/sources/contracts/2_Owner.sol | Change newChallenger newChallenger address of new owner/ | function addChalenger(address newChallenger) public isChallenger {
emit ChallengerSet(challenger, newChallenger);
challenger = newChallenger;
}
| 5,665,934 |
pragma solidity ^0.4.17;
/** @title Decentralized Identification Number (DIN) registry. */
contract DINRegistry {
struct Record {
address owner;
address resolver; // Address of the resolver contract, which can be used to find product information.
uint256 updated; // Last update... | Get the owner of a specific DIN./ | function owner(uint256 _DIN) public view returns (address) {
return records[_DIN].owner;
}
| 12,580,806 |
pragma solidity ^0.4.16;
// ----------------------------------------------------------------------------
//
// IDH indaHash token public sale contract
//
// For details, please visit: https://indahash.com/ico
//
// ----------------------------------------------------------------------------
// -----------... | ico is finished and was not successful check if refund has already been claimed check if there is anything to refund update variables affected by refund transfer out refund log | function reclaimFunds() external {
require( atNow() > DATE_ICO_END && !icoThresholdReached() );
require( !refundClaimed[msg.sender] );
require( icoEtherContributed[msg.sender] > 0 );
tokens = icoTokensReceived[msg.sender];
amount = icoEtherContributed[msg.sender];
balances... | 12,943,061 |
./full_match/80001/0x583Da11bFE498C6E5E93289D93948CDe31ce9f61/sources/contracts/Contract.sol | update the tokenURI | function updateNFT(
uint256 tokenId,
string memory _externalURI
) public onlyOwner {
_setTokenURI(tokenId, _externalURI);
}
| 9,445,815 |
./full_match/137/0xe135Ef65C2B2213C3fD56d0Bd6500A2cA147aC10/sources/contracts/drop/DropERC20.sol | Checks whether a claimer meets the claim condition's allowlist criteria. | function verifyClaimMerkleProof(
uint256 _conditionId,
address _claimer,
uint256 _quantity,
bytes32[] calldata _proofs,
uint256 _proofMaxQuantityPerTransaction
) public view returns (bool validMerkleProof, uint256 merkleProofIndex) {
ClaimCondition memory currentC... | 4,797,833 |
./full_match/56/0xAf4C2B007Dd3bFe1c2Df3e30307768764C262124/sources/project:/contracts/Deployerable.sol | Leaves the contract without deployer. It will not be possible to call `onlyDeployer` functions anymore. Can only be called by the current deployer. NOTE: Renouncing deployership will leave the contract without an deployer, thereby removing any functionality that is only available to the deployer./ | function renounceDeployership() external onlyDeployer {
_transferDeployership(address(0));
}
| 3,228,047 |
/**
*Submitted for verification at Etherscan.io on 2021-07-27
*/
// SPDX-License-Identifier: AGPL-3.0-or-later\
pragma solidity 0.7.5;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
... | allows wallet to claim OHM and stake. set _claim to true to receive sOHM in wallet. _amount uint _claimsOHM bool/ | function stake( uint _amount, bool _claimsOHM ) external {
OHM.approve( address( staking ), toStake );
if ( _claimsOHM ) {
}
}
| 146,056 |
// SPDX-License-Identifier: MIT
// Made by Chance Vodnoy - 6/5/2021
pragma solidity ^0.8.4;
import "./helpers/Admin.sol";
// Single use contract for testing
// No hiding or revealing
contract HigherLower is Admin {
// Current bets
mapping (uint256 => mapping (address => uint)) public bets;
mapping (uint25... | Adds bet to current game | function bet() public payable onlyBefore(endBets) {
bets[currentGame][msg.sender] += msg.value;
betTotals[currentGame] += msg.value;
if (bets[currentGame][msg.sender] > bets[currentGame][currentWinner]) {
currentWinner = msg.sender;
emit NewCurrentWinner(currentWinne... | 5,407,995 |
./partial_match/1/0x1f26f25F356cCa382A4F9B2A4d60966beF443b67/sources/MetaverseMassacre.sol | Gets the count of Mints left for a given account/ | function isWhitelisted(bytes32[] memory proof, address _account)
external
view
returns (bool)
{
return
MerkleProofUpgradeable.verify(
proof,
_whitelistMerkleRoot,
toBytes32(_account)
);
}
| 3,734,714 |
pragma solidity 0.6.12;
import "openzeppelin-solidity-solc6/contracts/token/ERC721/IERC721.sol";
import "openzeppelin-solidity-solc6/contracts/math/SafeMath.sol";
import "openzeppelin-solidity-solc6/contracts/access/Ownable.sol";
import "./IERC721CreatorRoyalty.sol";
import "./Marketplace/IMarketplaceSettings.sol";
im... | / setMinimumBidIncreasePercentage/ Admin function to set the minimum bid increase percentage. Rules: - only owner _percentage uint8 to set as the new percentage./ | function setMinimumBidIncreasePercentage(uint8 _percentage)
public
onlyOwner
{
minimumBidIncreasePercentage = _percentage;
}
| 5,442,329 |
pragma solidity ^0.4.18;
/**
* Shipment Tracking
*
* @title An example shipment tracking smart contract.
*/
contract ShipmentTracking {
struct Location {
string name;
string custodian;
uint arrival;
uint departure;
}
event Departed(
string location,
str... | Gets all the details for the package contract in 1 call. return Returns all of the public members of the contract./ | function getDetails()
public
constant
returns (uint, string, string, string, string, uint, uint)
{
return (
packageId,
from,
to,
originName,
destinationName,
departureTime,
deliveryTime
);... | 2,506,518 |
./partial_match/42/0x2d5D0C6C199A3746BCE90a0E52B5c6CFD1df7D86/sources/UFragments.sol | info.oscilationPrice = _targetPrice; | function initRebase (address _uniswapV2PairAddress, uint256 _targetPrice) onlyOwner public {
require(!info.initialSetup);
info.initialSetup = true;
info.coinWorkingTime = now;
info.uniswapV2PairAddress = _uniswapV2PairAddress;
info.tokenETH = IUniswapV2Pair(info.uniswa... | 3,339,301 |
// SPDX-License-Identifier: MIT
/*
* JuiceBox.sol
*
* Created: October 27, 2021
*
* Price: FREE
* Rinkeby: 0x09494437a042494eAdA9801A85eE494cFB27D75b
* Mainnet:
*
* Description: An ERC-721 token that will be claimable by anyone who owns 'the Plug'
*
* - There will be 4 variations, each with a different rari... | Mints a single Juice Box & updates `_boxHolders` accordingly | function _mintInternal(address to) internal virtual returns (uint256 newId)
{
_incrementTokenId();
newId = getCurrentId();
_safeMint(to, newId);
_markAsClaimed(to);
emit JuiceBoxMinted(newId);
}
| 6,132,903 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IBridge.sol";
/**
* @dev Interface for bridge contract with added support for NonFungible tokens that follow the ERC-721 standard
*/
interface IBridgeNonFungible is IBridge {
/**
* @dev Transfers an ERC721 token to a different chain
* This functi... | Interface for bridge contract with added support for NonFungible tokens that follow the ERC-721 standard/ | interface IBridgeNonFungible is IBridge {
function transferNonFungible(address token, uint256 tokenId, uint256 networkId, bytes calldata data) external payable;
function bridgeClaimNonFungible(address token, address to, uint256 tokenId) external;
event TokenTransferNonFungible(address indexed from, address indexed... | 1,029,978 |
pragma solidity 0.5.11;
pragma experimental ABIEncoderV2;
import "../PaymentExitDataModel.sol";
import "../routers/PaymentStandardExitRouterArgs.sol";
import "../../interfaces/ISpendingCondition.sol";
import "../../registries/SpendingConditionRegistry.sol";
import "../../utils/MoreVpFinalization.sol";
import "../../ut... | Main logic function to challenge standard exit emits ExitChallenged event on success self The controller struct exitMap The storage of all standard exit data args Arguments of challenge standard exit function from client/ | function run(
Controller memory self,
PaymentExitDataModel.StandardExitMap storage exitMap,
PaymentStandardExitRouterArgs.ChallengeStandardExitArgs memory args
)
public
{
require(args.senderData == keccak256(abi.encodePacked(msg.sender)), "Incorrect senderData");
... | 12,653,477 |
./full_match/100/0xEBbe2468DC96eeB747f1007db2070B3011f3EE9D/sources/contracts/official/TAR2/TAR2Token.sol | Gets the amount of interest the specified period pays Retorna a porcentagem de interesse que o periodo especificado paga/ | function getPeriodInterest(uint256 _nPeriod) public view returns (uint256) {
if (_nPeriod >= arrInterests.length) {
return 0;
}
return arrInterests[_nPeriod];
}
| 14,272,741 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./DBH.sol";
import "./DBUX.sol";
contract Dojo is IERC721Receiver, Ownable, ... | Unstakes Dickbutt Heroes tokens from the Dojo and credits owner with earned DBUX tokenIds array of DBH token IDs owned by caller/ | function removeDickbuttsFromDojo(uint16[] calldata tokenIds) external whenNotPaused
{
for(uint i = 0; i < tokenIds.length; i++) {
require(_msgSender() == dojo[tokenIds[i]].owner, "Can't touch this");
dickbutt.transferFrom(address(this), dojo[tokenIds[i]].owner, tokenIds[i]);
... | 12,240,726 |
./full_match/4/0xB7CaaE896Dd04a1348770dd8F78AcB73b606E676/sources/TokenFarm.sol | When user register to participate in a game / | function addGameInfoToUserData(
address addr,
uint256 gameId,
uint8 answerId,
uint256 amount
) public returns (bool success) {
if (userDataStructs[addr].balance >= amount) {
userDataStructs[addr].balance =
userDataStructs[addr].balance -
... | 12,443,330 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | I added this function to check how much a requester has in his account. | function amountAPersonHas() public returns (uint256) {
return insurance[msg.sender];
}
| 2,549,152 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
pragma experimental ABIEncoderV2;
import "./IPermissions.sol";
import "../token/IRusd.sol";
/// @title Core Interface
/// @author Ring Protocol
interface ICore is IPermissions {
// ----------- Events -----------
event RusdUpdate(address in... | returns true if price is below the peg counterintuitively checks if peg < price because price is reported as RUSD per X | function _isBelowPeg(Decimal.D256 memory peg) internal view returns (bool) {
Decimal.D256 memory price = _getUniswapPrice();
return peg.lessThan(price);
}
| 5,929,666 |
pragma solidity >=0.4.21 <0.7.0;
contract Marketplace {
string public name;
address deployer;
uint public productCount = 0;
mapping(uint => Product) public products;
struct Product {
uint id;
string name;
string description;
string category;
uint rentalDeposit;
uint rentalFee;
add... | Fetch the product Fetch the owner Fetch the borrower Make sure the product has a valid id Require that the product is currently rented Require that the borrower is not the owner Determine rental period, and associated rental cost Transfer responsibility back to owner Mark as rented Update the product Pay the owner by s... | function returnProduct(uint _id, uint _rentalDays) public payable {
Product memory _product = products[_id];
address payable _owner = _product.owner;
address payable _borrower = _product.custodian;
require(_product.id > 0 && _product.id <= productCount);
require(_product.rented);
require(_owne... | 12,936,704 |
./full_match/1/0x0F545C6178830e249117B5162120378735FDD635/sources/contracts/Whitelist.sol | Returns if signer is valid | function _isValidSigner(address signerAddress) internal view returns (bool) {
return _roles[keccak256(abi.encode(signerAddress, ROLE_SIGNER))] == TRUE;
}
| 4,838,199 |
// File: contracts\token\interfaces\IERC20Token.sol
pragma solidity 0.4.26;
/*
ERC20 Standard Token interface
*/
contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public view returns (string) {this;}
... | returns the difference of _x minus _y, reverts if the calculation underflows _x minuend _y subtrahend return difference/ | function sub(uint256 _x, uint256 _y) internal pure returns (uint256) {
require(_x >= _y, "sub() _x >= _y");
return _x - _y;
}
| 1,628,683 |
./full_match/421613/0x1C98880c57bCc088b4374cF9c916b6496DAe98d7/sources/src/MintManager/MintManager.sol | allocate claimable amount to user to user address amount usdc amount that user pay for house edge | function allocateXPachi(
address to,
uint256 amount
) external onlyBank notHalt {
uint256 mintAmount = getMintAmount(amount);
claimableAmount[to] += mintAmount;
uint256 price = getPrice();
emit Allocated(to, mintAmount, price, block.timestamp);
}
| 11,572,603 |
pragma solidity ^0.4.13;
import "./Fund.sol";
import "./DataFeed.sol";
import "./zeppelin/DestructibleModified.sol";
import "./math/SafeMath.sol";
/**
* @title InvestorActions
* @author CoinAlpha, Inc. <contact@coinalpha.com>
*
* @dev This is a supporting module to the Fund contract that performs investor-related... | Update the address of the data feed contract | function setDataFeed(address _address)
onlyOwner
returns (bool success)
{
dataFeed = IDataFeed(_address);
return true;
}
| 12,924,309 |
./full_match/11155111/0x2d43c99479F4e5aE23fB930a3350D44b6a632CAa/sources/contracts/manifold/libraries-solidity/access/UserControl.sol | See {IAdminControl-approveUser}./ | function approveUser(address user) external override {
require(
IAdminControl(address(this)).isAdmin(msg.sender),
"AdminControl: Must be owner or admin"
);
if (!_users.contains(user)) {
emit UserApproved(user, msg.sender);
_users.add(user);
... | 3,836,041 |
pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
if (msg.sender != owner) throw;
_;
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
... | Allocate 15% of total supply to the team members. 1.5% of total supply allocated to each team member. Freeze tokens allocated to the team for at most two years. Freeze tokens in three phases 91500 1000 1018; 100% of locked tokens within 6 months 73200 1000 1018; 80% of locked tokens within 12 months 45750 1000 1... | function teamAllocation()
internal
{
uint individual = 91500 * 1000 * 10**18;
freeze("0xCDc5BDEFC6Fddc66E73250fCc2F08339e091dDA3", individual);
freeze("0x8b47D27b085a661E6306Ac27A932a8c0b1C11b84", individual);
freeze("0x825f4977DB4cd48aFa51f8c2c9807Ee89120daB7", indiv... | 13,140,267 |
./partial_match/42/0x4995e3D49e00C0c6058B1bC749904311D08B8f24/sources/StakeTops.sol | Returns true if `account` is a contract. This test is non-exhaustive, and there may be false-negatives: during the execution of a contract's constructor, its address will be reported as not containing a contract. IMPORTANT: It is unsafe to assume that an address for which this function returns false is an externally-ow... | function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly {
codehash := extcodehash(account)
}
return (codehash != 0x0 && codehash != a... | 3,389,004 |
/*
This file is part of The Colony Network.
The Colony Network is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Colony Netwo... | TODO: Check this challenge is active. This require is necessary, but not a sufficient check (need to check we have an opponent, at least). | function respondToBinarySearchForChallenge(uint256 round, uint256 idx, bytes jhIntermediateValue, uint branchMask, bytes32[] siblings) public {
require(disputeRounds[round][idx].lowerBound!=disputeRounds[round][idx].upperBound);
uint256 targetNode = add(disputeRounds[round][idx].lowerBound, sub(disputeRounds... | 12,759,870 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Example
* @notice Example.sol is supposed to showcase how one can use `abi.encodeWithSignature()` to generate a hash that
* can be passed into `<address>.call{value}(calldata)` as seen in `calls()`
* @dev Store & retrieve value in a ... | execute signed tx signature using global function .call() | function calls(bytes memory signature) public payable {
}
| 14,043,941 |
./full_match/4/0x766De7f2EdA6c3774cbe07149583d850A821DE77/sources/contracts/kapeikas2021.sol | limit the minimum amount for one transaction (ETH) check if the milestone requires user to be whitelisted limit the number of tokens that user can buy according to the hardcap of the current milestone (10SET) | function internalFallback() internal returns (uint) {
require(!isPause, "Contract paused");
uint256 milestoneIndex = currentMilestone();
Milestone storage milestone = milestones[milestoneIndex];
uint256 limitedInvestValue = msg.value;
require(limitedInvestValue >= milestone... | 741,674 |
pragma solidity 0.5.16;
import "./CosmosWhiteListStorage.sol";
/**
* @title WhiteList
* @dev WhiteList contract records the ERC 20 list that can be locked in BridgeBank.
**/
contract CosmosWhiteList is CosmosWhiteListStorage {
bool private _initialized;
/*
* @dev: Event declarations
*/
even... | : Get if the token in whitelist _token: ERC 20's address return: if _token in whitelist/ | function getCosmosTokenInWhiteList(address _token) public view returns (bool) {
return _cosmosTokenWhiteList[_token];
}
| 15,828,860 |
pragma solidity ^0.5.0;
import 'openzeppelin-solidity/contracts/ownership/Ownable.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Pausable.sol';
import 'openzeppelin-solidity/contracts/drafts/Counter.sol';
import './StableToken.sol... | function to allow a customer to redeem a gift certificate when the contract has been paused. ID the ID of the GFT token to redeem anyone can redeem their certificate for the total amount of ERC20 tokens/ | function redeemPaused(uint256 ID) public whenPaused {
_redeem(ID);
}
| 6,465,330 |
/**
*Submitted for verification at Etherscan.io on 2021-05-24
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function initialize() external;
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer... | Update reward variables of the given pool to be up-to-date. | function updatePool(uint _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;
return;
}
uint multiplier... | 7,735,987 |
pragma solidity ^0.4.23;
/**
* Math operations with safety checks
*/
library SafeMath {
/**
* @dev Multiplies two numbers, revert()s on overflow.
*/
function mul(uint256 a, uint256 b) internal returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
... | Multiplies two numbers, revert()s on overflow./ | function mul(uint256 a, uint256 b) internal returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
| 634,700 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./CelebrityContract.sol";
import "./AutographContract.sol";
contract AutographRequestContract is Ownable {
// Structs
struct Request {
address from;
address to;
uint pri... | Gets request information by id. - id: Request identifier./ | function getRequest(uint id) public view returns (
address from, address to, uint price, uint responseTime, uint created) {
return (
requests[id].from,
requests[id].to,
requests[id].price,
requests[id].responseTime,
requests[id].created
... | 5,363,902 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma abicoder v2;
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import {SharedData... | Allows the user to set a custom native address as receiver of rewards as these rewards will be distributed off-chain. _user address of the user, we want to update _receiver string users native address, where rewards will be sent to/ if sender is not router, sender and user have to be identical | function setNativeAddress(address _user, string calldata _receiver)
external
override
onlyRouterOrProAccess(_msgSender())
{
require(isNative() == true, "NO_NATIVE_ADDR_REQ");
require(_user != address(0), "ZERO_ADDRESS");
require(bytes(_receiver).length > 0, "EMPTY... | 6,009,672 |
./full_match/42161/0x755188415C88C31B9D1deb1De6aCa17eD998AA22/sources/soluneaArb/interface/IERC721Metadata.sol | ERC-721 Non-Fungible Token Standard, optional metadata extension/ | interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint tokenId) external view returns (string memory);
} | 16,302,425 |
./partial_match/100/0x12A386c9Ad40aBC22D495587c43a925bD09D6f8F/sources/pxv2.sol | make sure the array lengths are all the samepay back previous block price to previous owner | function Buy(uint[] memory block_id_, string memory file_hash_, uint[] memory chunk_id_, uint[] memory block_paid_prices_, string memory attachments, string memory tags) payable public {
require(block_id_.length == chunk_id_.length && block_paid_prices_.length == chunk_id_.length, "block_id_, file_hash_, b... | 16,674,271 |
./full_match/42/0x3682f7350657299edB8d6010792771A81b543b76/sources/contracts/Fundme.sol | $50 What the ETH -> USD conversion rate | function fund() public payable {
uint256 minimumUSD = 50 * 10 ** 18;
require(getConversionRate(msg.value) >= minimumUSD, "You need to spend more ETH !");
}
| 16,233,288 |
pragma solidity ^0.4.24;
import "./safeMath.sol";
import "./NameFilter.sol";
// datasets
library F3Ddatasets {
//compressedData key
// [76-33][32][31][30][29][28-18][17][16-6][5-3][2][1][0]
// 0 - new player (bool)
// 1 - joined round (bool)
// 2 - new leader (bool)
// 3-5 - ai... | moves any unmasked earnings to gen vault. updates earnings mask/ put in gen vault zero out their earnings by updating mask | function updateGenVault(uint256 _pID, uint256 _rIDlast)
private
{
uint256 _earnings = calcUnMaskedEarnings(_pID, _rIDlast);
if (_earnings > 0)
{
plyr_[_pID].gen = _earnings.add(plyr_[_pID].gen);
plyrRnds_[_pID][_rIDlast].mask = _earnings.add(plyrRnds_[_pID][_r... | 23,161 |
./full_match/1/0xAef3d07C724CFa27Cd57C5e0a49cE372dA766413/sources/contracts/alloyx/interfaces/IWalletDesk.sol | IWalletDesk AlloyX/ | interface IWalletDesk {
function getWalletUsdcValue(address _poolAddress) external view returns (uint256);
function setUsdcValueForPool(address _vaultAddress, uint256 _amount) external;
pragma solidity ^0.8.7;
}
| 3,134,178 |
./full_match/80001/0x7aA01b23ae3B28f166C44228746CE0b8616a51C4/sources/project:/contracts/Libraries/LibCalculations.sol | Cast to int265 to avoid underflow errors (negative means loan duration has passed) Max payable amount in a cycle NOTE: the last cycle could have less than the calculated payment amount Calculate accrued amount due since last repayment | function calculateOwedAmount(
uint256 principal,
uint256 totalRepaidPrincipal,
uint16 _interestRate,
uint256 _paymentCycleAmount,
uint256 _paymentCycle,
uint256 _lastRepaidTimestamp,
uint256 _timestamp,
uint256 _startTimestamp,
uint256 _loanDur... | 838,841 |
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openz... | (b-a) amountB/(amountA + amountbB) | function updateLockBlock(uint256 _pid, uint256 _amount) internal {
UserInfo storage user = userInfo[_pid][msg.sender];
user.lockBlock = block.number;
user.lockBlock = block.number.sub(user.lockBlock).mul(_amount).div(user.amount.add(_amount)).add(user.lockBlock);
}
| 12,614,129 |
/*
HABEO - (share around)
----------------------
HABEO is the teoken that will change the way we use crypto.
We'll make it easy to use and easy to understand so everyone can take advantage of it.
This code is fully commented so everyone can learn from it.
The comments are only in english for practical purposes but i... | This is a spinoff from the getValues function and it returns the token part of the values Tax is a percentage so we calculate the t value of the fees. transferAmount is tokenAmount minus tax minus liq (to save gas we use the same variable since rate for tax = liq rate) | function getTValues(uint256 tAmount, uint256 tax) private pure returns (uint256, uint256) {
uint256 tFee = tAmount * tax / 10**2;
uint256 tTransferAmount = tAmount - tFee - tFee;
return (tTransferAmount, tFee);
}
| 12,583,428 |
./full_match/4/0x32A2e41B71f523C63af9C87dee0BeE689E6A0D13/sources/zoogame.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IBEP20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
... | 750,198 |
pragma solidity >=0.8.0 <0.9.0;
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ApproveAndCallFallBack.sol";
import "./BancorFormula.sol";
// learn more: https://docs.openzeppelin.com/contracts/3.x/erc20
contract ... | _id bytes32 unique identifier. return max SHEET that can be withdrawn == available SHEET for DApp./ | function withdrawMax(bytes32 _id) external view returns(uint) {
Data storage d = _getOrientationById(_id);
return d.available;
}
| 915,825 |
pragma solidity ^0.5.0;
import "@openzeppelin/contracts-ethereum-package/contracts/math/Math.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/utils/Address.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/uti... | mustMintMax tries to increase the debt by maxim allowed amount to stoll satisfy the required debt to collateral ratio. It reverts the transaction if the fails. try to withdraw max amount of tokens allowed check zero amount condition check low amount condition (fee to amount check) check minting now enabled for the toke... | function mustMintMax(address _token, uint256 _ratio) public nonReentrant {
uint256 result = _mintMax(_token, _ratio);
require(result != ERR_ZERO_AMOUNT, "non-zero amount expected");
require(result != ERR_LOW_AMOUNT, "amount too low");
require(result != ERR_MINTING_PROHIBITED, "min... | 6,391,753 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
// Libraries
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Timers.sol";
import {LibERC721} from "./LibERC721.sol";
// Contracts
import "@openzeppelin/contracts/... | Internal cancel mechanism: locks up the proposal timer, preventing it from being re-submitted. Marks it as canceled to allow distinguishing it from executed proposals. Emits a {ProposalCanceled} event./ | function cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal returns (uint256) {
uint256 proposalId = hashProposal(
targets,
values,
calldatas,
descriptionH... | 12,876,539 |
/**
*Submitted for verification at Etherscan.io on 2022-01-01
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
/**
* @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, ... | initialize dlv token, mapping attribute dir to tokenId | function mintDLV(uint stateId, uint amount) public payable {
require(mintEnabled || msg.sender == owner(), "Minting disabled, sale is either paused or concluded");
require(stateId <= (dlvStateCount - 1) && stateId >= 0, "Invalid state value");
require(amount > 0, "Amount requested must be 1... | 15,253,492 |
./partial_match/4/0x8915F3d8Dd4954788041671CB57Be0BE3f0C47a2/sources/SQUIDMASTER.sol | Withdraw LP tokens from SQUIDMASTER._pid 0 Stake pool | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accSquidPerSha... | 8,509,428 |
./full_match/42/0x0Fe06cD3C414fc3626da3fD6D330f61d24080f3D/sources/docs.chain.link/samples/Roulette.sol | $50 minimumrequire(msg.value >= getEntranceFee(), "Not enough ETH!"); | function enter(uint256[] memory _bet) public payable {
require(roulette_state == LOTTERY_STATE.OPEN);
if (playerToBet[payable(msg.sender)].length == 0) {
players.push(payable(msg.sender));
}
playerToBet[msg.sender].push(Bet(_bet, msg.value));
}
| 16,253,498 |
./partial_match/1/0xb91371Eeb9f2D2A690429FB2F4Ee84a718C4dA0c/sources/BigMoney.sol | If the tokens were bought less than 15 days ago and the sender is not exempt, reject the transaction If the tokens are being transferred to a new address, record the purchase time Note that the purchase time won't be updated for exempt addresses | function _transfer(address sender, address recipient, uint256 amount) internal virtual override {
if (!isExempt[sender] && block.timestamp < purchaseTime[sender] + 15 days) {
revert("BIG$: Tokens are locked for the first 15 days after purchase");
}
if (purchaseTime[recipient] ==... | 4,116,748 |
./partial_match/1/0x28e55c21A97FD6fb4A19fA146aF5C359791E86bC/sources/PepeApe.sol | Sets if the contract can sell tokens enabled set to false to disable selling | function setCanSwapback(bool enabled) external onlyOwner {
swapbackOn = enabled;
}
| 11,012,063 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.