file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/5/0x777d8d5d76b3abE983dE78bC6c2a526b62381f64/sources/NCore.flat.sol | WRITE METHODS/ List source token that will be swapped. _token Token address./ | function listSrcToken(address _token) external onlyOwner {
require(_token != address(0), "NPairs: Null address not allowed");
require(!srcToken[_token], "NPairs: Token already listed");
_listSrcToken(_token);
}
| 11,585,835 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./LookupTables.sol";
library Calculus {
struct fn { // fn will always mean "function"
Form form;
int scalar;
int[] coefficients;
fn[] operands;
BinaryOp op;
uint one;
} // TODO put a mechanism to restrict domain in the fn, s... | else form == TRANSCENDENTAL | function evaluate(fn memory self, int input, uint accuracy, uint[] memory factorialReciprocalsLookupTable) internal pure returns(Number memory) {
require(self.form != Form.CONSTANT, "cannot evaluate a constant form.");
if (self.form == Form.BINARYOP)
return _evaluateBinaryOperation(self, input, accuracy... | 12,559,552 |
./partial_match/1/0xEDb07875051B26b56747e738efB3d7a271d9145e/sources/contracts/interfaces/ISandwichBotProxy.sol | SPDX-License-Identifier: GNU-GPL | interface ISandwichBotProxy {
function proxyCall(bytes32 poolId, address[] memory targets, uint[] memory values, bytes[] memory calldatas) external;
function setResonateHelper(address _resonateHelper) external;
function sandwichSnapshot(
bytes32 poolId,
uint amount,
bool isWith... | 4,232,484 |
/**
*Submitted for verification at Etherscan.io on 2022-02-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.... | Admin function to authorise the contract address/ | function authorise(address toAuth) public onlyOwner {
_authorised[toAuth] = true;
authorisedLog.push(toAuth);
}
| 14,720,803 |
./full_match/80001/0xe1F5C4130c6f4e67E1c216d638133e2FdF95A5c1/sources/contracts/TimeLock.sol | increaseWithdrawTime() | function increaseWithdrawTime(uint _counterID, uint _increaseTime) public {
OwnerInfo storage ownerInfo = ownerInfoMapping[_counterID];
require(
msg.sender == ownerInfo.owner,
"only owner can update deposit amount"
);
ownerInfo.unlockTime += _increaseTime;
}
| 5,668,113 |
./partial_match/3/0x0AAd60Be63Bfa5a4A43C601663edc709C1CFaA2A/sources/MasterChef.sol | Safe DOGS transfer function, just in case if rounding error causes pool to not have enough DogSwap. | function safeDOGSTransfer(address _to, uint256 _amount) internal {
uint256 DOGSBal = DOGS.balanceOf(address(this));
if (_amount > DOGSBal) {
DOGS.transfer(_to, DOGSBal);
DOGS.transfer(_to, _amount);
}
}
| 5,199,122 |
pragma solidity ^0.4.15;
/**
* @title Doneth (Doneth)
* @dev Doneth is a contract that allows shared access to funds
* in the form of Ether and ERC20 tokens. It is especially relevant
* to donation based projects. The admins of the contract determine
* who is a member, and each member gets a number of sha... | Decrement the number of shares for a member | function removeShare(address who, uint256 amount) public onlyAdmin() onlyExisting(who) {
totalShares = totalShares.sub(amount);
members[who].shares = members[who].shares.sub(amount);
RemoveShare(who, amount, members[who].shares);
}
| 2,560,821 |
./partial_match/42/0x724BEa324E906F8438fC8Ae4512987cf6694642D/sources/CyclopsBank.sol | all rewards for all customers deposits including 0 for empty deposits | function rewardsPerDeposits(address cust_wallet) external view returns (uint32[] memory,uint256[] memory) {
require(cust_wallet == msg.sender || msg.sender == owner, "9");
require(customers_deposits[cust_wallet].length >0, "10");
uint256[] memory rewards = new uint256[](customers_de... | 3,363,847 |
./full_match/1/0xE7C2016f5344858f6A1874424d077aDD3ea81fa5/sources/@aragon/govern-core/contracts/pipelines/GovernQueue.sol | release all collateral to submitter | function _executeApproved(ERC3000Data.Container memory _container) internal returns (bytes32 failureMap, bytes[] memory) {
bytes32 containerHash = _container.hash();
queue[containerHash].checkAndSetState(
GovernQueueStateLib.State.Approved,
GovernQueueStateLib.State.Executed
... | 4,907,049 |
pragma solidity 0.4.26;
import "./Oraclize.sol";
/**
* @title Atomic Loans CryptoWatch Oraclize Contract
* @author Atomic Loans
*/
contract CryptoWatch is Oraclize {
/**
* @notice Construct a new CryptoWatch Oraclize Oracle
* @param med_ The address of the Medianizer
* @param medm_ The address o... | Creates request for Oraclize to get the BTC price payment_ The amount of WETH used as payment for Oraclize/ | function getAssetPrice(uint128 payment_) internal returns (bytes32 queryId) {
weth.withdraw(payment_);
require(oraclize_getPrice("URL", gasLimit) <= address(this).balance, "CryptoWatch.getAssetPrice: Ether balance is less than oraclize price");
}
| 7,225,963 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradea... | Approve the current pending root and content hash | function approveRoot(
bytes32 root,
bytes32 contentHash,
uint256 cycle,
uint256 endBlock
) external whenNotPaused {
_onlyRootValidator();
require(root == lastProposedMerkleData.root, "Incorrect root");
require(contentHash == lastProposedMerkleData.content... | 12,921,011 |
./full_match/80001/0x5c6D4D4b00441C1b6dBCF97291cAcb49BC1edb4B/sources/project_/contracts/MBOSpecialCollection.sol | =============== Owner Functions =============== Changes the address of the MBO Genesis NFT contract newGenesisNFTContract The address of the new MBO Genesis NFT contract/ | function changeGenesisNFTContract(address newGenesisNFTContract) public onlyOwner {
MBOGenesisNFTContract = MBO_GENESIS_NFT_CONTRACT(newGenesisNFTContract);
}
| 857,356 |
pragma solidity 0.4.24;
/**
* @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 private _owner;
event OwnershipTransferred(address indexed ... | Adds list of address to whitelist. Not overloaded due to limitations with truffle testing. _beneficiary Address to be added to the whitelist/ | function addToWhitelist(address _beneficiary) public onlyOwner {
whitelist[_beneficiary] = true;
emit AddedBeneficiary(_beneficiary);
}
| 12,543,384 |
./partial_match/4/0x6b0787A77c11458EF87Bd733a63BBC11980d285D/sources/OroNetwork.sol | Emergency Withdraw Admin call/ | function emergencyWithdraw(address account, address token)
public
onlyOwner
returns (bool)
{
uint256 balance = IERC20(token).balanceOf(address(this));
IERC20(token).transfer(account, balance);
}
| 8,638,062 |
/**
*Submitted for verification at Etherscan.io on 2021-06-03
*/
// SPDX-License-Identifier: MIT
// Sources flattened with hardhat v2.0.5 https://hardhat.org
// File @openzeppelin/contracts-upgradeable/token/ERC20/[email protected]
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as def... | ---------------------------------- User Interface -------------------------------------------------------------------- Owner Actions ---------------------------------- | interface IiToken {
function isSupported() external returns (bool);
function isiToken() external returns (bool);
function mint(address recipient, uint256 mintAmount) external;
function redeem(address from, uint256 redeemTokens) external;
function redeemUnderlying(address from, uint256 redeemAmou... | 2,030,153 |
pragma solidity ^0.6.1;
pragma experimental ABIEncoderV2;
import "./IPoTypes.sol";
interface IPurchasing
{
//---------------------------------------------------------
// Events
//---------------------------------------------------------
// Events Header level
event PurchaseOrderCreateRequestLog(ad... | --------------------------------------------------------- Events--------------------------------------------------------- Events Header level Events Item level (matching 1:1 with PoItemStatus) Events Item level (for escrow release)--------------------------------------------------------- Functions----------------------... | {
event PurchaseOrderCreateRequestLog(address indexed buyerAddress, bytes32 indexed sellerId, uint indexed poNumber, IPoTypes.Po po);
event PurchaseOrderCreatedLog(address indexed buyerAddress, bytes32 indexed sellerId, uint indexed poNumber, IPoTypes.Po po);
event PurchaseOrderNotCreatedLog(address indexed... | 6,449,236 |
./full_match/97/0x960f3698eAF064c3D6e1A13F9B1e445D799dd122/sources/project:/contracts/NFT.sol | MINT NFT(ERC721) ACCOUNT BALANCE SHOULD MORE THAN MINT PRICE | function mintNFT(
string memory getURI,
uint price,
bytes32 encryptHashValue
) external {
require(actualSale == true, "Sale Off");
setHash(price);
bool checkHash = getHashValue(encryptHashValue);
require(checkHash == true, "Invalid Transfer Hash");
... | 3,294,768 |
pragma solidity ^0.5.8;
import "./ReentrancyGuard.sol";
import "./SafeMath.sol";
import "./SafeMathUInt128.sol";
import "./SafeCast.sol";
import "./Utils.sol";
import "./Storage.sol";
import "./Config.sol";
import "./Events.sol";
import "./Bytes.sol";
import "./Operations.sol";
import "./UpgradeableMaster.sol";
//... | Checks whether oldest unverified block has expired return bool flag that indicates whether oldest unverified block has expired | function isBlockCommitmentExpired() internal view returns (bool) {
return (totalBlocksCommitted > totalBlocksVerified &&
blocks[totalBlocksVerified + 1].committedAtBlock > 0 &&
block.number >
blocks[totalBlocksVerified + 1].committedAtBlock +
EXPECT_VERIFI... | 5,479,397 |
./partial_match/1/0x6c754f774402Ec4bD3556EEA769e87F22489621E/sources/ClipGrave.sol | Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./ | function renounceOwnership() public virtual onlyOwner {
transferOwnership(address(0));
}
| 2,824,083 |
pragma solidity >=0.4.0 <0.6.0;
//^0.4.18;
// showing the exchange of product between drugcontroller and certifier
//Actually it is DrugDetails now
/*interface Regulator{
function sendescrow(address escrowparticipator, bytes32 escrowparticipatorname, uint escrowparticipatoramount) external;
functio... | / knownEntity[entityAddress];(entityStructs[rowNumber].entityAddress != entityAddress; | function sendescrow(address payable escrowparticipator, bytes32 escrowparticipatorname, uint escrowparticipatoramount) public {
escrowobtainee.escrowobtainees;
escrowobtainee.escrowparticipantcount;
m =escrowobtainee.escrowparticipantcount;
uint obtcounter = m++;
escrowobtainee.escro... | 6,419,753 |
pragma solidity ^0.6.0;
... | inject NONSTANDARD NAMING | function LOG40(uint p0, address p1, string memory p2, address p3) internal view { | 1,019,015 |
./full_match/137/0xD810f8aBA4EB626d13F0BAF2C9f5b0e2AF8e6351/sources/contracts/masterchef.sol | Add a new lp to the pool. Can only be called by the owner. | function add(uint256 _allocPoint, IERC20 _lpToken, uint16 _depositFeeBP) external onlyOwner nonDuplicated(_lpToken) {
require(_depositFeeBP <= 10000, "add: invalid deposit fee basis points");
uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
totalAllocPoint = t... | 4,685,443 |
./full_match/5/0x62dD98AE09954873EF18Cb47E0879D637512D497/sources/contracts/CrowdFunding.sol | now we have to loop through every campaign and populate that variable.This can be useful for manipulating the data in the Campaign object without modifying the original object in the array. | function getCampaigns() view public returns (Campaign[] memory) {
Campaign[] memory allCampaigns = new Campaign[](numberOfCampaigns);
for(uint i = 0; i < numberOfCampaigns; i++) {
Campaign storage item = campaigns[i];
allCampaigns[i] = item;
}
return allCam... | 7,040,739 |
./partial_match/1/0x640f7B78830db57BAfDF6F462d2B458dA80825D3/sources/contracts/protocol/leverage/GeneralLevSwap.sol | _principal - The amount of collateral _leverage - Extra leverage value and must be greater than 0, ex. 300% = 300_00 _principal + _principal _leverage should be used as collateral _borrowAsset - The borrowing asset address when leverage works _flashLoanType - 0 is Aave, 1 is Balancer _swapInfo -... | function enterPositionWithFlashloan(
uint256 _principal,
uint256 _leverage,
address _borrowAsset,
IGeneralLevSwap.FlashLoanType _flashLoanType,
IGeneralLevSwap.SwapInfo calldata _swapInfo
) external nonReentrant {
require(_principal != 0, Errors.LS_SWAP_AMOUNT_NOT_GT_0);
require(_leverag... | 15,492,423 |
./full_match/4/0xb19D68085FF3078e1f9911cc2509c4aFB6d40be1/sources/contracts/RootChainManager.sol | payable(typeToPredicate[tokenToType[ETHER_ADDRESS]]).transfer(msg.value); transfer doesn't work as expected when receiving contract is proxified so using call | function _depositEtherFor(address user) private {
bytes memory depositData = abi.encode(msg.value);
ITokenPredicate(ethPredicateAddress).lockTokens(
_msgSender(),
user,
address(0),
depositData
);
if (!success) {
revert("Roo... | 12,416,595 |
pragma solidity ^0.4.11;
import "zeppelin-solidity/contracts/math/SafeMath.sol";
import "./crowdsale/CappedCrowdsale.sol";
import "./crowdsale/RefundableCrowdsale.sol";
import './Dagt.sol';
//contract DagtCrowdSale is CappedCrowdsale, RefundableCrowdsale {
contract DagtCrowdSale is Dagt,CappedCrowdsale, RefundableCro... | Add a list of address to be whitelisted for the crowdsale only. _users , the list of user Address. Tested for out of gas until 200 addresses./ | function whitelistAddresses( address[] _users) public onlyOwner {
for( uint i = 0 ; i < _users.length ; i++ ) {
whiteListedAddress[_users[i]] = true;
}
}
| 901,442 |
pragma solidity >=0.4.15;
import './Common.sol';
contract ERC20Interface {
function getTotalSupply() public returns (uint totalSupply);
function getTokenBalance(address _owner) public constant returns (uint balance);
function mint(address _addr, uint _amount) public;
function burn(uint _amount) public... | only called from contracts so don't need msg.data.length check Check for overflowsupdating the maxSupply to new reduced value | function mint(address _addr, uint _amount) public {
if (maxSupply > 0 && safeAdd(totalSupply, _amount) > maxSupply)
revert();
require(balanceOf[_addr] + _amount > balanceOf[_addr]);
balanceOf[_addr] = safeAdd(balanceOf[_addr], _amount);
totalSupply = safeAdd(to... | 13,130,071 |
/**
*Submitted for verification at Etherscan.io on 2022-02-09
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
interface IERC20{
function name() ... | Transfer tokens from one address to another. Note that while this function emits an Approval event, this is not required as per the specification, and other compliant implementations may not emit the event. sender address The address which you want to send tokens from recepient address The address which you want to t... | function transferFrom(address sender ,address recepient, uint amount) external override returns(bool){
_approve(sender, _msgsender(), _allowances[sender][_msgsender()].sub(amount,"exceeds allownace"));
_transfer(sender,recepient,amount);
return true;
}
| 10,585,187 |
/**
*Submitted for verification at Etherscan.io on 2021-05-17
*/
// File: contracts/interface/ICoFiXV2DAO.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
interface ICoFiXV2DAO {
function setGovernance(address gov) external;
function start() external;
// function addETHReward... | get Net Asset Value Per Share for burn only for read, could cost more gas if use it directly in contract | function getNAVPerShareForBurn(OraclePrice memory _op) external view returns (uint256 navps) {
return calcNAVPerShare(reserve0, reserve1, _op.ethAmount, _op.erc20Amount);
}
| 10,545,523 |
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum... | Whitelists a bunch of addresses. _whitelistees address[] of addresses to whitelist./ Add all whitelistees. | function addWhitelist(address[] memory _whitelistees) public onlyOwner {
for (uint256 i = 0; i < _whitelistees.length; i++) {
address creator = _whitelistees[i];
if (!isWhitelisted(creator)) {
_whitelist(creator);
}
}
}
| 14,655,351 |
./full_match/1/0xB6BeBe5000B70CAb62137566f108356521E1f05B/sources/PawfectClub.sol | Update the presale mint price/ | function setPresalePrice(uint256 _presalePrice) external onlyOwner {
presalePrice = _presalePrice;
}
| 2,905,478 |
./full_match/11155111/0xbdDB47066f93690e6de26037646ECe6D1F468245/sources/staking/saturn_staking.sol | This function is used to get the total no of tokens that are staked/ | function getTotalStakedTokens() external view returns (uint256) {
return _totalStakedTokens;
}
| 3,834,582 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts@3.2.0/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts@3.2.0/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts@3.2.0/math/SafeMath.sol";
import "@openzeppelin/contracts@3.2.0/access/Ownable.sol";
import "./Meshco... | Return reward multiplier over the given _from to _to block. | function getBlocksReward(uint256 _from, uint256 _to) public view returns (uint256 value) {
uint256 prevReductionBlock = nextReductionBlock.sub(reductionBlockPeriod);
if ((_from >= prevReductionBlock && _to <= nextReductionBlock) ||
(_from > bonusStableBlock))
{
value... | 13,112,096 |
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
import "../utility/ContractRegistryClient.sol";
import "../token/ReserveToken.sol";
import "./interfaces/IConverter.sol";
import "./interfaces/IConverterUpgrader.sol";
import "./interfaces/IConverterFactory.sol";
interface ILegacy... | we're using a static call to identify converter version note that we can't rely on the version number since the function had a different signature in older converters/ | function _isV28OrHigherConverter(IConverter converter) internal view returns (bool) {
bytes memory data = abi.encodeWithSelector(IS_V28_OR_HIGHER_FUNC_SELECTOR);
if (success && returnData.length == 32) {
return abi.decode(returnData, (bool));
}
return false;
}
| 12,938,655 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
// Part: IPriceFeed
interface IPriceFeed {
function initialize(
uint256 maxSafePriceDifference,
address stableSwapOracleAddress,
address curvePoolAddress,
address admin
) external;
}
// Part: OpenZeppelin/openzeppelin-c... | Returns the current admin of the proxy./ | function getProxyAdmin() external view returns (address) {
return _getAdmin();
}
| 89,264 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorSettings.sol)
pragma solidity ^0.8.0;
import "../Governor.sol";
import "../../utils/Timers.sol";
/**
* @dev Extension of {Governor} for settings updatable through governance.
*
* _Available since v4.4._
*/
abstract co... | Internal setter for creator. Emits a {CreatorSet} event./ | function _setCreator(address newCreator) internal virtual {
emit CreatorSet(_creator, newCreator);
_creator = newCreator;
}
| 7,297,544 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/to... | calculates and returns the APY | function getAPY() external view returns(uint) {
return totalStaked == 0 ? 0 : (rewardsPerBlock * dailyBlocks * 365) / (totalStaked + totalPending);
}
| 1,090,127 |
./partial_match/80001/0xEd494b640222d33F22a9156725d2a12a589fa3E0/sources/src/consensys_erc1400/ERC1400.sol | Token migration / Migrate contract. ===> CAUTION: DEFINITIVE ACTION This function shall be called once a new version of the smart contract has been created. Once this function is called: - The address of the new smart contract is set in ERC1820 registry - If the choice is definitive, the current smart contract is tu... | function migrate(address newContractAddress, bool definitive)
external
onlyOwner
{
_migrate(newContractAddress, definitive);
}
| 8,796,180 |
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721Burnable.sol';
import '@openzeppelin/contra... | Internal function for saving token URIs _tokenUri token URI string _tokenId uint256 id of the token./ | function _saveUniqueTokenURI(string memory _tokenUri, uint256 _tokenId) private {
require(tokenUris[_tokenUri] == 0, 'Duplicate token URIs not allowed');
tokenUris[_tokenUri] = _tokenId;
}
| 6,019,257 |
// SPDX-License-Identifier: MIT
/**
* █▄ █ █▀ ▀█▀ ▄▀▀ ▄▀▄ █ █ ██▀ ▄▀▀ ▀█▀ █ ▄▀▄ █▄ █ ▄▀▀
* █ ▀█ █▀ █ ▀▄▄ ▀▄▀ █▄▄ █▄▄ █▄▄ ▀▄▄ █ █ ▀▄▀ █ ▀█ ▄██
*
* Made with 🧡 by Kreation.tech
*/
pragma solidity ^0.8.6;
import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradea... | Get URI for given token id tokenId token id to get uri for return base64-encoded json metadata object/ | function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "Token doesn't exist");
return string(abi.encodePacked(baseUrl, "/", tokenId, ".json"));
}
| 12,643,566 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;
import "../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contra... | Governance function to sweep any stuck / airdrop tokens to a given recipient token The address of the token to sweep amount The amount of tokens to sweep recipient The address to send the sweeped tokens to require(!_protected[token], "Strategy: Cannot sweep"); | function sweep(
address token,
uint256 amount,
address recipient
) external onlyGovernance {
TransferHelper.safeTokenTransfer(recipient, token, amount);
emit Sweep(token, amount, recipient);
}
| 273,963 |
./full_match/1/0x2a132928479a25F1d94387b12CA2A043558C3C89/sources/browser/tnifarming.sol | Update reward variables of the given pool to be up-to-date. _pid ID of a specific LP token pool. See index of PoolInfo[]./ | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;... | 3,121,627 |
pragma solidity 0.4.26;
import './Owned.sol';
import './interfaces/IAddressList.sol';
/**
* @dev Non standard token registry
*
* manages tokens who don't return true/false on transfer/transferFrom/approve but revert on failure instead
*/
contract NonStandardTokenRegistry is IAddressList, Owned {
... | registers/unregisters a new non standard ERC20 token in the registry token token address register true to register the token, false to remove it/ | function setAddress(address token, bool register) public ownerOnly {
listedAddresses[token] = register;
}
| 6,454,618 |
./partial_match/1/0xd57d5d1dd984C6d6Fe074C070A7EFf9a69fd3667/sources/contracts/Phase4_Playground-0.sol | allows token owners to decide if they want goodies in their image check if token exists ensure that msg.sender is token owner update goodies | function toggleTokenGoodies(uint256 _tokenId) public
{
if(!_exists(_tokenId)) revert ThisTokenIsLostInSpace();
if(msg.sender != ownerOf(_tokenId)) revert WhoaFriendCantUpdateGoodiesForTokensYouDontOwn();
TokenToGoodiesMap[_tokenId] = !TokenToGoodiesMap[_tokenId];
}
| 2,820,278 |
pragma solidity ^0.5.2;
import "./lib/Ownable.sol";
import "./lib/SafeMath.sol";
import "./IERC20Seed.sol";
import "./IAdminTools.sol";
import "./IATDeployer.sol";
import "./ITDeployer.sol";
import "./IFPDeployer.sol";
contract Factory is Ownable {
using SafeMath for uint256;
address[] public ... | get the i-th element in every array/ | function getContractsByIndex(uint256 _index) external view returns (address, address, address, address) {
return(deployerList[_index], ATContractsList[_index], TContractsList[_index], FPContractsList[_index]);
}
| 1,070,869 |
./full_match/5/0xbC249A1D91DbD54CEEfBBdC66e01FC515FA3980c/sources/src/contracts/facilitators/aave/tokens/GhoAToken.sol | @inheritdoc IInitializableAToken | function initialize(
IPool initializingPool,
address treasury,
address underlyingAsset,
IAaveIncentivesController incentivesController,
uint8 aTokenDecimals,
string calldata aTokenName,
string calldata aTokenSymbol,
bytes calldata params
) external override initializer {
require(... | 7,037,060 |
./partial_match/1/0x1c73E16b68933Ae54664B04559C030E5136F823e/sources/Ruletka.sol | Assigns a new address to act as the CTO. _newCTO The address of the new CTO | function setCTO(address payable _newCTO) public onlyCTO {
require(_newCTO != address(0));
CTO = _newCTO;
}
| 9,310,416 |
./full_match/1/0xD889E4B5301c860A27831e2eDE451A70e54BcED5/sources/contracts/EyeconsRebasePoolV1.sol | @inheritdoc IEyeconsRebasePoolV1 | function numberOfDepositedTokensByAccount(address account_) external view returns (uint256) {
return _depositedTokenIdsByAccount[account_].length();
}
| 5,006,795 |
// Sources flattened with hardhat v2.1.1 https://hardhat.org
// File contracts/Dependencies/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
/**
* Based on the OpenZeppelin IER20 interface:
* https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
*
... | --- Events --- --- Functions --- | interface ILQTYToken is IERC20, IERC2612 {
event CommunityIssuanceAddressSet(address _communityIssuanceAddress);
event LockupContractFactoryAddressSet(address _lockupContractFactoryAddress);
function getDeploymentStartTime() external view returns (uint256);
function getLpRewardsEntitlem... | 1,478,199 |
./partial_match/1/0xD3111A14E8df0Df749CF881AE414037D732D8d28/sources/ComboOracle_KyberSwapElasticV2.sol | Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./ | interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
pragma solidity >=0.8.0;
}
| 2,731,251 |
pragma solidity ^0.4.18;
contract Lotto {
address public owner = msg.sender;
address[] internal playerPool;
uint seed = 0;
uint amount = 0.1 ether;
// events
event Payout(address from, address to, uint quantity);
event BoughtIn(address from);
event Rejected();
modifier onlyBy(address _account) {
... | fallback function acts the same as buyIn(), omitting the return of course. | function () public payable {
require(msg.value * 10 == 0.1 ether);
playerPool.push(msg.sender);
BoughtIn(msg.sender);
if (playerPool.length >= 11) {
selectWinner();
}
}
| 10,602,319 |
// SPDX-License-Identifier: MIT
// https://kanon.art - K21
// https://daemonica.io
//
//
// [email protected]@@@@@@@@@@$$$
// [email protected]@@@@@$$$$$$$$$$$$$$##
// $$$$$$$$$$$$$$$$$#########***
// $$$$$... | Compares two strings _a First string to compare _b Second string to compare return True if equal, false if not/ | function compareStrings(string memory _a, string memory _b) public pure returns (bool) {
return (keccak256(abi.encodePacked((_a))) == keccak256(abi.encodePacked((_b))));
}
| 15,366,490 |
./partial_match/97/0xbc877c0f73520f80fFAEc815C6edeD1BB28b4eba/sources/RubinToken.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "RUBIN::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return... | 11,356,692 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Sets contract operations on/off When operational mode is disabled, all write transactions except for this one will fail/ | function setOperatingStatus(bool mode) public requireContractOwner {
operational = mode;
}
| 7,241,055 |
pragma solidity ^0.4.24;
import './SafeMath.sol';
/** @title CryptoFundFactory dApp */
contract CryptoFundFactory { // Declaration of Crypto Fund Factory Contract
constructor() public {
factoryOwner = msg.sender; // Sets the de... | FRONT END CALLS FACTORY: send seed funds to new FoundAccount Creates a new BountyItem to which users can submit HunterSubmission solutions. _title Title of a new BountyItem. return boolean Returns true if function is executes successfully./ | function updateFundOwner() public returns (bool) {
}
| 12,941,142 |
// SPDX-License-Identifier: BSD-2-Clause
// CompoundModule.sol
// Copyright (c) 2021 Giry SAS. All rights reserved.
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the a... | Computes maximal maximal redeem capacity (R) and max borrow capacity (B|R) after R has been redeemed returns (R, B|R) NB balance below is underestimated unless accrue interest was triggered earlier in the transaction balanceOfUnderlying(A) : cA.balance exchange_rate(cA,A) | function maxGettableUnderlying(address _ctoken, address account)
public
view
returns (uint, uint)
{
IcERC20 ctoken = IcERC20(_ctoken);
Heap memory heap;
(heap.errCode, heap.ctokenBalance, , heap.exchangeRateMantissa) = ctoken
(heap.mErr, heap.balanceOfUnderlying) = mulScalarTruncate(
... | 5,461,646 |
pragma solidity ^0.4.24;
// File: node_modules/openzeppelin-solidity/contracts/introspection/IERC165.sol
/**
* @title IERC165
* @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
*/
interface IERC165 {
/**
* @notice Query if a contract implements an interface
* @param interfaceId The interf... | Internal function to mint a new token Reverts if the given token ID already exists to address the beneficiary that will own the minted token tokenId uint256 ID of the token to be minted by the msg.sender/ | function _mint(address to, uint256 tokenId) internal {
super._mint(to, tokenId);
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
| 538,546 |
./partial_match/1/0x07b10bdC1Eb8Bb885ee6Ca0458E1c276A063C8bB/sources/FirstHatcher.sol | True = Public mint is live, False = WL mint is live | function setPublicMintBool(bool _state) public onlyOwner {
publicMint = _state;
}
| 4,273,408 |
pragma solidity >=0.4.22 <0.6.0;
import "../installed_contracts/zeppelin/contracts/math/SafeMath.sol";
contract BikeSharing {
using SafeMath for uint256;
uint256 constant public MAX_BIKE_COUNT = 1000;
uint256 constant public BIKE_VALUE = 1 ether;
uint256 constant public TIME_LIMIT = 1440; // in minu... | Check the fee amount for a certain duration (in minutes) for renting the bike duration length return Fee due | function calculateFee(uint256 duration)
public
view
returns (uint256)
{
uint256 num_minutes = duration.div(MINUTE_FACTOR);
if(num_minutes > TIME_LIMIT){
return requiredDeposit;
}
uint256 toPay = num_minutes.mul(fee);
retur... | 12,824,930 |
pragma solidity ^0.4.16;
import "./OriginalCoin.sol";
import "./storage.sol";
contract Origin {
uint public amount;
uint public stake;
address public issuer;
address public fraudClaimer;
bytes32 public long;
bytes32 public lat;
bytes32 public method;
uint public timestamp;
bool public fraud;
uint ... | TODO use constructor function instead | function () payable {
stake += msg.value;
}
| 14,057,623 |
./full_match/43114/0x2dCC8408890710AA69BC0c50cf98b92B1d3eb184/sources/project_/contracts/MasterChefV2.sol | Update the given pool's Token allocation point and deposit fee. Can only be called by the owner. | function set(uint256 _pid, uint256 _allocPoint, uint16 _withdrawFeeBP, bool _withUpdate) external onlyOwner {
require(_withdrawFeeBP <= 400, "add: invalid withdrawal fee basis points");
if (_withUpdate) {
massUpdatePools();
}
totalAllocPoint = totalAllocPoint.sub(poolInfo... | 4,502,166 |
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
import "../openzeppelin/ERC20.sol";
import "../openzeppelin/SafeERC20.sol";
import "../openzeppelin/SafeMath.sol";
import "./LiquidityMiningStorageV1.sol";
import "./ILiquidityMiningV1.sol";
contract LiquidityMiningV1 is ILiquidityMiningV1, LiquidityMiningStor... | update user accumulated rewardadd reward for the previous amount of deposited tokens | function _updateReward(PoolInfo storage pool, UserInfo storage user) internal {
if (user.amount > 0) {
uint256 accumulatedReward = user.amount.mul(pool.accumulatedRewardPerShare).div(PRECISION).sub(user.rewardDebt);
user.accumulatedReward = user.accumulatedReward.add(accumulatedReward);
}
}
| 6,361,939 |
./full_match/1/0x519AE2616E0D87dBC05c2C00757894F883cDD5d6/sources/browser/BalavaDefiPool.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "BANHMI::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
retur... | 5,010,801 |
pragma solidity ^0.4.23;
import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol";
contract StarNotary is ERC721 {
struct Star {
string name;
string story;
string ra;
string dec;
string mag;
}
mapping(string => uint256) starToToken;
mapping(uint2... | string memory starId = keccak256(abi.encodePacked(_ra, _dec, _mag)); | function createStar(string _name, string _story, string _ra, string _dec, string _mag, uint256 _tokenId) public {
string memory starId = strConcat(_ra, _dec, _mag);
require(starToToken[starId] == 0, "Star needs to be unregistered");
Star memory newStar = Star(_name, _story, _ra, _... | 1,805,238 |
pragma solidity ^0.4.18; // solhint-disable-line
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete)
contract ERC721 {
// Required methods
function approve(address _to, uint256 _tokenId) public;
function balanceOf... | @Artyom Required for ERC-721 compliance.@Artyom only gen1 | function totalSupply() public view returns (uint256 total) {
return PersonsGen1.length;
}
| 12,049,406 |
./full_match/43114/0x21C971D78E1A398710d964Ed1AC4C80E5940ed25/sources/contracts/strategies/SimpleHoldingStrategy.sol | Stability fee if any | function stabilityFeePer10k(address token)
public
view
override
returns (uint256)
{
return _stabilityFeePer10k[token];
}
| 4,620,914 |
// SPDX-License-Identifier: MIT
// Created by Flux Team
pragma solidity ^0.6.8;
import "./Market.sol";
import "./IMarket.sol";
import "./Interface.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @title MarketERC777 是 Flux 协议中用于封装 ERC20 的标的资产合约借贷市场
* @author Flux
*/
contract MarketERC20 is Mar... | skip transfer to myself | function underlyingTransferOut(address receipt, uint256 amount) internal virtual override returns (uint256) {
if (receipt == address(this)) {
return amount;
}
underlying.safeTransfer(receipt, amount);
return amount;
}
| 2,521,142 |
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual re... | Create an instance of the oracle and get the price. If the price is not resolved revert. For now we don't want to deal with negative prices in positions. | function _getOraclePrice(uint256 requestedTime) internal view returns (FixedPoint.Unsigned memory) {
OracleInterface oracle = _getOracle();
require(oracle.hasPrice(priceIdentifier, requestedTime), "Unresolved oracle price");
int256 oraclePrice = oracle.getPrice(priceIdentifier, requested... | 7,360,558 |
pragma solidity ^0.5.10;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because the... | solium-disable-next-line / | function decode(uint256 _entry) internal pure returns (address _addr, uint256 _value) {
assembly {
let entry := not(_entry)
_addr := and(entry, 0xffffffffffffffffffffffffffffffffffffffff)
_value := shr(160, entry)
}
}
| 881,550 |
./full_match/1/0xFf856fEc08C45e02941c66cf73dC269F90878e76/sources/contracts/PunkMe.sol | Allows to mint NFTs/ | function mint() external payable {
}
| 9,619,428 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./MockZHegic.sol";
... | Reset the start block to the current block. Added this function so I can reuse the same contract instances for multiple tests. Same goes for `setRateIncrease`./ | function resetStartBlock() external onlyOwner {
start = block.number;
}
| 13,092,926 |
./full_match/1/0xCd000DF47446cfd7D660aDEb4021B710AA41DeD9/sources/src/GreyMarket.sol | Claim multiple orders. Claim multiple orders. ids Order ids buyers The addresses of the buyers sellers The addresses of the sellers sigs Array of ECDSA signatures/ | function claimOrders(
bytes32[] calldata ids,
address[] calldata buyers,
address[] calldata sellers,
Sig[] calldata sigs
) external {
require(sigs.length == ids.length, "invalid length");
require(sellers.length == buyers.length, "invalid length");
uint256... | 16,609,966 |
pragma solidity ^0.4.24;
import "./Plugin.sol";
import "./interfaces/ENSInterface.sol";
import "./interfaces/PliTokenInterface.sol";
import "./interfaces/PluginRequestInterface.sol";
import "./interfaces/PointerInterface.sol";
import { ENSResolver as ENSResolver_Plugin } from "./vendor/ENSResolver.sol";
/**
* @title... | Sets the PLI token address _pli The address of the PLI token contract/ | function setPluginToken(address _pli) internal {
pli = PliTokenInterface(_pli);
}
| 1,802,456 |
pragma solidity ^0.5.0;
// Ownable.sol
import "installed_contracts/zeppelin/contracts/ownership/Ownable.sol";
/* Contact used for football competitions */
contract FootballCompetition is Ownable {
/* football competition */
/* for the purposes of the problem only 255 competitions can be added to this contrac... | teams to be added in a competition must be entered one by one / this is because of the problems of evm and unbounded loops / only accessible by organizer / check if team exists check if team is already in competition (cannot override teams!) add team to competition increment total number of teams in competition and add... | function addTeamToCompetition(
)
public
{
require(footballTeams[teamId].nameSet == true, "Team does not exist");
require(competitions[competitionId].teams[teamId] == false, "Team already in competition.");
competitions[competitionId].teams[teamId] = true;
compe... | 12,761,776 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../SocialTokenNFT/ERC721.sol";
import "../SocialTokenNFT/SizeSortedList.sol";
import "../SocialTokenNFT/ISocialTokenNFT.sol";
import "../... | This version of forge creates base level NFTs using tokens that must be held in the caller's wallet. | function forge(uint256 numberOfElements) public {
require(elementSize > 0, NOT_ENABLED);
manager.getTokenContract().award(_msgSender(), elementMintCost * int256(numberOfElements), FORGE_COST);
NFTData memory template = NFTData (0, 0, elementIndex);
while(numberOfElements > 0) {
... | 2,536,293 |
// SPDX-License-Identifier: BlueOak-1.0.0
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "contracts/interfaces/IAsset.sol";
import "contracts/interfaces/IAssetRegistry.sol";
import "contracts/interfaces/IFacade.sol";
import "contracts/interfaces/IRToken.sol";
import "contracts/i... | return tokens The addresses of the ERC20s backing the RToken | function basketTokens(IRToken rToken) external view returns (address[] memory tokens) {
IMain main = rToken.main();
(tokens, ) = main.basketHandler().quote(FIX_ONE, CEIL);
}
| 12,549,299 |
pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns... | Allows users to claim CLUSTER every 1000 SEGMENTS (1.000.000 blocks). return The amount of CLUSTER claimed by sender./ | function claimClusters() public returns (uint amount) {
if (currentSegment() == 0) throw;
if (!backers[msg.sender].state) throw;
uint previousWithdraws = backers[msg.sender].withdrawnAtCluster;
uint entitledToClusters = currentCluster().sub(previousWithdraws);
... | 1,792,613 |
/**
*Submitted for verification at Etherscan.io on 2018-01-22
*/
pragma solidity ^0.6.6;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract StandardBounties {
/*
* Events
*/
event BountyIssued(uint256 bountyId);
event BountyActivated(uint256 bountyId, address issuer);
even... | transferIssuer(): allows the issuer to transfer ownership of the bounty to some new address _bountyId the index of the bounty _newIssuer the address of the new issuer | function transferIssuer(uint256 _bountyId, address payable _newIssuer)
public
validateBountyArrayIndex(_bountyId)
onlyIssuer(_bountyId)
{
bounties[_bountyId].issuer = _newIssuer;
emit IssuerTransferred(_bountyId, _newIssuer);
}
| 13,106,863 |
./full_match/4/0xbc3155a83686b5063d57EBa58E31d94fB0EaF124/sources/browser/hook.sol | pay referral 10% pay equal from 40% to 6 parent | function payIndex1(uint256 _baseUserId,uint256 _planIndex, uint256 _referrerId,uint256 _paidAmount, uint[11] memory prcnt) internal returns(bool)
{
uint256 _networkId = networkId;
boosterGain[_referrerId][_planIndex] += _paidAmount * prcnt[0] / 100000000;
uint256 pId = _baseUserId;
... | 656,282 |
./partial_match/80001/0x0A196A892CE4d1B47d97ED27aeD03e2388903758/sources/MarbleBank.sol | Add the specified user to the list of bank's affiliates Adds new affiliate. If the address already is affiliate, the transaction reverts. Can be executed only by the owner of this contract. At the end, emits AffiliateAdded event newAffiliate Address if the user | function addAffiliate(address newAffiliate)
override
external
onlyOwner
{
require(!affiliates[newAffiliate], REVERT_USER_IS_AFFILIATE);
affiliates[newAffiliate] = true;
emit AffiliateAdded(newAffiliate);
}
| 8,798,962 |
./partial_match/1/0x14cC8DfaF2258E1B8B2869300dBa1B734dc0fE43/sources/KtuneTokenBlocks.sol | Withdraws the beneficiary's funds./ | function beneficiaryWithdraw() public {
require(_state == State.Closed);
_beneficiary.transfer(address(this).balance);
}
| 2,737,100 |
/**
*Submitted for verification at Etherscan.io on 2020-03-28
*/
// 111111111111111111111111111111111111111111111111111111111111111111
// 111111111111111111111111111111111111111111111111111111111111111111
// 1111111111111111111111111111111111111111111111111111111111111111
// 111111111111111111111111111111111111111111... | Casino must sign the resulting value V with its PrivKey, thus producing the digital signature S = sign(PrivKey, V), and send the corresponding TX, containing S.The contract recovers the actual public key (K) from the digital signature S, and verifies that it is equal to the previously published PubKey (K == PubKey).If ... | function confirm(bytes32 seed, uint8 _v, bytes32 _r, bytes32 _s) public onlyCroupier {
require (ecrecover(seed, _v, _r, _s) == CROUPIER_BOB);
Game storage game = listGames[seed];
bytes memory choice = game.choice;
game.result = uint256(_s) % 12;
uint profit = 0;
uint8... | 12,980,995 |
pragma solidity ^0.4.23;
/* all this file is based on code from open zepplin
* https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/token */
/**
* Standard ERC20 token
*
* Based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
... | Check is not needed because sub(_allowance, _value) will already revert if this condition is not met | function transferFrom(address _from, address _to, uint _value) public returns (bool) {
uint _allowance = allowed[_from][msg.sender];
if (_value > _allowance) revert();
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][... | 12,854,133 |
./full_match/4/0x75716Ca83c93c9b6fBbf2481bCF2aF72A225098E/sources/contracts/AnniversaryAchievement.sol | Change campaignId Only callable by owner. _campaignId: campaign id/ | function changeCampaignId(uint256 _campaignId) external onlyOwner {
campaignId = _campaignId;
emit NewCampaignId(_campaignId);
}
| 647,258 |
/**
*Submitted for verification at Etherscan.io on 2022-04-28
*/
pragma solidity ^0.8.9;
// SPDX-License-Identifier: NONE
//
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns... | EXTERNAL METHOD FOR USER'S TO COLLECT REWARDS | function collectReward(uint256 _pid) external nonReentrant {
payReward(_pid, msg.sender);
}
| 7,938,610 |
pragma solidity = 0.5.16;
import "./IKyber.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";
contract KyberAdapter {
using SafeMath for uint256;
IKyber public kyber;
ERC20... | payment is made with DAI Prepare for handling back the change if there is any. Since we are going to transfer the source amount to Kyber. Handle back the change, if there is any, to the message sender. | function _swapTokenAndHandleChange(
ERC20 _src,
uint256 _maxSrcAmount,
ERC20 _dest,
uint256 _maxDestAmount,
uint256 _minConversionRate,
address payable _initiator,
address payable _receiver
)
internal
returns (
uint256 _srcAmount,
u... | 7,233,121 |
./full_match/43113/0x78Dd414DF1fC487B5123314a17685D1dF34ff670/sources/project_/contracts/Fold.sol | mint the $Fold to the TWENTY contract upon NFT creation _amount amount to mint/ | function mintStakingShare(uint _amount) external onlyOwner {
uint256 realAmount = _amount*FOLD_TOKEN_PRECISION;
if(realAmount + totalSupply() > MAX_SUPPLY){
revert("Tokens all allocated");
}
_mint(address(foldStaking), realAmount);
}
| 7,113,677 |
pragma solidity ^0.4.17;
// File: contracts/iERC20Token.sol
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ConsenSys/Tokens
// https://github.com/ethereum/EIPs/issues/20
pragma solidity ^0.4.17;
/// @title iERC20Token contract
contract iERC20Token {
// FIELDS
... | this.batchTransfer(_to, _ids, _values); solium-disable-next-line arg-overflow | function safeBatchTransfer(address _to, uint256[] _ids, uint256[] _values, bytes _data) external {
for (uint256 i = 0; i < _ids.length; ++i) {
require(_checkAndCallSafeTransfer(msg.sender, _to, _ids[i], _values[i], _data));
}
uint256 _id;
uint256 _value;
for (i... | 5,475,775 |
./partial_match/3/0x3bF4788621B18eCE94B9C2F916b39FDB6d1dF8aa/sources/MineDAPP.sol | change baseMiningRate | function x_adminChangeBaseRate(uint256 _amount) external onlyOwner returns(bool) {
baseMiningRate = _amount;
return true;
}
| 5,272,054 |
./full_match/80001/0x8B89359a48C153994d2A6BF878b148f151d2A0c4/sources/contracts/market/MarketMatching.sol | Cancel an offer. Refunds offer maker. | function cancel(uint256 id) public can_cancel(id) returns (bool success) {
require(!_locked, _S102);
require(_unsort(id), _T110);
}
| 9,473,640 |
pragma solidity ^0.4.13;
/**
* @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 pre... | Положить депозит в хранилище/ | function deposit(address investor) public payable onlyOwner inState(State.Active) {
deposited[investor] = deposited[investor].add(msg.value);
}
| 13,009,173 |
/*
* Origin Protocol
* https://originprotocol.com
*
* Released under the MIT license
* https://github.com/OriginProtocol/origin-dollar
*
* Copyright 2020 Origin Protocol, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files ... | Deposit an amount of asset into the platform _asset Address for the asset _amount Units of asset to deposit/ Deposit balance of all supported assets into the platform/ Withdraw an amount of asset from the platform. _recipient Address to which the asset should be sent _asset ... | interface IAaveStakedToken {
function COOLDOWN_SECONDS() external returns (uint256);
function UNSTAKE_WINDOW() external returns (uint256);
function balanceOf(address addr) external returns (uint256);
function redeem(address to, uint256 amount) external;
function stakersCooldowns(address addr) ex... | 11,949,698 |
pragma solidity 0.4.25;
// File: contracts/sogur/interfaces/IModelDataSource.sol
/**
* @title Model Data Source Interface.
*/
interface IModelDataSource {
/**
* @dev Get interval parameters.
* @param _rowNum Interval row index.
* @param _colNum Interval column index.
* @return Interval minim... | Return the contract which implements the IMintingPointTimersManager interface./ | function getMintingPointTimersManager() public view returns (IMintingPointTimersManager) {
return IMintingPointTimersManager(getContractAddress(_IMintingPointTimersManager_));
}
| 2,074,775 |
./partial_match/1/0x67391801E7564994bdAa80544Ff916A7bCBFCB60/sources/MacroverseUniversalRegistry.sol | Calculate atan(x) for x in [-1, 1]. Uses the Chebyshev polynomial approach presented at Uses polynomials received by personal communication. 0.999974x-0.332568x^3+0.193235x^5-0.115729x^7+0.0519505x^9-0.0114658x^11/ | function atanSmall(int128 real_arg) public pure returns (int128) {
int128 real_arg_squared = mul(real_arg, real_arg);
return mul(mul(mul(mul(mul(mul(
}
| 9,236,747 |
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./ERC2981.sol";
import "./RoyaltiesAdd... | sets royalties address for royalties addon for 2981 | function setRoyaltiesAddress(address _royaltiesAddress)
public
onlyRole(DEFAULT_ADMIN_ROLE)
{
super._setRoyaltiesAddress(_royaltiesAddress);
}
| 6,486,216 |
./partial_match/1/0x7Cc46CF6392ed9DB45351A3F82EB2Cc3b83Da761/sources/contracts/DeepSeaCreatures.sol | burn by tokenIdtransfer back 0.5 BAIT to user for burning | function burn(uint256 tokenId) external {
require(isBurnable, "burning is not enabled");
_burn(tokenId, true);
baitToken.transfer(msg.sender, 0.5e18);
}
| 3,572,218 |
./full_match/1/0x7a91BC4C9308844446792B51b99F5d111178D42d/sources/contracts/Minter.sol | Add _token into the list, add _cToken in mapping and approve cToken to spend token/ | function _addToken(
address _token,
address _cToken,
address _oracle
) internal {
require(_whitelistedTokens.add(_token), "add-in-list-failed");
oracles[_token] = _oracle;
cTokens[_token] = _cToken;
IERC20(_token).safeApprove(_cToken, type(uint256).max);
... | 9,622,303 |
// to test issue with nodes breaking with large clients over WS
// fixed in web3 with fragmentationThreshold: 8192
pragma solidity ^0.4.17;
contract BigFreakingContract {
event Transfer(address indexed from, address indexed to, uint value);
event Approval( address indexed owner, address indexed spender, uint valu... | TODO: should increase instead | function approve_243(address spender, uint value) public returns (bool ok) {
_approvals[msg.sender][spender] = value;
emit Approval( msg.sender, spender, value );
return true;
}
| 6,453,956 |
/**
*Submitted for verification at Etherscan.io on 2022-03-31
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal repre... | Base URI for computing {tokenURI}. If set, the resulting URI for each token will be the concatenation of the `baseURI` and the `tokenId`. Empty by default, can be overriden in child contracts./ | function _baseURI() internal pure virtual returns (string memory) {
}
| 7,880,307 |
./partial_match/1/0xD3faD4C5e4D24646F90A0c8876314b17243E9460/sources/contracts/KounPass.sol | Mint a quantity of tokens to the contract owners address Use restricted to contract owner _quantity Number of tokens to mint Must be executed in `MintPhase.INACTIVE` (i.e., before allowlist or public mint begins)/ | function ownerMint(uint256 _quantity) external onlyOwner inMintPhase(MintPhase.INACTIVE) {
require(totalSupply() + _quantity <= collectionSize, "insufficient supply");
_safeMint(owner(), _quantity);
}
| 2,677,021 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.