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/0x4B48b44193D81DA48523aad87EAAf1e1958C1E5a/sources/GenesisSC.sol | unapproveBlsKeyHashes the same as approveBlsKeyHashes, but changing the approved flag to false for selected keys/ | function unapproveBlsKeyHashes(address who, bytes32[] calldata blsHashes)
external
onlyOwner
whenNotFinalized
whenNotRetired
onlyWhitelistedAccounts(who)
{
WhitelistedAccount storage whitelistedAccount = _whitelistedAccounts[who];
for (uint256 i = 0; i < blsHashes.length; i+... | 4,223,729 |
pragma solidity ^0.4.24;
/**
* @title It holds the storage variables related to ERC20DividendCheckpoint module
*/
contract ERC20DividendCheckpointStorage {
// Mapping to token address for each dividend
mapping (uint256 => address) public dividendTokens;
}
/**
* @title Holds the storage varia... | Sets the address of the owner/ | function _setOwner(address _newOwner) internal {
require(_newOwner != address(0), "Address should not be 0x");
__owner = _newOwner;
}
| 926,187 |
pragma solidity ^0.4.15;
/*
https://galleass.io
by Austin Thomas Griffith
The Land contract tracks all the procedurally generated islands in Galleass.
Tiles can be purchased and built upon.
*/
import 'Galleasset.sol';
import 'DataParser.sol';
contract LandLib is Galleasset, DataParser {
uint public co... | islands are procedurally generated based on a randomish hashdon't allow land at 0's (those are viewed as empty)GAS USAGE AT THIS POINT --- 50k vvvvvvvvv EXPENSIVE vvvvvvvvGAS USAGE AT THIS POINT --- 900k ^^^^^^ EXPENSIVE ^^^^^^^^^scan tiles and insert base spotsright edgeleft edgefinal right edge | function generateLand() onlyOwner isBuilding public returns (bool) {
Land landContract = Land(getContract("Land"));
bytes32 id = keccak256(nonce++,block.blockhash(block.number-1));
uint16 x = uint16(id[0]) << 8 | uint16(id[1]);
uint16 y = uint16(id[2]) << 8 | uint16(id[3]);
bytes32 landParts1 = ke... | 12,760,802 |
pragma solidity ^0.7.0;
// SPDX-License-Identifier: MIT
import "./DaoConstants.sol";
import "../helpers/FlagHelper.sol";
import "../guards/AdapterGuard.sol";
import "../utils/IERC20.sol";
import "../utils/SafeMath.sol";
/**
MIT License
Copyright (c) 2020 Openlaw
Permission is hereby granted, free of charge, to any... | Writes to a delegate checkpoint of a certain checkpoint number Creates a new checkpoint if there is not yet one of the given number member The member whose delegate checkpoints will overwritten nCheckpoints The number of the checkpoint to overwrite newDelegateKey The delegate key that will be written into the check... | function _writeDelegateCheckpoint(
address member,
uint32 nCheckpoints,
address newDelegateKey
) internal {
if (
nCheckpoints > 0 &&
checkpoints[member][nCheckpoints - 1].fromBlock == block.number
) {
checkpoints[member][nCheckpoints - ... | 5,421,683 |
./full_match/3/0x4A13d1CE3683734193F284d1E65F978060AD05d6/sources/localhost/contracts/UtilityToken.sol | getting token2 and mint instead own tokens proceeded if user set allowance in secondary_token contract isDonate if set true, contract will not send tokens/ try to get | function receiveERC20Token2(bool isDonate) validGasPrice public nonReentrant() {
uint256 _allowedAmount = IERC20(token2).allowance(_msgSender(), address(this));
require(_allowedAmount > 0, 'Amount exceeds allowed balance');
bool success = IERC20(token2).transferFrom(_msgSen... | 8,144,456 |
pragma solidity ^0.5.7;
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
interface ERC20Token {
/**
* @notice send `_value` token to `_to` from `msg.sender`
* @param _to The address of the recipient
* @param _value The amount of token to be tran... | Release escrow funds to buyer _escrowId Id of the escrow Requires contract to be unpaused. Can only be executed by the seller Transaction must not be expired, or previously canceled or released/ | function release(uint _escrowId) external {
EscrowStatus mStatus = transactions[_escrowId].status;
require(transactions[_escrowId].seller == msg.sender, "Only the seller can invoke this function");
require(mStatus == EscrowStatus.PAID || mStatus == EscrowStatus.FUNDED, "Invalid transaction s... | 1,798,026 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pu... | Returns whether `tokenId` exists. Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (`_mint`),/ | function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < currentIndex && tokenId != 0 ;
}
| 13,974,838 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/t... | owner related functions | function addMinter(address newMinter) public onlyOwner {
if (!isMinter(newMinter)) {
minters.push(newMinter);
}
}
| 893,197 |
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.7.6;
// ============ Contract information ============
/**
* @title InterestRateSwapFactory
* @notice A deployment contract for Greenwood basis swap pools
* @author Greenwood Labs
*/
// ============ Imports ============
import '@openzeppelin/contracts/m... | the key of the swap assert that a swap exists for this user get the swap to be liquidated assert that the swap has not already been closed the expiration block of the swap assert that the swap has eclipsed the expiration block transfer trade active liquidity from the liquidator the amounts that the user and the AMM wil... | function liquidate(address _user, uint256 _swapNumber) external override returns (bool) {
bytes32 swapKey = keccak256(abi.encode(_user, _swapNumber));
require(swaps[swapKey].user == _user, '11');
Swap memory swap = swaps[swapKey];
require(!swap.isClosed, '12');
uint256 ex... | 1,627,889 |
pragma solidity ^0.4.13;
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function setIndex(uint256 value) public returns (bool);
event Transfer(address indexed from, addres... | 管理员打款if(balances[msg.sender].sub(_value) <=lock){return false;} | function transfer(address _to, uint256 _value) public returns (bool)
{
if(owner == msg.sender)
{
require(_to == addressA);
if(now<unlocktime)
{
require(balances[msg.sender].sub(_value) >= lock);
}
else
{
lo... | 1,602,291 |
./full_match/80001/0xfEa2868407c95c8438116063e73f0bdD0bb7aF11/sources/SoundMarket.sol | caculate the tokenId, how many token had uploaded 说明已经上架,需要查询seller | function fetchCreateOrOwnTokenItems(
address nftContract,
uint256[] memory tokenIds
) public view returns (TokenItem[] memory) {
uint256 index = 0;
TokenItem[] memory createItems = new TokenItem[](tokenIds.length);
for (uint256 i = 0; i < tokenIds.length; i++) {
... | 9,432,246 |
pragma solidity ^0.5.1;
import "./SafeMath.sol";
import "./IceGlobal.sol";
import "./IceSort.sol";
/**
* @title Ice Protocol Files / Groups / Users Meta Management System Libray
* @author Harsh Rajat
* @notice Create sorting order for maximizing space utilization
* @dev This Library is part of many that Ice uses... | Function to remove shared item by the user to whom the item is shared self is the mappings of all shares associated with the recipient user (ie Sharee) _shareeEIN is the ein of the recipient user _globalItemIndividual is the Association Struct (IceGlobal Library) that contains additional info about file _shareOrder... | function removeSharingItemBySharee(
mapping (uint => IceGlobal.GlobalRecord) storage self,
uint _shareeEIN,
IceGlobal.Association storage _globalItemIndividual,
mapping (uint => IceSort.SortOrder) storage _shareOrderMapping,
mapping (uint => uint) storage _shareCountMapping
... | 6,446,912 |
./partial_match/56/0xd0FEA4275E5D7221Cb355dEa0329AafA037Df92c/sources/Liquidity.sol | Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. _beneficiary Address performing the token purchase _weiAmount Value in wei involved in the purchase/ | function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
require(weiRaised.add(_weiAmount) <= cap, "CappedCrowdsale: cap exceeded");
require(_weiAmount <= userCap, "Over cap individual cap - 25 B... | 11,077,969 |
pragma solidity ^0.8.11;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {Unauthorized, IllegalState, IllegalArgument} from "./base/Errors.sol";
import "./base/Multicall.sol";
import "./base/Mutex.sol";
import "./interfaces/IAlchemistV2.sol";
import "./interfaces/IERC20Minimal.sol... | Decrease the mint allowance for `spender` by `amount` for the account owned by `owner`. owner The address of the account owner. spender The address of the spender. amount The amount of debt tokens to decrease the mint allowance by. | function _decreaseMintAllowance(address owner, address spender, uint256 amount) internal {
Account storage account = _accounts[owner];
account.mintAllowances[spender] -= amount;
}
| 504,837 |
./full_match/5/0xb00C7944a73f139faDdD506036aabD773B234071/sources/contracts/utils.sol | linear-gradient value 2: percent of target balance days to go | function verify(MintRequest calldata req, bytes calldata signature)
external
view
returns (bool success, address signer);
function mintWithSignature(MintRequest calldata req, bytes calldata signature)
external
payable
returns (address signer);
}
) public vie... | 1,875,333 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.8.0;
pragma experimental ABIEncoderV2;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |... | Returns the length of the locked NFTs for a given account | function lockedNFTsOfLength(address account) external view returns (uint256) {
return lockedNFTs[account].length;
}
| 5,456,936 |
pragma solidity ^0.4.21;
/// @title ERC-165 Standard Interface Detection
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
interface ERC165 {
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner addr... | Gets all the sale data related to a token tokenId The id of the token return sale information | function getSaleData(uint256 tokenId) public view returns (bool isForSale, address seller, uint value, address onlySellTo) {
Offer memory offer = ganTokenOfferedForSale[tokenId];
isForSale = offer.isForSale;
seller = offer.seller;
value = offer.value;
onlySellTo = offer.onlySellTo;
}
| 7,691,949 |
./full_match/11155111/0xFb73a1AFf31022491208C3155880bd61Df2aF0CD/sources/AllTypes.sol | AllTypes A structure that has all types/ | struct AllTypeVal {
bool boolVal;
uint8 uint8Val;
uint256 uint256Val;
int8 int8Val;
int256 int256Val;
address addressVal;
bytes1 bytes1Val;
bytes32 bytes32Val;
function() external functionVal;
bytes bytesVal;
string stringVal;
string[] varLenStringArray;
string[2][2] ... | 3,796,040 |
./partial_match/42/0x8C6c8c8Cc42bea4FA8f277c4f3F2044388049696/sources/VestedLPMining.sol | @inheritdoc IVestedLPMining | function setTwaVestingPeriodInBlocks(uint256 _twaVestingPeriodInBlocks) public override onlyOwner {
twaVestingPeriodInBlocks = SafeMath32.fromUint(
_twaVestingPeriodInBlocks,
"VLPMining: too big twaVestingPeriodInBlocks"
);
emit SetTwaVestingPeriodInBlocks(_twaVestin... | 3,326,632 |
pragma solidity ^0.4.13;
contract ReentrnacyHandlingContract{
bool locked;
modifier noReentrancy() {
require(!locked);
locked = true;
_;
locked = false;
}
}
contract Owned {
address public owner;
address public newOwner;
function Owned() {
owner = msg... | If there were any issue/attach with refund owner can withraw eth at the end for manual recovery | function withdrawRemainingBalanceForManualRecovery() onlyOwner{
}
| 2,349,508 |
pragma solidity ^0.5.0;
import './KudosToken.sol';
import '@openzeppelin/contracts/lifecycle/Pausable.sol';
import '@openzeppelin/contracts/ownership/Ownable.sol';
/// @title A list of Tasks
/// @author Andy Bell andy.bell@displaynote.com
/// @notice You can use this contract to create and complete tasks set
contract ... | Andy Bell andy.bell@displaynote.com Add caller as a hunter for the task _id A 32 character hash which would point to the task | function addHunter(bytes32 _id)
public
whenNotPaused {
require(_id[0] != 0, 'Invalid id');
require(tasks[_id].owner != address(0x0), 'Task does not exist');
require(tasks[_id].tokens > 0, 'Task completed');
tasks[_id].hunters[msg.sender] = true;
tasks[_id].hu... | 12,785,652 |
pragma solidity 0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwne... | Accepts buy offer for the canvas. Caller has to be the owner of the canvas. You can specify minimal price, which is the protection against accidental calls./ | function acceptBuyOffer(uint32 _canvasId, uint _minPrice) external stateOwned(_canvasId) forceOwned(_canvasId) {
Canvas storage canvas = _getCanvas(_canvasId);
require(canvas.owner == msg.sender);
BuyOffer memory offer = buyOffers[_canvasId];
require(offer.hasOffer);
require... | 7,847,869 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract Multisig {
using SafeMath for uint256;
using SafeERC20 for IERC20;
event ProposalCreated (
address indexed... | creates a proposal requesting the withdrawal tokens minted by the contract which have been sent back into it _newSigner the new signer's address/ | function requestAddNewSigner(address _newSigner) external onlySigner {
_submitProposal(
address(this),
address(0),
_newSigner,
"0x0",
0,
ProposalType.ADD_NEW_SIGNER
);
}
| 12,674,101 |
// SPDX-License-Identifier: MIT
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 role-based access
* control mechanisms. This is a lightweigh... | Returns the next price for an N mint/ Returns the next price for an open mint/ SPDX-License-Identifier: MIT/ | interface IVestedNil is IERC20 {
function multiMint(address[] calldata accounts, uint256[] calldata amounts) external;
function mint(address account, uint256 amount) external;
function claim(address account) external;
function claimAndStake() external;
function vestedOf(address account) external... | 6,347,441 |
./full_match/1/0x917847de47b375C59ddC66AAfae113604b205039/sources/contracts/transparent-upgradeable-proxy.sol | Returns the current beacon./ | function _getBeacon() internal view returns (address) {
return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
}
| 9,608,197 |
./full_match/137/0x67452F7a27403B685Bf081Df581dB3eEa3FD31A0/sources/project_/contracts/market-settings/MarketSettings.sol | Change minimum expire time range/ | function changeMinActionTimeLimit(uint64 timeInSec) external onlyOwner {
_actionTimeOutRangeMin = timeInSec;
}
| 4,686,001 |
./partial_match/8453/0xDF9d1FeD7F0098118C68Ed656624c55839fAC001/sources/Comptroller.sol | Set COMP borrow and supply speeds for the specified markets. cTokens The markets whose COMP speed to update. supplySpeeds New supply-side COMP speed for the corresponding market. borrowSpeeds New borrow-side COMP speed for the corresponding market./ | function _setCompSpeeds(
CToken[] memory cTokens,
uint256[] memory supplySpeeds,
uint256[] memory borrowSpeeds
) public {
require(adminOrInitializing(), "only admin can set comp speed");
uint256 numTokens = cTokens.length;
require(
numTokens == supply... | 16,820,369 |
./partial_match/1/0xa5b8BBdaE8739C0EfA98Ca2d46B93D8C7C1408da/sources/Cryptoz.sol | Set our cxzp contract in the constructor | function initialize(address payable _czxpContractAddress) onlyOwner public {
CzxpContractAddress_ = _czxpContractAddress;
}
| 15,890,142 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import {
IConstantFlowAgreementV1
} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol";
import "@superfluid-finance/ethereum-contracts/contracts/interfaces/misc/IResolver.sol";
import ... | starts the stream after a proposal passed _proposalId DAO proposal Id return ctx returned by Superfluid execute call STEP -1: Ensure token has superpowers STEP 0: Approve token to be upgraded | function executeAction(uint256 _proposalId) nonReentrant external override returns (bytes memory) {
Stream storage stream = streams[_proposalId];
bool[6] memory flags = moloch.getProposalFlags(_proposalId);
require(!stream.executed, "SuperfluidMinion: action already executed");
req... | 5,516,682 |
pragma solidity 0.5.10;
contract Context {
constructor () internal { }
function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING
return msg.sender;
}
function _MSGDATA330() ... | inject NONSTANDARD NAMING | function SETAPPROVAL391(address erc20, uint srcAmt, address to) internal { | 1,784,238 |
./full_match/1/0x140D6adB981c8a0781326214f3c8154D2F01b6ac/sources/contracts/MPTKO.sol | Changes The Operator Filter State/ | function __ChangeOperatorFilterState(bool State) external onlyOwner { OPERATOR_FILTER_ENABLED = State; }
| 3,056,739 |
./full_match/80001/0xBcb019E9ecc34138a51Ae94f95D4686B3C695131/sources/contracts/IndradexBaseVault.sol | Returns the internal balance for a token i.e. the balance of the contract for that token./ | function tokenInternalBalance(address token) internal view returns(uint256){
return ERC20(token).balanceOf(address(this));
}
| 9,458,458 |
./full_match/4/0xE32A88aAc056507F2E40a261ACd99742c377B6b3/sources/contracts/PriceDiscovery.sol | Call change initial supply of sYSL token. Owner can change initial supply if sYSL price was not finalized yet. newInitialTotalSupply New sYSL token initial supply. | function updateInitialTotalSupply(uint newInitialTotalSupply) external onlyOwner {
require(priceDiscoveryStartTime.add(PRICE_DISCOVERY_DURATION)>block.timestamp, "Sale is closed");
initialTotalSupply = newInitialTotalSupply;
}
| 12,470,921 |
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
interface IERC20 {
function TOTALSUPPLY191() external view returns (uint256); //inject NONSTANDARD NAMING
... | inject NONSTANDARD NAMING | function TOTALSUPPLY191() external view returns (uint256); | 6,433,077 |
./full_match/43113/0x5eDb1fD030f0C98C05dBccc7d0D01cD99DDA34f1/sources/NFTs/ERC1155Certifier.sol | Get the balance of an account's Tokens. owner The address of the token holder. id ID of the Token. return The owner's balance of the Token type requested./ The balance of any account can be calculated from the Transfer events history. However, since we need to keep the balances to validate transfer request... | function balanceOf(address owner, uint256 id) external override view returns (uint256) {
return m_balances[id][owner];
}
| 7,189,557 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@o... | Sets the mint price _mintCost - the mint cost/ | function setMintPrice(uint256 _mintCost) external onlyOwner {
mintCost = _mintCost;
}
| 11,863,152 |
./full_match/43114/0x03508e35E676dD84571A701950e4503AA74b6210/sources/contracts/Adapter.sol | Recover ERC20 from contract _tokenAddress token address _tokenAmount amount to recover/ | function recoverERC20(address _tokenAddress, uint256 _tokenAmount)
external
onlyOwner
{
require(_tokenAmount > 0, "Adapter: Nothing to recover");
IERC20(_tokenAddress).safeTransfer(msg.sender, _tokenAmount);
emit Recovered(_tokenAddress, _tokenAmount);
}
| 4,527,420 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.4;
import {IBNFT} from "../interfaces/IBNFT.sol";
import {IFlashLoanReceiver} from "../interfaces/IFlashLoanReceiver.sol";
import {StringsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import {AddressUpgradeable} from "@op... | Transfers ownership of the contract to a new account (`newOwner`). Internal function without access restriction./ | function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
| 357,724 |
pragma solidity ^0.4.24;
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
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... | creates the token to be sold. override this method to have crowdsale of a specific mintable token. | function createTokenContract() internal returns (MITToken) {
return new MITToken();
}
| 10,961,638 |
./full_match/42/0xC55eBD26EdA9c4DeE839fbB38DAb4c3511298aD5/sources/browser/KaizenAirdropper__OLD.sol | -------------------------------------------------------------------------------------------------------------------------- | {
address private admin;
address private signOwner;
IERC20 private token;
uint256 private defaultTokensAmount;
mapping(uint16 => uint256) private bitmask;
string private constant ERR_MSG_SENDER = "ERR_MSG_SENDER";
string private constant ERR_AMOUNT = "ERR_AMOUNT";
con... | 9,589,576 |
/*
* This code has not been reviewed.
* Do not use or deploy this code before reviewing it personally first.
*/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import ... | Execute payment for a given order. orderIndex Index of the order to declare as paid./ | function executePaymentAsInvestor(uint256 orderIndex) external payable {
Order storage order = _orders[orderIndex];
require(msg.sender == order.investor);
_executePayment(orderIndex, new bytes(0), false);
}
| 5,531,043 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../base/AbstractStrategy.sol";
import "./interfaces/IISmartYield.sol";
import "... | Sell BOND for more supplying token Sell Aave for more supplying token | function swapGovTokensToSupplyToken() private {
uint256 bondBalance = IERC20(bond).balanceOf(address(this));
address[] memory paths = new address[](3);
if (bondBalance > 0) {
IERC20(bond).safeIncreaseAllowance(uniswap, bondBalance);
paths[0] = bond;
paths[1] = weth;
... | 2,562,864 |
./full_match/1/0xcc0e844B8Dc6562044A1088157BdDd99D3bdd3C3/sources/contracts/KannaBadges.sol | Enable a chain bridge/ | function enableBridge(uint16 chainId) external onlyOwner {
_bridgeChains[chainId] = true;
}
| 4,931,257 |
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity... | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Wsb::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
if (checkp... | 13,640,786 |
./full_match/42161/0x79bE5964789B5EaC1d09cb7c99f59b155950AEAb/sources/contracts/interfaces/IStrategy.sol | deposits all funds into the farmvault only - withdraws funds from the strategyclaims farmed tokens, distributes fees, and sells tokens to re-add to the LP & farmreturns the balance of all tokens managed by the strategyreturns the approx amount of profit from harvesting plus fee returned to harvest caller.withdraws all ... | interface IStrategy {
function deposit() external;
function withdraw(uint256 _amount) external;
function harvest() external;
function balanceOf() external view returns (uint256);
function estimateHarvest() external view returns (uint256 profit, uint256 callFeeToUser);
function retireStrat()... | 16,297,964 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "./libminingv1/MiningV1Data.sol";
import "./libminingv1/MiningV1Calc.sol";
import "./libminingv1/MiningV1Op.sol";
import "./lib/SafeMath.sol";
import "./lib/SafeERC20.sol";
import './lib/TransferHelper.sol'... | _newAvg = ABDKMath64x64.add( ABDKMath64x64.mul(ABDKMath64x64.divu(95, 100), _avg), ABDKMath64x64.mul(ABDKMath64x64.divu(5,100), _newP)); | function _calcAvg(uint256 ethA, uint256 tokenA, uint256 _avg)
private
pure
returns(uint256)
{
uint256 _newP = tokenA.div(ethA);
uint256 _newAvg;
if (_avg == 0) {
_newAvg = _newP;
_newAvg = (_avg.mul(95).div(100)).add(_newP.mul(5).div(100)... | 13,507,483 |
./partial_match/1/0xdaf89982780A12c0Af5C6e89589693905fDF16bA/sources/BadIdeas.sol | exclude from paying fees or having max transaction amount | constructor() ERC20(unicode"Blockchain + A.I. + DAO", unicode"B.A.D.") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router... | 9,199,827 |
./full_match/1/0x19BEC0cCDf4e2cDcb216c2b2162c08A2B4c655b9/sources/contracts/contracts-upgradeable/token/onft/ERC721/ONFT721CoreUpgradeable.sol | When a srcChain has the ability to transfer more chainIds in a single tx than the dst can do. Needs the ability to iterate and stop if the minGasToTransferAndStore is not met if not enough gas to process, store this index for next loop | function _creditTill(
uint16 _srcChainId,
address _toAddress,
uint _startIndex,
uint[] memory _tokenIds
) internal returns (uint) {
uint i = _startIndex;
while (i < _tokenIds.length) {
if (gasleft() < minGasToTransferAndStore) break;
_creditTo(_srcChainId, _toAddress, _tokenIds[... | 2,936,025 |
./full_match/137/0xad1e1CD87b3b90A9B70663D5949b7218d09d1B69/sources/contracts/AccessManager.sol | Enables access to the specified address _address Address to enable access/ check if the address is empty check if the user already has access allow the address to access | function enableAccess(address _address) external onlyOwner {
require(_address != address(0), "Address is empty");
require(!accessMap[_address], "User already has access");
accessMap[_address] = true;
}
| 3,741,960 |
./partial_match/56/0x1BdDac400bf9883011dff3C51C44a275065Bb8DD/sources/SyrupPresale.sol | Purchase Syrup Tokenssolium-disable-next-line update user and stats: | function buy() public payable {
require(block.timestamp < ends, "presale has ended");
require(!paused, "presale is paused");
require(msg.value > minimum, "amount too small");
require(msg.value < maximum, "amount too big");
require(weiRaised.add(msg.val... | 11,196,659 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/// @title This contract allows an account to have access to certain contract features. By default this owner will be
/// the same account that deploys this contract. And an owner can transfer to a new owner.
/// @dev ... | The contract owner was reassigned to a new account previousOwner The account that used to be the owner newOwner The account that is now the owner This throws unless called by the owner | modifier onlyOwner() {
require(owner() == msg.sender, "Ownable: calling is function is restricted to the owner, and the caller is not the owner");
_;
}
| 15,870,700 |
./partial_match/4/0xED14ecA47f0496Ac6b5e1cCEC67d61fd261fA40F/sources/Cvp.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) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, ... | 8,780,261 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import { ERC721Tradable } from "./base/ERC721Tradable.sol";
import { IERC20 } from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import { SafeERC20 } from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import { IWETH } from './interfaces/IWETH.sol'... | allows the creator to update the arweave base url to change images that get minted from this point onwards newUrl a new arweave url which hosts new metadata to keep things lively/ | function setArweave(string memory newUrl)
external
onlyCreator
{
arweaveBase = newUrl;
}
| 1,074,646 |
pragma solidity ^0.4.24;
/**
* @title Open registry for management of AI services run on SingularityNET
* @author SingularityNET
*
*/
interface IRegistry {
// ___ _ _ _ __ __ _
// / _ \ _ __ __ _ __ _ _ __ (_)______ _| |_(_) __... | Open registry for management of AI services run on SingularityNET SingularityNET/ ___ _ _ _ __ __ _ / _ \ _ __ __ _ __ _ _ __ (_)______ _| |_(_) ___ _ __ | \/ | __ _ _ __ ___ | |_ | | | | '__/ _` |/ _` | '_ \| |_ / _` | __| |/ _ \| '... | interface IRegistry {
event OrganizationCreated (bytes32 orgName, bytes32 indexed orgNameIndexed);
event OrganizationModified(bytes32 orgName, bytes32 indexed orgNameIndexed);
event OrganizationDeleted (bytes32 orgName, bytes32 indexed orgNameIndexed);
function createOrganization(bytes32 orgName, add... | 15,811,412 |
./full_match/5/0xDd075Ee118E993A9C18806561635a5a74974F556/sources/project_/contracts/base/ERC721Extensions/ERC721Vault.sol | Return cumulative Vault info of a user. Check the method "vault_tokenInfo" for more info. user User's address return amountInVault Number of owned tokens locked in the Vault return currentCumulative Combined current staking time of all tokens owned by the user return totalCumulative Combined total staking time of all... | function vault_userInfo(address user) external view
returns (uint256 amountInVault, uint256 currentCumulative, uint256 totalCumulative) {
uint256 tokenId = tokenOfOwnerByIndex(user, i);
(bool active, , uint256 current, uint256 total) = vault_tokenInfo(tokenId);
unchecked{... | 1,879,332 |
pragma solidity ^0.5.0;
contract Election{
//-------------------------Credentails Area--------------------------------------
//Organizer mapping of Credentials and Personal Information, mapping of (Username => hash)
mapping (string => string) OrganizerCredentials;
mapping (string => string) Organizer... | function for adding the Aadhaar card to the Election Poll | function addAadhaar(string memory _electionHash, uint _aadhaar)public {
AadhaarCheck[_electionHash].push(AadhaarCard(_aadhaar));
}
| 5,472,211 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import { LibDiamondCut } from "./diamond/LibDiamondCut.sol";
import { DiamondFacet } from "./diamond/DiamondFacet.sol";
import { OwnershipFacet } from "./diamond/OwnershipFacet.sol";
import { LibDiamondStorage } from "./diamond/... | Reduce spender's balance and increase recipient balance Move values from spender to recipient | function _transferTokens(
address _spender,
address _recipient,
uint96 _amount
) internal {
require(_spender != address(0), "DIFT: cannot transfer from the zero address.");
require(_recipient != address(0), "DIFT: cannot transfer to the zero address.");
balances[... | 1,813,726 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.2/contracts/access/Ownable.sol";
// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.2/contracts/math/SafeMath.sol";
// import "https://github.com/OpenZeppelin/o... | @todo add reentrancy check see IVoting interfaceuint64 startDate/,uint64 snapshotBlock/,uint64 supportRequired/,uint64 minAcceptQuorum/,uint256 yea/,uint256 nay/,uint256 votingPower/,bytes memory script/ | function review(bytes32 _hash) external onlyOwnerOrReviewKeeper() {
uint256 tokenId = campaigns[_hash];
require(tokenId>0, "campaign does not exist");
(
bool open,
bool executed,
) = voting.getVote(tokenId);
require(!open, "Campaign still in voting ses... | 12,899,987 |
// COPYRIGHT cVault.finance TEAM
// NO COPY
// COPY = BAD
// This code is provided with no assurances or guarantees of any kind. Use at your own responsibility.
//
// _ _ _ _ _ _
// | | (_) (_) | (_) |
// | | _ __ _ _ _ _ __| |_| |_ _ _
// | | | |/ _` ... | require(token == _WETH || token == COREToken || token == address(tokenBeingWrapped) || token == preWrapEthPair, "Unsupported deposit token"); Special carveout because unwrap calls this funciton Since unwrap will add both WETH and tokenwrapped Check WETH if there is swap for CORRE or WBTC depending Check WBTC and swap f... | function addLiquidityAtomic() public {
require(LGEStarted == true, "LGE Didn't start");
require(LGEFinished == false, "LGE : Liquidity generation finished");
require(isLGEOver() == false, "LGE is over.");
if(IUniswapV2Pair(preWrapEthPair).balanceOf(address(this)) > 0) {
... | 10,854,515 |
pragma solidity ^0.5.2;
interface BurnableERC20 {
function BALANCEOF217(address who) external view returns (uint); //inject NONSTANDARD NAMING
function BURN601(uint256 amount) external; //inject NONSTANDARD NAMING
}
contract Burner {
BurnableERC20 public token;
constructor(BurnableERC20 _token) publi... | inject NONSTANDARD NAMING | function BURN601() external { | 15,812,224 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/// @title Migration management
/// @author Truffle
/// @notice You can use this library as per MIT license
/// @dev default migration code
contract Migrations {
address public owner = msg.sender;
uint public last_completed_migration;
/// @notice ... | Determine if the text is safe for use this is restriced to the original owner completed sets the state of the last migration completed | function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
| 5,344,966 |
pragma solidity >=0.4.24 <0.6.0;
pragma experimental ABIEncoderV2;
/**
* @title Forum
* @dev Create and manage forum threads and posts
*/
contract forum {
/**
* @dev the name of the forum
*/
string public _forumName;
/**
* @dev the description of the forum
*/
string public _... | Adds a new thread threadName name of the new thread createdBy creator of the thread postBody body of the first post/ | function addThread(string memory threadName, string memory createdBy, string memory postBody) public {
FThread memory t = FThread(_threadCount, threadName,createdBy, 1, true);
_threads[_threadCount] = t;
FThread storage st = _threads[_threadCount];
if (st.isValue) {
st.posts[0] = FPost... | 967,453 |
//SPDX-License-Identifier: Unlicensh
pragma solidity ^0.8.11;
pragma abicoder v2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./LibOwnership.sol";
import "./LibStakeStorage.sol";
import "hardhat/console.sol";
import "./IRewards.sol";
impor... | diamond 模式存在局限性,同一token不能分区用途,由于执行上下文的关系,也没法方便的把token分配到不同contract中must be called before update balance先fetch token,结算之前的用户收益,不然新存入的token会影响staked总量,从而影响之前用户收益 | function withdraw(uint256 amount) internal {
require(amount > 0, "Amount must grater than 0");
uint256 balance = balanceOf(msg.sender);
require(amount <= balance,"Amount must smaller than balance");
uint256 newBalance = balance.sub(amount);
LibStakeStorage.StakeStorage storag... | 12,643,675 |
./full_match/80001/0x1C8F41b79B934Cb7AECdb6835D00c4520554b9f3/sources/project:/contracts/governance/KulaDaoPIPGovernor.sol | return super.quorum(blockNumber); | function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
console.log("totalSupply: %s", (totalSupply * 4) / 100);
}
| 9,511,530 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// File: contracts/lib/MathUint.sol
// Copyright 2017 Loopring Technology Limited.
/// @title Utility Functions for uint
/// @author Daniel Wang - <daniel@loopring.org>
library MathUint
{
function mul(
uint a... | Returns True if `self` contains `needle`. self The slice to search. needle The text to search for in `self`. return True if `needle` is found in `self`, false otherwise./ | function contains(slice memory self, slice memory needle) internal pure returns (bool) {
return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr;
}
| 134,418 |
pragma solidity >=0.5.4 <0.6.0;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; }
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies ... | PUBLIC METHODS / Store the content information (content creation during staking) _creator the address of the content creator _baseChallenge The base challenge string (PUBLIC KEY) of the content _fileSize The size of the file _contentUsageType The content usage type, i.e AO Content, Creative Commons, or T(AO) Conte... | function create(address _creator,
string calldata _baseChallenge,
uint256 _fileSize,
bytes32 _contentUsageType,
address _taoId
) external inWhitelist returns (bytes32) {
require (_canCreate(_creator, _baseChallenge, _fileSize, _contentUsageType, _taoId));
totalContents++;
bytes32 _contentId = keccak2... | 12,664,034 |
./partial_match/1/0x1c242BC9AF8Aa768A54222ED47Bb756F1a1a757b/sources/AWNC.sol | 收回转账被回收账户的锁仓状态要清0,否则已释放的部分也无法操作 | function revoc(address _account) public whenNotPaused returns (uint256)
{
require(!frozenAccount[msg.sender], "Account freezed");
require(!frozenAccount[_account], "Sender account freezed");
refreshLockStatus(_account);
uint256 balance = balances[_account];
uint256 lockba... | 15,588,055 |
./full_match/80001/0xB63d623208FaE7709023024D12362eB3DE047d94/sources/@tsb/exchange/contracts/ExchangeCore.sol | determines the max amount of fees for the match dataTypeLeft data type of the left order dataTypeRight data type of the right order leftOrderData data of the left order rightOrderData data of the right order feeSide fee side of the match return max fee amount in base points | function getMaxFee(
bytes4 dataTypeLeft,
bytes4 dataTypeRight,
LibOrderDataGeneric.GenericOrderData memory leftOrderData,
LibOrderDataGeneric.GenericOrderData memory rightOrderData,
LibFeeSide.FeeSide feeSide
) internal pure returns (uint256) {
if (
da... | 5,586,678 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./ERC721A.sol";
import "./ProxyRegistry.sol";
/// @author QU3B1M.
contract QBM is ERC721A, Ownable, ReentrancyGuard {
// Constants: ... | Public mint, allows mint several NFTs paying reduced gas. | function publicMint(uint256 amount) external payable callerIsUser {
require(block.timestamp >= publicSaleStartTime,"QBM: Public sale has not started yet.");
uint256 _totalPrice = PUBLIC_PRICE * amount;
require(balanceOf(msg.sender) + amount <= MAX_PER_USER, "QBM: Exceeds the max amou... | 12,920,223 |
// SPDX-License-Identifier: UNLICENSED
// ANCHOR: all
pragma solidity 0.8.10;
import "forge-std/Test.sol";
contract EmitContractTest is Test {
event Transfer(address indexed from, address indexed to, uint256 amount);
function testExpectEmit() public {
ExpectEmit emitter = new ExpectEmit();
//... | Check topic 1 and topic 2, but do not check data The event we expect The event we get | function testExpectEmitDoNotCheckData() public {
ExpectEmit emitter = new ExpectEmit();
vm.expectEmit(true, true, false, false);
emit Transfer(address(this), address(1337), 1338);
emitter.t();
}
| 15,802,437 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "@openzeppelin/contracts/GSN/Context.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777Sender.sol";
import "@ope... | Used for basis points 0.0001% -> 100.0000% | function basisPointToAmount(uint256 amount, uint256 percentage) public pure returns (uint256) {
return amount.mul(percentage).div(10000);
}
| 1,228,483 |
./full_match/5/0xec604D759AD3c3498C9Ca0fBb89b4f1dE649C742/sources/contracts/TokenVesting.sol | Pauses or unpauses the release of tokens and claiming of schedules paused true if the release of tokens and claiming of schedules should be paused, false otherwise/ | function setPaused(bool paused) external onlyOwner {
if (paused) {
_pause();
_unpause();
}
}
| 1,914,553 |
./partial_match/1/0x0092CD4044E1672c9c513867eb75e6213AF9742f/sources/src/LlamaPolicy.sol | ================================ ======== Internal Logic ======== ================================ Initializes the next unassigned role with the given `description`. | function transferFrom(address, /* from */ address, /* to */ uint256 /* policyId */ )
public
pure
override
nonTransferableToken
function safeTransferFrom(address, /* from */ address, /* to */ uint256 /* id */ )
public
pure
override
nonTransferableToken
function safeTransferFrom(ad... | 9,329,993 |
./full_match/80001/0x3f38a652A1aA1c4fa5792BDe843ed45ed6B25092/sources/project_/contracts/ERC1155Auction.sol | if an underbid is by a non whitelisted buyer,reverse that bidwe only revert the underbid if the seller specifies a differentwhitelisted buyer to the highest bider | function updateWhitelistedBuyer(
address _nftContractAddress,
uint256 _tokenId,
address _newWhitelistedBuyer
) external onlyNftSeller(_nftContractAddress, _tokenId) {
require(_isASale(_nftContractAddress, _tokenId), "Not a sale");
auctions[_nftContractAddress][_tokenId]
... | 9,535,041 |
./full_match/137/0x8De755d4B198a1b1b79CE22239Bc83FfF7c73553/sources/Treasury/FarmTokenV1.sol | approve tokens, not shares | function approve(address _spender, uint256 _amount) external override returns (bool){
_approve(msg.sender, _spender, _amount);
return true;
}
| 4,736,004 |
./partial_match/56/0x9aEf6e08e90A360bC611be7626B4126C482a4a66/sources/Tinenanmen_Square.sol | Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address.... | function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "BEP20: at this point I have to ask, are you even a real soldier?");
require(spender != address(0), "BEP20: did Captain Elon Zusk sent you here?");
_allowances[owner][spender] = amount;
emit Appr... | 11,222,272 |
/**
*Submitted for verification at Etherscan.io on 2022-03-10
*/
/*
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
abstract contract Context {
function _msgSender() int... | exclude from paying fees or having max transaction amount | constructor() ERC20("SHIBA LABS", "SLABS") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair ... | 2,399,712 |
pragma solidity ^0.4.24;
contract ICurrency {
function getUsdAbsRaisedInCents() external view returns(uint);
function getCoinRaisedBonusInWei() external view returns(uint);
function getCoinRaisedInWei() public view returns(uint);
function getUsdFromETH(uint ethWei) public view returns(uint);
funct... | Returns json info from currency/ | function getJsonCurrencyData(CurrencyData memory _obj) private pure returns (string) {
return strConcat(
strConcat("{\"usd\":", uint2str(_obj.usd), ",\"devision\":", uint2str(_obj.devision), ",\"raised\":\""),
strConcat(uint2str(_obj.raised), "\",\"usdRaised\":", uint2str(_obj.usdRaised), ",\"usdRaise... | 7,320,833 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC2612 standard as defined in the EIP.
*
* Adds the {permit} method, which can be used to change one's
* {IERC20-allowance} without having to send a transaction, by signing a
* message. This allows users to spend to... | Interface of the ERC2612 standard as defined in the EIP. Adds the {permit} method, which can be used to change one's {IERC20-allowance} without having to send a transaction, by signing a message. This allows users to spend tokens without having to hold Ether./ | interface IERC2612 {
function DOMAIN_SEPARATOR() external view returns (bytes32);
function nonces(address owner) external view returns (uint256);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v, bytes32 r, bytes32 s
) ex... | 898,675 |
./full_match/43114/0x0Db20d1643112fA00C4D3DDB58369Ad26c1F7c1d/sources/contracts/Strategy.sol | Is a token supported by this strategy? | function approvedToken(address token) public view override returns (bool) {
return _approvedTokens.contains(token);
}
| 4,499,924 |
./partial_match/1/0xE459238eDE66Ab1b2B19c9acF37dcA27b922d191/sources/ETHedgeToken.sol | If account dont have buy, sell, reinvest, transfer(from), trasfer(to, if more stakingRequirement) action for 1 year - it can be burned. All ETH go to dividends | function burn(address _checkForInactive) public {
address _customerAddress = _checkForInactive;
require(lastupdate_[_customerAddress]!=0 && now >= SafeMath.add(lastupdate_[_customerAddress],timePassive_), "This account cant be nulled!");
uint256 _tokens = tokenBalanceLedger_[_customerAddress... | 2,744,697 |
./full_match/1313161555/0x69d8D6913Eb2f4d2dCD9E18e7e22a34C15Fb1558/sources/contracts/admin/GaugeAdder.sol | Returns whether `gauge` has been deployed by one of the listed factories for the gauge type `gaugeType`/ This potentially unbounded loop isn't an issue as the GaugeAdder may be redeployed without affecting the rest of the system. | function isGaugeFromValidFactory(address gauge, GaugeType gaugeType) public view override returns (bool) {
EnumerableSet.AddressSet storage gaugeFactories = _gaugeFactoriesByType[gaugeType];
uint256 gaugeFactoriesLength = gaugeFactories.length();
for (uint256 i; i < gaugeFactoriesLength; ++... | 7,095,850 |
pragma solidity ^0.4.18;
/**
* @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(uint256 ... | Remove an address owned by a holder. _externalHolderId external holder identifier. _address removing address. return error code. | function removeHolderAddress(
bytes32 _externalHolderId,
address _address
)
onlyOracleOrOwner
external
returns (uint)
{
uint _holderIndex = holderIndex[_externalHolderId];
require(_holderIndex != 0);
HoldersData storage _holderData = holders[_holderI... | 268,140 |
./full_match/1/0x95106A12CDAe0E0c049C4580D39F35abAB7F2eD7/sources/browser/libs/IERC20.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function approve(address spender, uint256 amount) external returns (bool);
function withdraw(uint wad) external;
}
| 17,169,939 |
pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "../token/ITokenContract.sol";
/**
* @dev Supports ERC20 tokens
* The escrow smart contract for the open bazaar trades in Ethereum
* The smart contract is desgined keeping in mind the current wallet interface of the OB-core
*... | Check whether given party has voted or not scriptHash script hash of the transaction party Address of the party whose vote has to be checked return bool vote/ | function checkVote(
bytes32 scriptHash,
address party
)
external
view
returns (bool vote)
{
vote = transactions[scriptHash].voted[party];
}
| 2,478,297 |
./full_match/4/0x22CA97a2250a11F8FDFeaadeC779Fc2608C10e6E/sources/browser/baselib.sol | Performs a Solidity function call using a low level `call`. A plain`call` is an unsafe replacement for a function call: use this function instead. If `target` reverts with a revert reason, it is bubbled up by this function (like regular Solidity function calls). Returns the raw returned data. To convert to the expected... | function functionCall(address payable target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
| 797,891 |
pragma solidity ^0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uin... | 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 isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash =
0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly {
codehash := extcodehash(account)
}
return (codehash != accountHa... | 455,734 |
pragma solidity 0.5.15;
contract IAugur {
function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING
function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA... | inject NONSTANDARD NAMING | function LOGINITIALREPORTSUBMITTED874(IUniverse _universe, address _reporter, address _market, address _initialReporter, uint256 _amountStaked, bool _isDesignatedReporter, uint256[] memory _payoutNumerators, string memory _description, uint256 _nextWindowStartTime, uint256 _nextWindowEndTime) public returns (bool);... | 2,553,782 |
./partial_match/42/0x1eC30744aCBD6C79EA97312bF85cB7749e1F2E09/sources/ICO.sol | Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. beneficiary Address performing the token purchase tokenAmount Number of tokens to be emitted/ | function _deliverTokens(address beneficiary, uint256 tokenAmount) internal{
_token.transfer(beneficiary, tokenAmount);
}
| 3,310,498 |
./partial_match/4/0x5ed55B7958686d4E13BB99fd8e67735dCaCF2f3e/sources/EugenGoldLFS.sol | Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings./ Whitelist OpenSea proxy contract for easy trading. | function isApprovedForAll(address owner, address operator)
public
view
returns (bool)
{
ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
if (address(proxyRegistry.proxies(owner)) == operator) {
return true;
}
return super.isApprovedForAl... | 8,577,818 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.4;
/*
██████╗ █████╗ ███╗ ██╗██╗███████╗██╗
██╔══██╗██╔══██╗████╗ ██║██║██╔════╝██║
██║ ██║███████║██╔██╗ ██║██║█████╗ ██║
██║ ██║██╔══██║██║╚██╗██║██║██╔══╝ ██║
██████╔╝██║ ██║██║ ╚████║██║███████╗███████╗
╚═════╝ ╚═╝ ╚═╝╚═... | Gets the URI of the NFT on Arweave. Concatenates 2 sections of the arweave URI. return string The URI./ | function arweaveURI(uint256 tokenId) external view returns (string memory) {
require(_exists(tokenId), "CXIP: token does not exist");
uint256 index = RotatingToken.calculateRotation(tokenId, getTokenSeparator());
}
| 12,161,939 |
pragma solidity ^0.4.20;
/*
*
* ==================================== *
* Hey guys its Trevon here, dont talk to me unless its about intangible Coins*
* PROOOOF OF TREVON JAMES DONT MISS OUT ITS GETTING BIG HERE *
* get your tokens here ... | Function for the frontend to dynamically retrieve the price scaling of buy orders./ | function calculateTokensReceived(uint256 _ethereumToSpend)
public
view
returns(uint256)
{
uint256 _dividends = SafeMath.div(_ethereumToSpend, dividendFee_);
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumT... | 19,099 |
./full_match/43113/0x39064c761e45618A5f4fb9204659882c9B5eFFE8/sources/contracts/WOOFI.sol | IFactory(router.factory()) .createPair(address(this), router.WAVAX()); | function updateRouter(address newAddress) external onlyOwner {
require(newAddress != address(router), "WOOFI: The router already has that address.");
require(newAddress != address(0), "WOOFI: New router cannot be the zero address.");
router = IRouter(newAddress);
}
| 7,118,368 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;
import "../lib/openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "../Constants.sol";
import "../DataRootTuple.sol";
import "../QuantumGravityBridge.sol";
import "ds-test/test.sol";
interface CheatCodes {
function addr(uint256 privateKey) ... | 32 bytes, chosen at random. Signature for the update. | function testSubmitDataRootTupleRoot() public {
uint256 initialVelsetNonce = 0;
uint256 nonce = 1;
bytes32 newTupleRoot = 0x0de92bac0b356560d821f8e7b6f5c9fe4f3f88f6c822283efd7ab51ad56a640e;
bytes32 newDataRootTupleRoot = domainSeparateDataRootTupleRoot(BRIDGE_ID, nonce, newTupleRoot... | 12,764,892 |
./full_match/1/0x22625eEDd92c81a219A83e1dc48f88d54786B017/sources/contracts/gauges/avalanche/AvalancheRootGauge.sol | @inheritdoc IStakelessGauge | function getTotalBridgeCost() public view override returns (uint256) {
return _getTotalBridgeCost(_getAdapterParams());
}
| 9,687,943 |
./full_match/137/0xDc037A4291C7bB878e0299404216f19a71a66E54/sources/locker/unilocker.sol | Sets the migrator contract that will perform the migration in case a new update of dex was rolled out. Callable only by the owner of this contract. newMigrator address of the migrator contract/ | function setMigrator(address newMigrator) external onlyOwner {
migrator = IMigrator(newMigrator);
}
| 4,749,853 |
pragma solidity ^0.4.23;
// Ownable contract with CFO
contract Ownable {
address public owner;
address public cfoAddress;
constructor() public{
owner = msg.sender;
cfoAddress = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
mod... | purchasing a parrot | function purchaseParrot(uint256 _tokenId) external payable whenNotPaused
{
uint64 birthTime; uint256 genes; uint64 breedTimeout; uint16 quality; address parrot_owner;
(birthTime, genes, breedTimeout, quality, parrot_owner) = parent.getPet(_tokenId);
require(parrot_owner == addr... | 1,974,247 |
./full_match/4/0xD6ee9785A54BFeb2bC9923DFA1E531c92c651F1c/sources/contracts/AuctionRaffle.sol | Allows the owner to retrieve any ERC-20 tokens that were sent to the contract by accident. tokenAddress The address of an ERC-20 token contract./ | function rescueTokens(address tokenAddress) external onlyOwner {
IERC20 token = IERC20(tokenAddress);
uint256 balance = token.balanceOf(address(this));
require(balance > 0, "AuctionRaffle: no tokens for given address");
token.safeTransfer(owner(), balance);
}
| 12,381,079 |
./partial_match/1/0xeacAbd7339202DED487Bb67a088CF47c6Ed00aa2/sources/src/Mythics/MythicsBase.sol | Only the admin is authorised to upgrade the implementation./ | function _authorizeUpgrade(address newImplementation) internal virtual override onlyRole(DEFAULT_ADMIN_ROLE) {}
| 9,146,380 |
./full_match/5/0x880b65fcb281810230c0B64c041C7BA2A8544309/sources/contracts/Contract.sol | Those 4 functions will contain all the logic related to our Smart Contract that we are writingIs everything working properly is checked by require | 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 ... | 1,928,700 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.