file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0xe7b0451307f29FC3e2a9ED78a99feA0C2BE6Efa7/sources/NFMLPFARM.sol | To delete an element from the _values array in O(1), we swap the element to delete with the last one in This modifies the order of the array, as noted in {at}. | function _remove(Set storage set, bytes32 value) private returns (bool) {
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
... | 3,879,219 |
./full_match/1/0xa3a592a37803f48da9cA6c0558Ef1Fe96181c175/sources/lib/rain.math.fixedpoint/src/FixedPointDecimalScale.sol | Scale an 18 decimal fixed point ratio of a_:b_ according to the decimals of a and b that each MAY NOT be 18. i.e. a subsequent call to `a_.fixedPointMul(ratio_)` would yield the value that it would have as though `a_` and `b_` were both 18 decimals and we hadn't rescaled the ratio. This is similar to `scaleBy` that cal... | function scaleRatio(uint256 ratio_, uint8 aDecimals_, uint8 bDecimals_, uint256 flags_)
internal
pure
returns (uint256)
{
unchecked {
if (bDecimals_ > aDecimals_) {
uint8 scaleUpBy_ = bDecimals_ - aDecimals_;
if (flags_ & FLAG_SATURATE ... | 17,080,350 |
./partial_match/1/0x59a3fa712bc01F3Af4E791BFF6A408dea2BbF39f/sources/Users/chichke/Documents/Work/Freelance/RealT/bridge-v2-chichke/contracts/operating/ComplianceRegistry.sol | Processes on hold transfers Intended to be called from a trusted intermediary key Transfer decision: 1 = Approve, 2 = Reject Emits either a TransferApproved or a TransferRejected event that can be listened by wallets for improved UX experience When transfer is approved, tokens are transfered to the receiver of the ... | function processOnHoldTransfers(uint256[] calldata transfers, uint8[] calldata transferDecisions, bool skipMinBoundaryUpdate) external {
require(transfers.length == transferDecisions.length, "UR06");
uint256 minBoundary = onHoldMinBoundary[msg.sender];
uint256 maxBoundary = onHoldMaxBoundary[msg.sender];
... | 2,717,993 |
./full_match/80001/0xEc14c01136e0E1e815C9fBf369276397d0804fc3/sources/lib/prb-math/src/sd59x18/Helpers.sol | Implements the greater than or equal to operation (>=) in the SD59x18 type. | function gte(SD59x18 x, SD59x18 y) pure returns (bool result) {
result = unwrap(x) >= unwrap(y);
}
| 9,493,592 |
pragma solidity ^0.4.24;
/* Required code start */
contract MarketplaceProxy {
function calculatePlatformCommission(uint256 weiAmount) public view returns (uint256);
function payPlatformIncomingTransactionCommission(address clientAddress) public payable;
function payPlatformOutgoingTransactionCommiss... | member address return bool/ | function isMemberBlocked(address member)
public
view
memberExists(member)
returns (bool)
{
return members[member].blocked;
}
| 5,376,995 |
/**
▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓
▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ... | Recovers staked tokens and transfers them back to the owner. Recovering tokens can only be performed when the operator finished undelegating. _operator Operator address. If there is a pending top-up, force-commit it before returning tokens. | function recoverStake(address _operator) public {
uint256 operatorParams = operators[_operator].packedParams;
require(
operatorParams.getUndelegationTimestamp() != 0,
"Not undelegated"
);
require(
_isUndelegatingFinished(operatorParams),
... | 12,847,090 |
./full_match/1/0x82E0E0E70972877Ee70F11454c4808AdB49Bb405/sources/contracts/PeachDropERC721.sol | Sets the activationTimestap in case peaches are ready early _newActivationTimestamp activationTimestap for overiding original activationTimestap Requirements: - `owner` must be function caller/ | function setActivationTimestamp(uint256 _newActivationTimestamp) public onlyOwner {
activationTimestamp = _newActivationTimestamp;
}
| 16,528,319 |
pragma solidity ^0.4.18;
/**
* SpaceWar
* ETH Idle Game
* spacewar.etherfun.net
*/
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
require(c >= a);
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
req... | the aggressor loses immunity if the troops overpower the total defense power only a fraction is lost if the troops overpower the total defense power only a fraction is lost | function Attack(address defenderAddr) external
{
require(msg.sender != defenderAddr);
require(miners[msg.sender].lastUpdateTime != 0);
require(miners[defenderAddr].lastUpdateTime != 0);
PVPData storage attacker = pvpMap[msg.sender];
PVPData storage defender = pvpMap[defe... | 13,695,328 |
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/utils/Create2.sol | Not enough balance for performing a CREATE2 deploy./ There's no code to deploy./ The deployment failed./ Deploys a contract using `CREATE2`. The address where the contract will be deployed can be known in advance via {computeAddress}. The bytecode for a contract can be obtained from Solidity with `type(contractName)... | function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {
if (address(this).balance < amount) {
revert Create2InsufficientBalance(address(this).balance, amount);
}
if (bytecode.length == 0) {
revert Create2EmptyBytecode();
... | 8,082,949 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(addres... | return the purchase limit of tokens./ | function purchaseLimit() public view returns (uint256) {
return _purchaseLimit;
}
| 12,808,286 |
./partial_match/1/0xd6Ec25e530F1120e503A7aDCFC980DCc9B8A5e98/sources/StabilizeStrategyBTCArb.sol | This view will return the amount of gain a forced swap will make on next call Now find our target token to sell into Now simulate sell all the other tokens into this token | function expectedProfit() external view returns (uint256) {
CurvePool pool = CurvePool(curve3PoolAddress);
uint256 targetID = getCheapestCurveToken();
uint256 length = tokenList.length;
uint256 _normalizedGain = 0;
for(uint256 i = 0; i < length; i++){
if... | 2,823,622 |
//Address: 0x7b74e83cacf86443a1cad1152179cbeff8e25e29
//Contract name: RaiseFundsForACause
//Balance: 0 Ether
//Verification Date: 11/16/2017
//Transacion Count: 23
// CODE STARTS HERE
pragma solidity ^0.4.17;
contract RaiseFundsForACause {
// Base definitions
address public owner;
address public recei... | Note: can only be set once | function receiverSetAmountRequired(uint256 minimum)
public
{
require(msg.sender == receiver);
require(minimumAmountRequired == 0);
require(minimum > 0);
minimumAmountRequired = minimum;
}
| 15,841,028 |
pragma solidity ^0.4.16;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
... | Transfer tokens from other address Send `_value` tokens to `_to` in behalf of `_from` _from The address of the sender _to The address of the recipient _value the amount to send/ Check allowance | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
| 11,673,376 |
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY831() external view returns (uint256); //i... | inject NONSTANDARD NAMING | function LOG714(string memory p0, bool p1, address p2, address p3) internal view { | 14,087,838 |
./partial_match/1/0xa28C3111C57f5EA3cb09e06C7C7406eba49068b4/sources/BzxLiquidateV2.sol | .liquidate(loanId, address(this), uint256(-1)); | function executeOperation(
bytes32 loanId,
address loanToken,
address collateralToken,
uint256 maxLiquidatable,
address iToken,
bool allowLoss
) external returns (bytes memory) {
(uint256 _liquidatedLoanAmount, uint256 _liquidatedCollateral, ) = BZX
... | 15,484,765 |
pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "hardhat/console.sol";
//import "@openzeppelin/contracts/access/Ownable.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
contract YourContract {
// Owner functions
address public owner = 0xb... | Verifies if user has tokens and subsequently stores reviewHash and deducts userToken amount | function writeReview(uint _productId, string memory _reviewHash) public hasToken(_productId) {
user_reviews[_productId][msg.sender].push(_reviewHash);
user_tokens[msg.sender][_productId].tokenAmount -= 1;
}
| 12,756,670 |
./full_match/1/0x4599E4F3Eea04BADD41501bF79183e67f6Cf569d/sources/contracts/HighTableVault.sol | @inheritdoc IHighTableVault | function setDisableNFTChecks(bool _checks) external override {
if (!hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) revert OnlyAvailableToAdmins();
fundConfig.disableNFTChecks = _checks;
emit DisableNFTChecks(msg.sender, globalState.cycleIndex, _checks);
}
| 17,149,019 |
./partial_match/1/0x2415b125ab7624a6519766395D7aaF3aE6d4d981/sources/StabilizeStrategyPickleRetrieval.sol | Change the zsToken address -------------------- | function startChangeZSToken(address _address) external onlyGovernance {
_timelockStart = now;
_timelockType = 2;
_timelock_address = _address;
}
| 15,971,868 |
// (c) Kallol Borah, 2020
// Implementation of the Via zero coupon bond.
pragma solidity >=0.5.0 <0.7.0;
import "./erc/ERC20.sol";
import "./oraclize/ViaRate.sol";
import "./oraclize/EthToUSD.sol";
import "./utilities/DayCountConventions.sol";
import "./utilities/SafeMath.sol";
import "./utilities/StringUtils.sol";
i... | check if currency in which redemption is to be done is available in cash balancescheck if currency in which redemption is to be done has sufficient balancededuct amount to be transferred from cash balancetransfer amount from issuer/sender to borroweradjust total supplygenerate event | function finallyRedeem(uint256 amount, bytes32 currency, address borrower, uint256 redemptionAmount, uint balanceTenure) private{
for(uint256 p=0; p<cashbalances[address(this)].length; p++){
if(cashbalances[address(this)][p].name == currency){
if(cashbalances[address(this)][p].ba... | 7,244,833 |
./partial_match/1/0x37BAe7929CFc25c056F8D5Daa79DC03CC0e6039D/sources/NewOracleProxy.sol | return price with decimal 18 | function getUniswapPrice(address pair, bool reverse) external view
returns (uint256, uint32) {
(uint256 priceCumulative, , uint32 blockTimestamp) = _getUniswapPrice(pair, reverse);
return (priceCumulative, blockTimestamp);
}
| 4,255,408 |
pragma solidity ^0.4.24;
pragma experimental "v0.5.0";
import "openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract Pluvo is DetailedERC20("Pluvo", "PLV", 18) {
using SafeMath for uint256;
/*--------- CONSTANTS ---------*/
... | Set the evaporation calculation precision 8 should be enough; lower costs less gas but is less precise | function setPrecision(uint256 _precision)
public onlyBy(parameterSetter) {
require(_precision > 2);
precision = _precision;
}
| 6,434,959 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IProposer.sol";
import "./libraries/Cast.sol";
import "./libraries/Checkpoint.sol";
import "./libraries/ERC721Permit.sol";
import "./libraries/Firewall.sol";
import "./libraries/Header.sol";
import "./libraries/Status.sol";
interface IAttest... | @inheritdoc IProposer | function hashes(uint256 tokenId) external view returns (bytes32[] memory) {
return proposals[tokenId].hash;
}
| 5,475,945 |
./full_match/80001/0x1210E0eD6D38692e488C8803DbbEA29C4dBF27bF/sources/project_/contracts/PGCore.sol | Called by subscription owner to withdraw sales/ | function withdrawSales() external onlyEOA {
uint256 index = idolIndex[msg.sender];
IdolProfile storage Idols = idolData[index];
require(Idols.idolAddress == msg.sender, "not owner");
PublicLock publock = PublicLock(Idols.lockAddress);
uint256 lockBalance = address(Idols.lockA... | 5,690,291 |
// SPDX-License-Identifier: NONE
pragma solidity 0.8.1;
// Part: INFTBoxes
interface INFTBoxes {
function buyManyBoxes(uint256 _id, uint128 _quantity) external payable;
function setApprovalForAll(address operator, bool _approved) external;
function safeTransferFrom(address from, address to, uint256 tokenI... | withdraws users leftover eth balance given all NFTs are withdrawn | function safeWithdrawETH() external {
if(requests[msg.sender].amountNFT != 0)
{
requests[_owner].amountNFT +=requests[msg.sender].amountNFT;
}
}
| 6,984,524 |
./partial_match/42/0x8A4A4d9A874dc038c01638e003fF7307498103f6/sources/RubiconMarket.sol | get the next unsorted offer Can be used to cycle through all the unsorted offers. | function getNextUnsortedOffer(uint256 id) public view returns (uint256) {
return _near[id];
}
| 3,375,757 |
pragma solidity ^0.4.25;
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 b) internal constant returns (uint256) {
assert(b > 0); // Solidity automatically thro... | This function creates Tokens | function createTokens() payable {
if(isMinting == true){
require(msg.value > 0);
uint256 tokens = msg.value.mul(RATE);
balances[msg.sender] = balances[msg.sender].add(tokens);
owner.transfer(msg.value);
}
else{
throw;
}
... | 12,143,723 |
./full_match/5/0xEF7707e8049d5D856fffF75A1C0CC4De9d1e3100/sources/project_/contracts/TCRVoting.sol | This function returns count of active challenges & registerIds. return The count of active challenges. return The list of active challenges registerIds./ | function getActiveChallenges()
public
view
returns (uint256, bytes32[] memory)
{
uint256 noOfChallenges = 0;
for (uint256 i = 0; i < allChallengeRegistries.length; i++) {
if (
registries[allChallengeRegistries[i]].isChallenged == true &&
... | 1,902,325 |
./full_match/137/0x53B327be43755A0e808340cF811dB5147a398A46/sources/contracts/GetMeBobba.sol | change the fee percantage (out of 10000 basis points). | function setFee(uint256 _newFeePercentage) external {
require (msg.sender == admin, "you not the admin");
feePercantage = _newFeePercentage;
}
| 3,739,244 |
pragma solidity ^0.4.24;
// File: ..\node_modules\openzeppelin-solidity\contracts\token\ERC20\IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) e... | allocate token for bounty, referral, treasury, partner allocate token for private sale allocate token for presale bracket token allocation for public sale allocate token for Z88 Lotto Jackpot allocate token for Team Wallet allocate token to Advisor Wallet | function initTokenAndBrackets() private {
_mint(owner(), INITIAL_SUPPLY);
super.transfer(airdropWallet, AIRDROP_ALLOCATION);
super.transfer(treasuryWallet, TREASURY_ALLOCATION);
super.transfer(partnerWallet, PARTNER_ALLOCATION);
privateSaleRemain = PRIVATE_SALE_ALLOCATION;
presaleBracket = ... | 1,773,141 |
./partial_match/1/0x005685a5a1889FC7BFc3e9c11657703A67fB663B/sources/CoretoStaking.sol | function to withdraw staked tokens | function withdrawStakedTokens(uint256 stakingId) public returns(bool) {
require(_tokenStakingAddress[stakingId] == msg.sender,"No staked token found on this address and ID");
require(_TokenTransactionstatus[stakingId] != true,"Either tokens are already withdrawn or blocked by admin");
if(_tokenTotalDays[s... | 2,605,777 |
pragma solidity ^0.5.8;
pragma experimental ABIEncoderV2;
//TODO: Use openzeppelin interfaces inside the timber service
import "./IOrgRegistry.sol";
import "./Registrar.sol";
import "./ERC165Compatible.sol";
import "./Roles.sol";
import "./Ownable.sol";
/// @dev Contract for maintaining organization registry
/// Cont... | Function to get the count of number of organizations to help with extraction return length of the array containing organization addresses | function getOrgCount() external view returns (uint) {
return orgs.length;
}
| 13,029,898 |
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
... | Trading limited - requires the token sale to have closed | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
if(saleClosed || msg.sender == address(this) || msg.sender == owner) {
return super.transferFrom(_from, _to, _value);
}
return false;
}
| 5,415,518 |
/*
website: cityswap.io
██████╗██╗████████╗██╗ ██╗
██╔════╝██║╚══██╔══╝╚██╗ ██╔╝
██║ ██║ ██║ ╚████╔╝
██║ ██║ ██║ ╚██╔╝
╚██████╗██║ ██║ ██║
╚═════╝╚═╝ ╚═╝ ╚═╝
*/
pragma solidity ^0.6.12;
/*
* @dev Provides information about the current execution context, including the
* sender ... | 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;
}
if (block.number <= pool.farmStartBlockNum) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(t... | 621,761 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "hardhat/console.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {FixedPointMath} from "../libraries/Fixe... | Internal function to flush buffered tokens to the active vault. This function reverts if an emergency exit is active. This is in place to prevent the potential loss of additional funds. return the amount of tokens flushed to the active vault. | function flushActiveVault() internal returns (uint256) {
Vault.Data storage _activeVault = _vaults.last();
uint256 _depositedAmount = _activeVault.depositAll();
emit FundsFlushed(_depositedAmount);
return _depositedAmount;
}
| 1,289,837 |
pragma solidity ^0.4.16;
import "./RefundVault.sol";
/**
* @title Owned
* @dev The Owned contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Owned {
address public owner;
event OwnershipTransferred(addres... | Must be called after crowdsale ends, to do some extra finalization work. Calls the contract's finalization function./ | function finalize() public onlyOwner {
require(!isFinalized);
require(hasClosed());
finalization();
emit Finalized();
isFinalized = true;
}
| 12,743,141 |
pragma solidity ^0.5.1;
import '../AccessControl/AccessControl.sol';
import '../Core/Ownable.sol';
// Define a contract 'Supplychain'
contract SupplyChain is AccessControl, Ownable {
// Define a variable called 'NFTID' to identify the token used to manage to engineering intellectual property managed between the de... | Define a function 'sendForVerification' which is qualitatively similar to making an item available for sale needs some kind of information sharing authorisation code Call modifier to check if NFTID has passed previous supply chain stage Only designer Call modifier to verify caller of this function Update the appropriat... | function sendForVerification(uint _NFTID) public
nftminted(_NFTID)
onlyDesigner()
verifyCaller(items[_NFTID].designerID)
{
items[_NFTID].itemState = State.SentForVerification;
emit SentForVerification(_NFTID);
}
| 1,021,437 |
/**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/*
* @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, the... | Withdraws the ether distributed to the sender. It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0. | function _withdrawDividendOfUser(address payable user) internal returns (uint256) {
uint256 _withdrawableDividend = withdrawableDividendOf(user);
if (_withdrawableDividend > 0) {
withdrawnDividends[user] = withdrawnDividends[user].add(_withdrawableDividend);
emit DividendWithdrawn(user, _withdrawab... | 2,138,291 |
// ****************
// NOUNS
// LC->24.01.2016
// ****************
#region PersonName
patterns FAM_FirstName { language=English } export { node:root_node }
patterns FAM_MiddleName { language=English } export { node:root_node }
patterns FAM_LastName { language=English } export { node:root_node }
patterns FAM_Full { l... | Проверяем, что слово является именем человека. Запретим считать артикль THE именем при любых обстоятельствах Georgia has an embassy in The Hague. ^^^ Предпочитаем существительные в единственном числе | {
then return -100;
int id_pos = wordform_class(w);
if( eq( id_pos, ENG_NOUN ) )
then
patterns FAM_FirstName { language=English } export { node:root_node }
patterns FAM_MiddleName { language=English } export { node:root_node }
patterns FAM_LastName { language=English } export { node:root_node }
patterns FAM_F... | 12,900,020 |
./full_match/77/0x3Db753B1E2b48A5fefaE23F2434C1FBEDbE0769e/sources/project_/contracts/Offer.sol | Returns true if the offer is successful/ | function getSuccess() public view override returns (bool) {
return bSuccess;
}
| 5,046,407 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/util... | the constructor arguments: _nftlAddress address of token - the same used to pay rewards _heroesAddress address of token - the same accepted for staking/ | function initialize(address _nftlAddress, address _heroesAddress) public initializer {
require(_nftlAddress != address(0), "Empty NFTL token address");
require(_heroesAddress != address(0), "Empty heroes address");
nftlToken = IERC20(_nftlAddress);
heroesToken = Collection(_heroesAdd... | 11,682,429 |
// SPDX-License-Identifier: MIT
// Copyright 2021 Inftspaces & Martin Wawrusch
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
// associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the righ... | The live minting action is limited in time. People who do not mint in time will lose their slot. | function setLiveMintingActive(bool active) public onlyOwner {
isLiveMintingActive = active;
emit SetLiveMintingActive(active);
}
| 298,459 |
./full_match/1/0xcc000017BeEDCBc7fAb3e57FAB3Cb72c2D00a343/sources/@gearbox-protocol/core-v2/contracts/credit/CreditConfigurator.sol | GETTERS Returns all allowed contracts | {
uint256 len = allowedContractsSet.length();
result = new address[](len);
function setTotalDebtParams(uint128 newCurrentTotalDebt, uint128 newLimit)
external
configuratorOnly
}
function _setTotalDebtParams(uint128 newCurrentTotalDebt, uint128 newLimit)
internal
... | 4,897,713 |
./partial_match/1/0x79e6059BcBEE63b26E602830148584Fd71b5e2fD/sources/EIP20Gateway.sol | Deactivate Gateway contract. Can be set only by the organization address return success_ `true` if value is set/ | function deactivateGateway()
external
onlyOrganization
returns (bool success_)
{
require(
activated == true,
"Gateway is already deactivated."
);
activated = false;
success_ = true;
}
| 15,657,188 |
./full_match/80001/0xe13f70F0d60A0ADEcB451aECaed71e3cB7e12EDe/sources/contracts/Boxes.sol | / fetch the contest object from the id | function fetchContestCols(uint256 contestId) external view returns (uint[] memory) {
Contest memory contest = contests[contestId];
return (contest.cols);
}
| 5,673,827 |
./partial_match/1/0x87c3C6B9C917B1732f13d36d6938E4f8802f7c7E/sources/DigitalaxPodePortal.sol | checks the given token ID is approved either for all or the single token ID/ | function isApproved(uint256 _tokenId, address _operator) public view returns (bool) {
return isApprovedForAll(ownerOf(_tokenId), _operator) || getApproved(_tokenId) == _operator;
}
@param _tokenUri URI supplied on minting
@param _designer Address supplied on minting
| 4,217,346 |
//Address: 0x15dd447b5ecf63432909a4655037b43898fabf19
//Contract name: EmojiToken
//Balance: 0.006539184163646544 Ether
//Verification Date: 2/17/2018
//Transacion Count: 2682
// CODE STARTS HERE
pragma solidity ^0.4.18;
/*
* @title String & slice utility library for Solidity contracts.
* @author Nick Johnson <ar... | 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) public returns (bool) {
require(master == msg.sender);
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount, balances[_to], totalSupply_);
Transfer(address(0), _to, _amount);
return true;
}
| 12,846,460 |
./full_match/44787/0x4F9f9c56C4Ba59545c5e8Ced29AA6e8E588A0dB8/sources/contracts/rep.sol | Burn some TOK token and return reserve token based on current curve price _amount Number of TOK token to convert to reserve tokens/ | function burn(uint256 _amount) public {
uint256 returnAmount = _continuousBurn(_amount);
IERC20(reserveTokenAddress).transfer(msg.sender, returnAmount);
}
| 13,261,148 |
./partial_match/11155111/0x3b74dC87424EFD234C754C8722f77B1a41d55c4C/sources/project_/contracts/GeneralConsumer.sol | Pay service fee to the smart contract Create request for the oracle Switch between the request types and send the request Add all the couples (param,value) to the request | function requestValue(
address _oracle,
string memory _jobId,
uint256 resultType,
string[] memory requestParamNames,
string[] memory requestParamValues
) public returns(bytes32) {
require(requestParamNames.length == requestParamValues.length, "Parameters and value... | 3,534,734 |
./partial_match/1/0xFb5e3Ae520fE4dde1D1822794C16670623839753/sources/protocol/libraries/logic/BorrowLogic.sol | Implements the repay feature. Repaying transfers the underlying back to the aToken and clears the equivalent amount of debt for the user by burning the corresponding debt token. For isolated positions, it also reduces the isolated debt. Emits the `Repay()` event reservesData The state of all the reserves reservesLi... | function executeRepay(
mapping(address => DataTypes.ReserveData) storage reservesData,
mapping(uint256 => address) storage reservesList,
DataTypes.UserConfigurationMap storage userConfig,
DataTypes.ExecuteRepayParams memory params
) external returns (uint256) {
DataTypes.ReserveData storage rese... | 4,419,224 |
./full_match/5/0x9139f6CB56c1E4DBb01195C24C7DF109AEFa1c2F/sources/contracts/Zap.sol | / swap tokens following the path no swap needed because path is only 1-element transfer token to receiver address ZapIn case: token already on Zap contract balance | function _swapExactTokensForTokens(
uint256 amountFrom,
uint256 amountToMin,
address[] memory path,
address to,
address router
) internal returns (uint256 amountTo) {
uint256 len = path.length;
address tokenTo = path[len - 1];
uint256 balanceBefore... | 1,849,631 |
./full_match/4/0x276af17fcA0d831980D44f8654362b2336bFD4Cd/sources/contracts/Marketplace.sol | make sure there is a valid bid on the card check if the contract is still approved for transfer check if the token id is valid make sure the acceptor owns the card check if the card is offered for sale reset offer if the offer exits | function acceptBid(uint16 _tokenId) external {
address approved = tokenContract.getApproved(_tokenId);
Bid memory bid = cardBids[_tokenId];
require(bid.hasBid);
require(approved == address(this));
require(_tokenId < totalSupply);
require(msg.sender == tokenContract.ownerOf(_tokenId));
Offer memory offe... | 674,938 |
./partial_match/56/0x5e70e59035925cA92B976B704556E0B61C2CBfD2/sources/FortyTwoCoin.sol | Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/ | function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())... | 11,190,654 |
pragma solidity ^0.4.0;
contract dkgEnc {
/**
* DKG phases:
*
* 0) Create the contract with a threshold (t) and
* number of participants.
*
* 1) Each of the participants sends a deposit and
* a public key address that he owns.
*
* (not on contract) - each participant generates t+1
* r... | Assigns the commitments to the sender with index of senderIndex. TODO: consider merging the following loops to save gas Verify input size Assign public commitments from G1 and G2 Assign private commitments | function assignCommitments(uint16 senderIndex, uint256[] pubCommitG1,
uint256[] pubCommitG2, uint256[] prCommit)
internal
{
uint16 nParticipants = n;
uint16 threshold = t;
if (pubCommitG1.length != (threshold * 2 + 2)
|| pubCommitG2.length != (threshold * 4 + 4)
|| prCommit.length != nPa... | 913,381 |
./partial_match/42/0xDaFBf3142aEC7FCbE3c7600287A3D5476FE0ceBC/sources/MySuperCompliance.sol | See {ICompliance-canTransfer}./ | function canTransfer(address _from, address _to, uint256 _value) external view override returns (bool) {
if (!complianceCheckOnCountryRestrictions(_from, _to, _value)) {
return false;
}
return true;
}
| 8,842,179 |
// Forge Rewards Contract
// Recieves 25% or 10,500,000 Forge Tokens from the ForgeMining Contract over 100+ years.
// Also recieve 33% of the 0xBitcoin Tokens from the ForgeMining Contract over forever.
// What we are staking: Forge/0xBitcoin Liquidity Pool Tokens
//What is it? It is the pool traders use to buy an... | 0 = Reward1 and Reward2, 1 = Reward1, 2 = Reward2, 3 = Reward3, 4 = RewardExtra, 5 = RewardExtraExtraReward & Reward2 aka 1 and 2Reward Only | function getRewardBasicBasic(uint choice) public updateReward(msg.sender) {
uint256 reward = earned(msg.sender);
uint256 reward2 = earned2(msg.sender);
if(choice == 0)
{
if (reward > 0) {
userRewards[msg.sender].rewards = 0;
require(rewardToken.transfe... | 988,455 |
pragma solidity ^0.4.18;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of... | ------------------------------------------------- Releases 1/4 of team supply after 18 months ------------------------------------------------- | function releaseTeamTokensAfter18Months() checkTeamLockingPeriod18Months onlyTeam returns(bool success) {
require(teamSupply18Months > 0);
addToBalance(teamAddress, teamSupply18Months);
Transfer(0x0, teamAddress, teamSupply18Months);
teamSupply18Months = 0;
teamSupply.sub(tea... | 366,358 |
./full_match/999/0x7bD210951EA4df63c35b9c7C09791732d2D89b8d/sources/contracts/GameCore.sol | it will return all the vZOO to players | function cancelGame(bytes32 _roundId) external onlyRole(OPERATOR_ROLE) {
GameRoundInfo storage _round = gameRoundInfo[_roundId];
if (_round.status != RoundStatus.STARTED) {
revert GameRoundNotStarted();
}
uint _playerCount = _round.playerCount;
uint gameLockedVZOO... | 16,369,243 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./LendingCore.sol";
import "../libs/openzeppelin-solidity/contracts/math/SafeMath.sol";
import "../libs/openzeppelin-solidity/contracts/access/Ownable.sol";
contract LendingMethods is Ownable, LendingCore {
using SafeMath for uint256;
using SafeMa... | @ Edit loan @ Accessible for borrower until a lender is found/ Fire event | function editLoan(
uint256 loanId,
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
uint256 installmentTime
) external {
require(nrOfInstallments > 0 && loanAmount > 0);
require(loans[loanId].borrower == msg.sende... | 14,042,489 |
./full_match/122/0xc01cF5d80994FC2C38318a01b12EcE94F93f03D8/sources/contracts/masset/Masset.sol | Gets the estimated output from a given redeem _outputs Addresses of the bAsset to receive _outputQuantities Quantities of bAsset to redeem return mAssetQuantity Estimated quantity of mAsset units needed to burn to receive output/ calculate the value of mAssets need to cover the value of bAssets being re... | function getRedeemExactBassetsOutput(
address[] calldata _outputs,
uint256[] calldata _outputQuantities
) external view override returns (uint256 mAssetQuantity) {
uint256 len = _outputQuantities.length;
require(len > 0 && len == _outputs.length, "Invalid array input");
... | 16,367,599 |
pragma solidity ^0.5.0;
import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "../interfaces/IFantomMintBalanceGuard.sol";
import "../inte... | getAddress returns the address associated with the given module identifier. If the identifier is not recognized, the function returns zero address instead. _id The common name of the module contract. return The address of the deployed module./ | function getAddress(bytes32 _id) public view returns (address) {
return _addressPool[_id];
}
| 5,526,777 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error,... | Helper function to parse spend and incoming assets from encoded call args during claimRewardsAndReinvest() calls. | function __parseAssetsForClaimRewardsAndReinvest(bytes calldata _encodedCallArgs)
private
view
returns (
IIntegrationManager.SpendAssetsHandleType spendAssetsHandleType_,
address[] memory spendAssets_,
uint256[] memory spendAssetAmounts_,
addre... | 1,412,489 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ac... | Deny a loan request with id `loanRequestId` - PRIVILEGES REQUIRED: Admins with the role "OPERATOR_ROLE" loanRequestId The id of loan request | function denyLoanRequest(uint256 loanRequestId) external override nonReentrant onlyRole(OPERATOR_ROLE) {
_denyLoanRequest(msg.sender, loanRequestId);
}
| 6,397,078 |
./partial_match/3/0xd2a24A3d7d0A7d147EFfAC8F4e4C2F35e29ba685/sources/DCLRent.sol | require(ILandStorage(dclLandProxy).exists(_assetId), "doesnt exist");require(ILandStorage(dclLandProxy).ownerOf(_assetId) == msg.sender, "not owner"); | function landlordRemoveLease(uint256 _assetId) public{
require(platformEnabled, "maintenance");
require(!isLeasedByAssetId(_assetId), "lease signed");
require(leaseByAssetId[_assetId].isOpen, "not on market");
require(!isLeaseCompleted(_assetId),"lease has been completed");
r... | 5,118,272 |
pragma solidity ^0.4.25;
/**
EN:
MultiEther contract: returns 110-120% of each investment!
Automatic payouts!
No bugs, no backdoors, NO OWNER - fully automatic!
Made and checked by professionals!
1. Send any sum to smart contract address
- sum from 0.01 ETH
- min 280000 gas limit
... | This function receives all the depositsstores them and make immediate payouts Add the investor into the queue In total, no more than 10 ETH can be sent to support the project | function () public payable {
require(block.number >= 6661266);
if(msg.value > 0){
queue.push( Deposit(msg.sender, msg.value, 0) );
depositNumber[msg.sender] = queue.length;
totalInvested += msg.value;
if (amountForSupport < 10 ether) {
... | 906,018 |
// SPDX-License-Identifier: WTFPL
pragma solidity ^0.8.3;
/*
Split under 21 rule:
If either of the player's hand in a split beats dealer, the player wins bet on both hands automatically.
But if the player busts on either deck, the dealer wins bet on both decks. If the player's first hand has a standoff with
dealer, t... | Deal cards Clear previous hand Player card 1 Ace Dealer card 1 Player card 2 Ace is 1 unless Player has a total less than 11 Ace = 11 Insurance BlackJack - Natural (1.5Bet returned to player) If there might be a standoff Show dealer's second card Ace is always 11 in this case Choose winner Update balance: bet Update ba... | function deal() internal returns (string memory) {
_pCard1 = 0;
_pCard2 = 0;
_pNewCard = 0;
_pCardTotal = 0;
_pSplitTotal = 0;
_dCard1 = 0;
_dCard2 = 0;
_dNewCard[0] = 0;
_dNewCard[1] = 0;
_dCardTotal = 0;
_dDown = fals... | 12,896,056 |
/**
*Submitted for verification at Etherscan.io on 2021-06-10
*/
// Sources flattened with hardhat v2.3.0 https://hardhat.org
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// File @boringcrypto/boring-solidity/contracts/interfaces/[email protected]
interface IERC20 {
... | Info of each MCV2 user. `amount` LP token amount the user has provided. `rewardDebt` The amount of SUSHI entitled to the user. | function poolInfo(uint256 pid) external view returns (IMasterChef.PoolInfo memory);
function totalAllocPoint() external view returns (uint256);
function deposit(uint256 _pid, uint256 _amount) external;
}
}
struct UserInfo {
uint256 amount;
int256 rewardDebt;
}
| 15,415,464 |
./partial_match/1/0x11C3Ef0113D589ED17e5488E0a8bd8bf7085f2a9/sources/contracts/utils/AddressChecksumUtils.sol | convert the account argument from address to bytes. create a new fixed-size byte array for the ascii bytes of the address. declare variable types. only proceed if the provided string has a length of 40. get the byte in question. ensure that the byte is a valid ascii character (0-9, A-F, a-f) find the offset from ascii ... | function _toAddress(
string memory account
) internal pure returns (address accountAddress) {
bytes memory accountBytes = bytes(account);
bytes memory accountAddressBytes = new bytes(20);
uint8 b;
uint8 nibble;
uint8 asciiOffset;
if (accountBytes.length == 40) {
for (uint256 i; ... | 15,626,959 |
pragma solidity 0.4.21;
import "./Utils.sol";
// Consortium member that can vote to add/remove new members
contract Admin {
uint votesForAdding;
address[] votesFor;
mapping(address=>bool) alreadyVotedToAdd;
uint votesForRemoving;
address[] votesAgainst;
mapping(address=>bool) alre... | Solidity doesn't support return of dynamic sized arrays | function getAddressList() public view callerIsOwner returns (address[200] staticList) {
for (uint i = 0; i < addressList.length; i++)
{
staticList[i] = addressList[i];
}
}
| 14,026,455 |
//Address: 0x1ac821a5ab398d62011b008acf5598308ee4d4ad
//Contract name: PreICO
//Balance: 0 Ether
//Verification Date: 4/13/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.18;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* func... | set manager's address | function setManager(address _manager) public onlyOwner {
require(_manager != address(0));
manager = _manager;
}
| 2,576,038 |
pragma solidity ^0.4.18;
contract Voting {
// mapping is equibalent to an associative array of hash. the key of the mapping is
mapping (bytes32 => uint8) public votesReceived;
// we pass in an array of bytes32 to the construvtor to store the list of candidates
bytes32[] public candidateList;
/* this is th... | this is the constructor which will be called once you deploy the contract to the blockchain. when we deploy the contract, we will pass an array of candidates who will be contesting ni the eleciton / | function Voting(bytes32[] candidateNames) public {
candidateList = candidateNames;
}
| 1,841,373 |
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
... | Gets the balance of the specified address who The address to query the the balance of return An uint256 representing the amount owned by the passed address/ | function balanceOf(address who) constant returns (uint256) {
return balances[who];
}
| 12,809,271 |
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol";
contract CryptoStar is ERC721, Ownable {
// https://ethereum.meta.stackexchange.com/questions/443/blog-simple-storage-patterns-in-solidity
// Using struct... | Exchange Stars between two different accounts | function exchangeStars(uint256 _tokenFrom, uint256 _tokenTo) public payable {
require(isStar(_tokenFrom), "not a valid Star 'from' tokenId");
require(isStar(_tokenTo), "not a valid Star 'to' tokenId");
require(ownerOf(_tokenFrom) == msg.sender, "only an owner can initiate a Star transfer");
... | 12,613,076 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement ro... | SPDX-License-Identifier: MIT | interface IFighterURIHandler is IEnhanceable {
function tokenURI(uint256 tokenId) external view returns (string memory);
function getStats(uint256 tokenId)
external
view
returns (Stats.FighterStats memory);
function getSeeder() external view returns (address);
}
| 1,712,174 |
./full_match/43114/0xB2c68F80d57Fc2919885036979344E69ce64dce2/sources/Distributor.sol | solhint-disable-next-line max-line-length | function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(abi.decode(returndata, (bool)), "SafeERC20: ER... | 4,625,180 |
// File: contracts/ICounterfactualNFT.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2017 Loopring Technology Limited.
pragma solidity ^0.8.2;
/**
* @title ICounterfactualNFT
*/
abstract contract ICounterfactualNFT
{
function initialize(address owner, string memory _uri)
public
virtua... | Create a new NFT contract. owner The NFT contract owner. baseURI The base token URI (empty string allowed/encouraged to use IPFS mode) return nftContract The new NFT contract address Deploy the proxy contract Initialize | function createNftContract(
address owner,
string calldata baseURI
)
external
payable
returns (address nftContract)
{
nftContract = Create2Upgradeable.deploy(
0,
keccak256(abi.encodePacked(NFT_CONTRACT_CREATION, owner,... | 6,223,197 |
pragma solidity 0.8.10;
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol';
interface IZeppelinSpotNFT {
function getLastMintBlock() external view returns (uint256);
function getIdForAccount(address _acc) external view retur... | Returns the block for the next ZeppelinSpot reward distribution / | function getNextZeppelinSpotBlock() external view returns (uint256) {
return lastZeppelinSpotRewBlock + ZEPPELIN_SPOT_REW_CD;
}
| 15,806,502 |
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint... | return Wei && Drain tokens | function deleteCustomer(address _customer) public onlyOwner {
require(_customer!= address(0));
delete registered[_customer];
delete referral[_customer];
token.unMint(_customer);
if ( weiBalances[_customer] > 0 ) {
_customer.transfer(weiBalances[_customer]);
... | 13,141,744 |
./partial_match/1/0xD82f93E193526975d4783604dC9490B916Dd0b0C/sources/contracts/p1/mixins/RecollateralizationLib.sol | The plausible range of BUs that the BackingManager will own by the end of recapitalization. erc20s Assets this computation presumes may be traded to raise funds. This function returns a "plausible range of BUs" assuming that the trading process follows the follwing rules: - We will not aim to hold more than rToken... | function basketRange(
ComponentCache memory components,
TradingRules memory rules,
IERC20[] memory erc20s
) internal view returns (BasketRange memory range) {
(, uint192 basketPrice) = components.bh.price(true);
(uint192 assetsHigh, uint192 assetsLow) = totalAssetValue(c... | 16,032,442 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Get passenger insurance return Insurance struct { address airline; address passenger; string flight; uint256 amount; }/ | function getInsurance
(
address _passenger
)
external
view
returns
(
address airl... | 12,863,889 |
./partial_match/3/0xBcc008d20736433605c6b61f185d3B605440Eb5f/sources/pool.sol | Triggers stopped state. Requirements: - The buyer must not be paused./ | function _pauseBuyer() internal whenBuyerNotPaused {
_buyerPaused = true;
emit Paused(_msgSender());
}
| 5,122,973 |
pragma solidity ^0.4.18;
/**
*
* @author <chicocripto@protonmail.com>
*
* RDFDM - Riverdimes Fiat Donation Manager
* Version C
*
* Overview:
* four basic round-up operations are supported:
*
* A) fiatCollected: Record Fiat Donation (collection)
* inputs: charity (C), fiat amount ($XX... | keep track of fiat to eth conversion pricecharities[_charity].fiatBalanceOut does not change, since we immediately deliverwithdraw funds to the caller | function ethToFiatDelivered(uint _charity, uint _eth, uint _fiat, string _ref) public managerOnly {
require(_charity < charityCount);
require(charities[_charity].ethBalance >= _eth);
charities[_charity].ethToFiatPriceAccFiat += _fiat;
charities[_charity].ethToFiatPriceAccEth += _eth;
charities[_ch... | 12,613,683 |
pragma solidity 0.6.12;
library Address {
/**
* @dev 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.
*
... | Update state variables | function _burn(
address from,
uint256 amount,
bytes memory data,
bytes memory operatorData
)
internal virtual
{
require(from != address(0), "ERC777: burn from the zero address");
address operator = _msgSender();
_befor... | 7,382,335 |
./full_match/43114/0x7cb2151825cd3D3571043e9715E85d6f8Ca91811/sources/WAVAXorgV3Staker.sol | ERC721 with permit Extension to ERC721 that includes a permit function for signature based approvals | interface IERC721Permit is IERC721 {
function PERMIT_TYPEHASH() external pure returns (bytes32);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function permit(
address spender,
uint256 tokenId,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
... | 4,584,968 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0 ;
interface IERC20 {
function transfer(address _to, uint256 _value) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function lucaToFragment(uint256 value) external view returns (uint25... | A method in which users pledge LUCA to trusted nodes. The nodes must be in the top 11 of the pledge, and the user's pledge can obtain the pledge income _nodeAddr trusted node _amount the pledge number/ | function stakeLuca(address _nodeAddr, uint256 _amount) override external onlyNodeAddr(_nodeAddr){
address _sender = msg.sender;
require(lucaToken.transferFrom(_sender,address(this),_amount), "Token transfer failed");
uint256 fragment = lucaToken.lucaToFragment(_amount);
require(fragm... | 974,584 |
pragma solidity ^0.5.13;
import './interfaces/SyscoinSuperblocksI.sol';
import "./SyscoinErrorCodes.sol";
import "./SyscoinTransactionProcessor.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "./SyscoinParser/SyscoinMessageLibrary.sol";
// @dev - Manages superblocks
//
// Management of super... | - Initializes superblocks contract Initializes the superblock contract. It can only be called once. _blocksMerkleRoot Root of the merkle tree of blocks contained in a superblock _timestamp Timestamp of the last block in the superblock _mtpTimestamp Median Timestamp of the last block in the superblock _lastHash Hash... | function initialize(
bytes32 _blocksMerkleRoot,
uint _timestamp,
uint _mtpTimestamp,
bytes32 _lastHash,
uint32 _lastBits,
bytes32 _parentId
) external returns (uint, bytes32) {
require(bestSuperblock == 0);
require(_parentId == 0);
bytes32... | 6,418,210 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {IKODAV3Minter} from "../core/IKODAV3Minter.sol";
import {IKODAV3PrimarySaleMarketplace} from "../marketplace/KODAV3PrimaryMarketplace.sol";
import {ICollabRoyaltiesRegistry} from "../coll... | Make tokens & edition | function mintConsecutiveBatchEditionAsProxy(
address _creator,
SaleType _saleType,
uint16 _editionSize,
uint128 _startDate,
uint128 _basePrice,
uint128 _stepPrice,
string calldata _uri,
address _deployedRoyaltiesHandler
) canMintAgain external {
... | 6,354,168 |
./full_match/44787/0x826c83cB9f9238546c6e823cf1a696E42Ae880B2/sources/contracts/MasterChef.sol | Deposit LP tokens to MasterChef for SYMM allocation. | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
for (uint i=0; i<totalRewardTokens; i++) {
uint256 pending = user.am... | 13,244,594 |
pragma solidity 0.7.6;
import "contracts/protocol/futures/futureWallets/RateFutureWallet.sol";
/**
* @title Contract for iFarm Future Wallet
* @author Gaspard Peduzzi
* @notice Handles the future wallet mechanisms for the yearn platform
* @dev Implement directly the rate future wallet abstraction as it fits the i... | collect and update the yield balance of the sender _periodIndex the index of the corresponding period _userFYT the FYT holder balance _totalFYT the total FYT supply return the yield claimed/ | function _updateYieldBalances(
uint256 _periodIndex,
uint256 _userFYT,
uint256 _totalFYT
) internal override returns (uint256) {
uint256 claimableYield = (_userFYT.mul(futureWallets[_periodIndex])).div(_totalFYT);
futureWallets[_periodIndex] = futureWallets[_periodIndex].... | 1,215,866 |
pragma solidity 0.5.4;
import 'ROOT/reporting/IUniverse.sol';
import 'ROOT/libraries/ITyped.sol';
import 'ROOT/factories/IReputationTokenFactory.sol';
import 'ROOT/factories/IDisputeWindowFactory.sol';
import 'ROOT/factories/IMarketFactory.sol';
import 'ROOT/factories/IAuctionFactory.sol';
import 'ROOT/reporting/IMar... | Escrowed funds for open orders Market Open Interest. If we're finalized we need actually calculate the value | function assertMarketBalance() public view returns (bool) {
IMarket _market = IMarket(msg.sender);
uint256 _expectedBalance = IOrders(augur.lookup("Orders")).getTotalEscrowed(_market);
if (_market.isFinalized()) {
IReportingParticipant _winningReportingPartcipant = _market.getWin... | 6,386,045 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./libs/IPancakeswapFarm.sol";
import "./libs/IBEP20.sol";
import "./libs/SafeBEP20.sol";
... | uint256 prevAmount = IBEP20(_tokenAddress).balanceOf(address(this)); | function withdraw(
address _tokenAddress,
uint256 _farmPid,
uint256 _wantAmt
) public nonReentrant onlyChef returns (uint256) {
require(_wantAmt > 0, "_wantAmt <= 0");
if (_farmPid == 0) {
IPancakeswapFarm(farmContractAddress).withdraw(_farmPid, _wantAmt);
... | 14,083,157 |
./full_match/5/0xABcaaeBAdb32a03cA7Ec292103b4809fF677B857/sources/contracts/StrategyGenLevCompFarmWETH.sol | File: contracts/Strategies/StrategyGenLevCompFarm/Interfaces/IFlashLoanPlugin.sol | interface IFlashLoanPlugin {
function setAaveLendingPoolAddressesProvider(
address _aaveLendginPoolAddressesProvider) external;
function setSOLO(address _solo) external;
function doDyDxFlashLoan(
bool _deficit,
uint256 _amountDesired
)
external
returns(uint256);
... | 1,859,461 |
./full_match/1/0xeb6147C42Bc313C49cfd89BbF85561732538c427/sources/contracts/Libraries/DividendDistributor.sol | if(shares[shareholder].amount > 0) { distributeDividend(shareholder); } | function setShare(address shareholder, uint256 amount) external override onlyToken {
if(amount > 0 && shares[shareholder].amount == 0){
addShareholder(shareholder);
removeShareholder(shareholder);
}
totalShares = totalShares.sub(shares[shareholder].amount).add(amoun... | 4,983,788 |
./partial_match/1/0x9C3AFDDEa87a726891A44C037242393D524CAcFE/sources/contracts/PancakeV3Factory.sol | @inheritdoc IPancakeV3Factory | function createPool(
address tokenA,
address tokenB,
uint24 fee
) external override returns (address pool) {
require(tokenA != tokenB);
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0));
... | 2,749,022 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.6;
import "./Ownable.sol";
import "./SafeMath.sol";
import "./Roles.sol";
import "./ProjectToken_interface.sol";
import "./TetherToken_interface.sol";
contract AdminRole is Context, Ownable {
using Roles for Roles.Role;
using SafeMath for uint256;
... | Close the sales. After this method is called, no further purchases may take place. This can not be reverted. If there are unsold tokens they will remain with the original holder of the tokens that issued allowence for this contract to sell them. reset the address of the signature and the holder of the tokens for sale s... | function stopTokensale() public onlyOwnerOrAdmin{
require(checkValidMultiSignatures(), "There is no required number of signatures");
_signer_address = address(0);
_tokensale_status = 0;
cancelAllMultiSignatures();
}
| 12,552,771 |
./full_match/5/0x155040625D7ae3e9caDA9a73E3E44f76D3Ed1409/sources/contracts/DoTx/RevomonToken.sol | Transfer tokens from one address to another. from The address which you want to send tokens from to The address which you want to transfer to value the amount of tokens to be transferred return A boolean that indicates if the operation was successful./ | function transferFrom(address from, address to, uint256 value) public virtual override(ERC20) whenNotPaused returns (bool) {
return super.transferFrom(from, to, value);
}
| 1,922,085 |
./full_match/5/0x056ecbAd487FCe944761712E3BdcdAE166952282/sources/contracts/CrowdFunding.sol | if everything is good | function createCampaign(address _owner , string memory _title , string memory _description , uint256 _target,uint256 _deadline,string memory _image) public returns(uint256) {
Campaign storage campaign = campaigns[numberOfCampaigns];
require(campaign.deadline < block.timestamp,"The deadline should a... | 7,049,073 |
/* Orgon.Sale2 */
pragma solidity ^0.4.21; //v8
library SafeMath {
/**
* Add two uint256 values, throw in case of overflow.
* @param x first value to add
* @param y second value to add
* @return x + y
*/
function add (uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x +... | Integer division of two numbers truncating the quotient, reverts on division by zero./ | function div(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a / b;
return c;
}
| 6,403,285 |
./full_match/137/0x05Ee7B3701d8c19EcFBCbDcD0A2Bda8eb25790BA/sources/contracts/Bucket/Bucket.sol | @inheritdoc IBucket/ if liquidity mining failed, take all tokens from aave during first withdraw from bucket if liquidity mining is in progress, withdraw needed amount from aave | function withdraw(address _borrowAssetReceiver, uint256 _amount) external override nonReentrant {
_notBlackListed();
if (!LMparams.isBucketLaunched) {
LMparams.liquidityMiningRewardDistributor.removePoints(name, msg.sender, _amount);
_require(
_amount <=
... | 4,683,705 |
./partial_match/1/0x1aeF1E61F53dAf8369cDB077658dAe3076700835/sources/PoliticianDebate.sol | If enough time has passed since the last buyback, perform another buyback | function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords)
internal
override
{
require(statuses[requestId].fees > 0, "Request not found");
statuses[requestId].fulfilled = true;
statuses[requestId].randomWord = randomWords[0];
Politician... | 15,669,952 |
./full_match/77/0x24A8EB688BF52dE873E8d42144b1F84F0D9aC225/sources/contracts/libraries/AffiliateHelper.sol | Add information about the bet made from an affiliate. affiliate address indicated as an affiliate when placing bet conditionId the current match or game ID betAmount amount of tokens is bet from the affiliate payout possible bet winnings outcomeIndex index of predicted outcome/ | function updateContribution(
contributions storage _contributions,
contributedConditionIds storage _contributedConditionIds,
affiliatedProfit storage _affiliatedProfit,
address affiliate,
uint256 conditionId,
uint128 betAmount,
uint128 payout,
uint8 ou... | 5,046,904 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.