file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
//Address: 0x1d979bd0b663040f2fe8a9854a8569919ae153ac
//Contract name: slot
//Balance: 0.002436476745367404 Ether
//Verification Date: 2/2/2017
//Transacion Count: 4888
// CODE STARTS HERE
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
Permission is hereby granted, free ... | sets the amount of gas to be sent to oraclize / | function setOraclizeQuery(string newQuery){
if(!(msg.sender==owner)) throw;
query = newQuery;
}
| 934,561 |
//Address: 0x5890301587c4f9099d5ed4041cfc4bff332357a9
//Contract name: ICOContract
//Balance: 0 Ether
//Verification Date: 2/13/2018
//Transacion Count: 8
// CODE STARTS HERE
pragma solidity ^0.4.16;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
... | Returns number of the current milestone. Starts from 1. 0 indicates that project implementation has not started yet. | function getCurrentMilestone() public constant returns(uint) {
for(uint i=0; i < milestones.length; i++) {
if (milestones[i].startTime <= now && now <= milestones[i].finishTime + waitPeriod) {
return i+1;
}
}
return 0;
}
| 14,122,537 |
./full_match/80001/0x8449112689993137428Fa1E24b7917982C1011BD/sources/_opengsn/contracts/src/forwarder/Forwarder.sol | @inheritdoc IForwarder | function verify(
ForwardRequest calldata req,
bytes32 domainSeparator,
bytes32 requestTypeHash,
bytes calldata suffixData,
bytes calldata sig)
external override view {
_verifyNonce(req);
_verifySig(req, domainSeparator, requestTypeHash, suffixData, sig);
... | 5,563,320 |
// File: contracts/RTokenStructs.sol
pragma solidity ^0.5.8;
contract RTokenStructs {
/**
* @notice Global stats
*/
struct GlobalStats {
/// @notice Total redeemable tokens supply
uint256 totalSupply;
/// @notice Total saving assets in redeemable amount
uint256 totalS... | Optimized recollect and distribute loan for the same hat src Source address dst Destination address rAmount rToken amount being written of from the recipients/ accrue interest so estimate is up to date | function sameHatTransfer(
address src,
address dst,
uint256 rAmount) internal {
ias.accrueInterest();
Account storage srcAccount = accounts[src];
Account storage dstAccount = accounts[dst];
uint256 sInternalAmount = rAmount
.mul(savingAssetConver... | 1,045,550 |
// The tokens of this contract are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (https://creativecommons.org/licenses/by-nc-sa/4.0/)
// SPDX-License-Identifier: CC-BY-NC-SA-4.0
pragma solidity ^0.8.0;
import "./LadybugFinances.sol";
/**
* @author WrightCode
* @t... | Count the remaning, unminted ladybugs./ | function unminted() external view returns (uint) {
return uint(_MAX_LADYBUGS) - _currentSupplyIndex();
}
| 10,276,020 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.0;
import "./Ownable.sol";
contract Voting is Ownable {
struct Voter {
bool isRegistered;
bool hasVoted;
uint proposalsCount;
uint votedProposalId;
}
struct Proposal {
string description;
u... | Registered voters are allowed to register their proposals while the registration session is active. _description Content of the proposal. ER3 : You're not allowed to vote. ER4 : Registration has not yet started or is already ended. ER5 : The number of proposals per voter is limited to 100./ | function proposalsRegistration(string memory _description) external {
require(voters[msg.sender].isRegistered, "ER3");
require(voteStatus == WorkflowStatus.ProposalsRegistrationStarted, "ER4");
require(voters[msg.sender].proposalsCount <= 99, "ER5");
voters[msg.sender].proposalsCount... | 2,518,680 |
./partial_match/97/0xDAe4D03C575BBa7440d381D2666580AC777329EC/sources/MasterChef.sol | Withdraw without caring about rewards. EMERGENCY ONLY. | function emergencyWithdraw(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
user.amount = 0;
user.rewardDebt = 0;
pool.lpToken.safeTransfer(address(msg.sender), user.amount);
emit EmergencyWithdraw(msg.... | 11,476,483 |
./full_match/4/0x75716Ca83c93c9b6fBbf2481bCF2aF72A225098E/sources/contracts/AnniversaryAchievement.sol | Check a team's profile/ | function getTeamProfile(uint256 _teamId)
external
view
returns (
string memory,
string memory,
uint256,
uint256,
bool
)
{
require((_teamId <= numberTeams) && (_teamId > 0), "teamId invalid");
return (
... | 647,253 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* q... | See {IERC721Enumerable-tokenOfOwnerByIndex}./ | function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
virtual
override
returns (uint256)
{
require(
index < ERC721.balanceOf(owner),
"ERC721Enumerable: owner index out of bounds"
);
return _ownedTokens[owner... | 14,850 |
//*********************************************************************//
//*********************************************************************//
//
//
// 8888888b. d8888 888b d888 8888888b. 8888888b.
// 888 Y88b d88888 88... | Mints a token to an address with a tokenURI. fee may or may not be required _to address of the future owner of the token/ | function mintTo(address _to) public payable {
require(_getNextTokenId() <= SUPPLYCAP, "Cannot mint over supply cap of 10000");
require(mintingOpen == true && onlyAllowlistMode == false, "Public minting is not open right now!");
require(msg.value =... | 14,429,695 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppelin/contracts/utils/Context.sol";
interface ERC721Collect... | Buy NFT for ETH _count - count/ | function buyNFT(uint256 _count) public payable {
require(_count >= 1, "Count must more or equal 1");
require(_count <= 25, "Count must more or equal 25");
uint256 balance = msg.value;
require(balance == price*_count, "Not enough sent");
require(nftCollection.totalSupply()+_c... | 412,365 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
pragma experimental ABIEncoderV2;
import "./Owned.sol";
import "./BytesUtils.sol";
import "./RRUtils.sol";
import "./DNSSEC.sol";
import "./algorithms/Algorithm.sol";
import "./digests/Digest.sol";
import "./nsec3digests/NSEC3Digest.sol";
import "../Buffer.sol";... | Deletes an RR from the oracle using an NSEC3 proof. Deleting a record using NSEC3 requires using up to two NSEC3 records. There are two cases: 1. The name exists, but the record type doesn't. Eg, example.com has A records but no TXT records. 2. The name does not exist, but a parent name does. In t... | function deleteRRSetNSEC3(uint16 deleteType, bytes memory deleteName, RRSetWithSignature memory closestEncloser, RRSetWithSignature memory nextClosest, bytes memory dnskey)
public override
{
uint32 originalInception = rrsets[keccak256(deleteName)][deleteType].inception;
RRUtils.SignedSe... | 925,381 |
./partial_match/1/0xd36f278Ab63e615962E2f96ad2899eD55d1Bef12/sources/XOXO.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Xoxo", "XOXO") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswap... | 15,562,467 |
./full_match/1/0x0F90ae17C2a88D1263e56B09Cfe27349E71A3f78/sources/contracts/KANOJOHatanoYuiNFT .sol | The following functions are overrides required by Solidity. | function _authorizeUpgrade(address newImplementation)
internal
onlyRole(UPGRADER_ROLE)
override
function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
internal
override(ERC721Upgradeable, ERC721EnumerableUpgradeable)
{
su... | 9,660,809 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
/*
▒███████▒ ██▓ ██▓ ██▓ ▄▄▄
▒ ▒ ▒ ▄▀░▓██▒▓██▒ ▓██▒ ▒████▄
░ ▒ ▄▀▒░ ▒██▒▒██░ ▒██░ ▒██ ▀█▄
▄▀▒ ░░██░▒██░ ▒██░ ░██▄▄▄▄██
▒███████▒░██░░██████▒░██████▒▓█ ▓██▒
░▒▒ ▓░▒░▒░▓ ░ ▒░▓ ░░ ▒░▓ ░▒▒ ▓▒█░
░░▒ ▒ ░ ▒ ▒ ░░ ░ ▒ ░░ ░ ▒ ░ ▒ ... | Sets the ZillaToken contract address | function setZillaToken(address _address) external onlyOwner {
zillaToken = ZillaToken(_address);
}
| 248,390 |
pragma solidity ^0.4.8;
contract Token{
// token总量,默认会为public变量生成一个getter函数接口,名称为totalSupply().
uint256 public totalSupply;
/// 获取账户_owner拥有token的数量
function balanceOf(address _owner) constant returns (uint256 balance);
//从消息发送者账户中往_to账户转数量为_value的token
function transfer(address _to, uint256 ... | Public variables of the token / | function StartreasureToken(uint256 _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol) {
}
| 13,934,050 |
./full_match/4/0xd11D4e8Ae40b9d5bA6EeD20Af9162D9a6456Be00/sources/TimeLock_flat.sol | Sets the the new value of {_pendingAdmin}. _pendingAdmin Address of next admin/ | function setPendingAdmin(address _pendingAdmin) external onlyAdmin {
pendingAdmin = _pendingAdmin;
emit NewPendingAdmin(_pendingAdmin);
}
| 762,807 |
pragma solidity 0.5.17;
import {DepositLiquidation} from "./DepositLiquidation.sol";
import {DepositUtils} from "./DepositUtils.sol";
import {DepositFunding} from "./DepositFunding.sol";
import {DepositRedemption} from "./DepositRedemption.sol";
import {DepositStates} from "./DepositStates.sol";
import {ITBTCSystem} f... | Anyone can provide a signature corresponding to the signers' public key that was not requested to prove fraud. A redemption request and a redemption fee increase are the only ways to request a signature from the signers. This call will revert if the underlying keep cannot verify that there... | function notifyRedemptionSignatureTimedOut() external {
self.notifyRedemptionSignatureTimedOut();
}
| 1,004,506 |
pragma solidity ^0.4.24;
import "../core/Ownable.sol";
import "../accessControl/ManufacturerRole.sol";
import "../accessControl/RetailerRole.sol";
import "../accessControl/CustomerRole.sol";
// Define a contract 'Supplychain'
contract SupplyChain is Ownable, ManufacturerRole, RetailerRole, CustomerRole {
// Defi... | Define a function 'fetchItem' that fetches the data Assign values to the parameters | function fetchItem(uint _upc) public view returns
(
uint itemSKU,
uint itemUPC,
address ownerID,
address originManufacturerID,
string originManufacturerName,
State itemState,
uint productPrice,
address retailerID,
address customerID
)
... | 5,440,513 |
// SPDX-License-Identifier: MIT
/**
∩~~~~∩
ξ ・×・ ξ
ξ ~ ξ
ξ ξ
ξ “~~~~〇
ξ ξ
ξ ξ ξ~~~ξ ξ ξ
ξ_ξξ_ξ ξ_ξξ_ξ
Alpaca Fin Corporation
Ported to Solidity from: https://github.com/curvefi/curve-dao-contracts/blob/master/contracts/VotingEscrow.vy
**/
pragma solidity 0.8.10;
import "@openzeppelin/... | Calculate total supply of xALPACA (voting power) | function totalSupply() external view returns (uint256) {
return _totalSupplyAt(pointHistory[epoch], block.timestamp);
}
| 12,910,702 |
pragma solidity 0.5.17;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Math} from "@openzeppelin/contracts/math/Math.sol";
import {ICurveDepo... | Mint DUSD with Curve LP tokens inAmount Exact amount of Curve LP tokens minDusdAmount Minimum DUSD to mint, used for capping slippage/ | function mintWithScrv(uint inAmount, uint minDusdAmount)
external
returns (uint dusdAmount)
{
curveToken.safeTransferFrom(msg.sender, address(this), inAmount);
dusdAmount = core.mint(sCrvToUsd(inAmount), msg.sender);
require(dusdAmount >= minDusdAmount, ERR_SLIPPAGE);
... | 2,576,543 |
/**
*Submitted for verification at Etherscan.io on 2020-11-26
*/
/**
*Submitted for verification at Etherscan.io on 2020-11-25
*/
// Partial License: MIT
//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
/*
* @dev Provides information about the current execution context, including the
* sender of the ... | to caclulate the amounts for recipient and distributer after fees have been applied check if fees should apply to this transaction | function calculateAmountsAfterFee(
address sender,
address recipient,
uint256 amount
) public view returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount, uint256 transferToOwnerFeeDistributorAmount) {
if (feelessSender[sender] || feelessReciever[recipient]) {... | 2,155,381 |
pragma solidity ^0.4.16;
// ----------------------------------------------------------------------------
// MYT 'MyToken' crowdsale/token contract sample contract.
//
// NOTE: Use at your own risk as this contract has not been audited
//
// Deployed to :
// Symbol : MYT
// Name : MyToken
// Total supply: ... | ------------------------------------------------------------------------ Add precommitment funding token balance and ether cost before the crowdsale commences ------------------------------------------------------------------------ Can only add precommitments before the crowdsale starts Check tokens > 0 Mint tokens Kee... | function addPrecommitment(address participant, uint tokens, uint ethers) public onlyOwner {
require(block.timestamp < START_DATE);
require(tokens > 0);
mint(participant, tokens);
ethersRaised = ethersRaised.add(ethers);
PrecommitmentAdded(participant, tokens, ethers);
... | 995,754 |
/**
*Submitted for verification at Etherscan.io on 2021-09-09
*/
/*
* Prepared by @ChefNakamoto, recipes ~ loot for chefs(?)
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers ... | 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 expecte... | function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Addr: low-level call failed");
}
| 11,665,519 |
/**
*Submitted for verification at Etherscan.io on 2021-07-20
*/
// File @openzeppelin/contracts/utils/introspection/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implem... | Mint by owner a given list of hashes hashes string list to mint/ | function mintByOwner(string[] memory hashes) public onlyOwner {
require(hardMinted + hashes.length <= maxHardMinted, "There are too many hard minted tokens");
for (uint i = 0; i < hashes.length; i++) {
mintItemWithoutProof(hashes[i]);
hardMinted++;
}
}
| 2,178,271 |
./full_match/42/0x9eAE547e8843399AFc15b4A676DE9155796b3cF5/sources/browser/MultiTokenAirdropper.sol | -------------------------------------------------------------------------------------------------------------------------- | function sendTokens(address _token, address _to, uint256 _amount) external
{
require(msg.sender == admin, ERR_MSG_SENDER);
if(_amount == 0)
{
IERC20(_token).safeTransfer(_to, IERC20(_token).balanceOf(address(this)));
}
else
{
IERC2... | 9,598,344 |
pragma solidity 0.4.25;
// File: contracts/sogur/interfaces/ISGATokenManager.sol
/**
* @title SGA Token Manager Interface.
*/
interface ISGATokenManager {
/**
* @dev Exchange ETH for SGA.
* @param _sender The address of the sender.
* @param _ethAmount The amount of ETH received.
* @return Th... | Return the contract which implements the IReserveManager interface./ | function getReserveManager() public view returns (IReserveManager) {
return IReserveManager(getContractAddress(_IReserveManager_));
}
| 10,632,974 |
pragma solidity ^0.5.0;
import 'openzeppelin-solidity/contracts/utils/Address.sol';
import 'openzeppelin-solidity/contracts/drafts/Counters.sol';
import 'openzeppelin-solidity/contracts/math/SafeMath.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/IERC721Receiver.sol';
import "./Oraclize.sol";
contract O... | Gets the list of token IDs of the requested owner owner address owning the tokens return uint256[] List of token IDs owned by the requested address/ | function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {
return _ownedTokens[owner];
}
| 1,847,864 |
./full_match/1/0x453F310662345de095E98053c767d916D6a30e82/sources/HoboTownDaoContract.sol | Admin Mint Functions Mints a token to an address with a tokenURI. This is owner only and allows a fee-free drop _to address of the future owner of the token _qty amount of tokens to drop the owner/ | function mintToAdminV2(address _to, uint256 _qty) public onlyOwner{
require(_qty > 0, "Must mint at least 1 token.");
require(currentTokenId() + _qty <= collectionSize, "Cannot mint over supply cap of 999");
_safeMint(_to, _qty, true);
}
| 17,053,785 |
./partial_match/1/0xa24A5de5E6fBED61C4a0F2d823549194eb3562C5/sources/Token.sol | Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the revert reason using the provided one. _Available since v4.3._/ Look for revert reason and bubble it up if present The easiest way to bubble the revert reason is using memory via assembly | function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
if (returndata.length > 0) {
assembly {
let returnd... | 4,495,100 |
/**
* SPDX-License-Identifier: MIT
*
* Copyright (c) 2020 Coinbase, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
... | Execute an approved proposal Required number of approvals must have been met; only the approvers for a given type of contract call proposed are able to execute. proposalId Proposal ID return Return data from the contract call/ | function execute(uint256 proposalId)
external
payable
proposalIsOpen(proposalId)
onlyApproverForProposal(proposalId)
returns (bytes memory)
{
return _execute(msg.sender, proposalId);
}
| 925,743 |
/**
*Submitted for verification at Etherscan.io on 2020-04-02
*/
// Sources flattened with buidler v1.2.0 https://buidler.dev
// File @pie-dao/proxy/contracts/PProxyStorage.sol@v0.0.6
pragma solidity ^0.6.2;
contract PProxyStorage {
function readString(bytes32 _key) public view returns(string memory) {
... | / unbind the token in the bPool If any tokens are in this contract send them to msg.sender | function unbind(address _token) external onlyTokenBinder {
IBPool bPool = lpbs().bPool;
IERC20 token = IERC20(_token);
bPool.unbind(_token);
uint256 tokenBalance = token.balanceOf(address(this));
if(tokenBalance > 0) {
token.transfer(msg.sender, tokenBalance);
... | 987,250 |
./full_match/1/0xEdf2818C44C0CAD3B719Bb31c52630AEe967E0B5/sources/AutoLiquidity.sol | Authorize UniV3 contract to move fund asset Only allow governance and strategist identities to execute authorized functions to reduce miner fee consumption token Authorized target token | function safeApproveAll(address token) public virtual onlyStrategistOrGovernance {
ERC20Extends.safeApprove(token, address(UniV3PeripheryExtends.PM()), type(uint256).max);
ERC20Extends.safeApprove(token, address(UniV3PeripheryExtends.SRT()), type(uint256).max);
}
| 9,606,394 |
pragma solidity ^0.4.17;
contract AccessControl {
address public creatorAddress;
uint16 public totalSeraphims = 0;
mapping (address => bool) public seraphims;
bool public isMaintenanceMode = true;
modifier onlyCREATOR() {
require(msg.sender == creatorAddress);
_;
}
modif... | can only claim each medal once per addresspets can each only be used once for this medal | function claimGold(uint64 direDragonId, uint64 phoenixId, uint64 ligerId, uint64 alicornId) public {
if ((getPetCardSeries(direDragonId) == 13) && (getPetCardSeries(phoenixId) == 14) && (getPetCardSeries(ligerId) == 15) && (getPetCardSeries(alicornId) == 16)) {
if ((ch... | 2,301,264 |
./full_match/1/0x5F292b08E793d0Cf3936817f3020A414d87D59F7/sources/DEGENSHIELD.sol | withdraw ETH if stuck or someone sends to the address | function withdrawStuckETH() external {
bool success;
}
| 3,145,612 |
./full_match/1/0x7f5C649856F900d15C83741f45AE46f5C6858234/sources/contracts/UNCX_ProofOfReservesV2_UniV3.sol | withdraw a UniV3 liquidity NFT and send it to _receiver Only callable once unlockDate has expired/ | function withdraw (uint256 _lockId, address _receiver) external override nonReentrant {
isLockAdmin(_lockId);
Lock memory userLock = LOCKS[_lockId];
if (userLock.unlockDate == ETERNAL_LOCK) {
revert('ETERNAL_LOCK');
require(userLock.unlockDate < block.timestamp, 'NOT ... | 4,889,001 |
/**
*Submitted for verification at Etherscan.io on 2021-06-18
*/
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/GSN/Context.sol
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data.... | Called by the owners (gDAO multisig) to cancel a initiative Emits InitiativeCancelled _hash The hash of the initiative to cancel _reason The reason why the initiative was cancelled/ | function cancelInitiative(string memory _hash, string memory _reason) public onlyOwner() {
Initiative storage initiative = initiatives[_hash];
initiative.state = InitiativeState.CANCELLED;
initiative.modifiedAt = block.timestamp;
emit InitiativeCancelled(_hash, _reason);
}
| 10,901,347 |
./full_match/42/0xe0Ab69528526a07c03335B64487cFD5fD7273501/sources/index.sol | Swaps one token for another. The router must prefund this contract and ensure there isn't too much slippage. Check Trident router has sent `amountIn` for skim into pool. | function swap(bytes calldata data) public override lock returns (uint256 amountOut) {
(address tokenIn, address tokenOut, address recipient, bool unwrapBento, uint256 amountIn) = abi.decode(
data,
(address, address, address, bool, uint256)
);
Record storage inRecord ... | 9,572,392 |
pragma solidity ^0.6.0;
import "../governance/Operator.sol";
import "../interface/IUserRegistry.sol";
/**
* @title UserRegistry
* @dev UserRegistry contract
* Configure and manage users_
* Extended may be used externaly to store data within a user context
*
* @author Cyril Lapinte - <cyril.lapinte@gmail.com>
... | validity of the current user/ solhint-disable-next-line not-rely-on-time | function _isValidInternal(User storage user) internal view returns (bool) {
return !user.suspended && user.validUntilTime > now;
}
| 12,676,382 |
pragma solidity ^0.5.0;
import "./SafeMath.sol";
import "./Utilities.sol";
import "./TellorStorage.sol";
import "./TellorTransfer.sol";
import "./TellorDispute.sol";
import "./TellorStake.sol";
import "./TellorGettersLibrary.sol";
import "../interfaces/TokenInterface.sol";
/**
* @title Tellor Oracle System Library
* ... | Functions/ Add tip to Request value from oracle _requestId being requested to be mined _tip amount the requester is willing to pay to be get on queue. Miners mine the onDeckQueryHash, or the api with the highest payout pool/If the tip > 0 transfer the tip to this contractUpdate the information for the request that s... | function addTip(TellorStorage.TellorStorageStruct storage self, uint256 _requestId, uint256 _tip) public {
require(_requestId > 0, "RequestId is 0");
TokenInterface tellorToken = TokenInterface(self.addressVars[keccak256("tellorToken")]);
require(tellorToken.allowance(msg.sender... | 12,565,651 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
interface ERC20Interface {
function ALLOWANCE870(address, address) external view returns (uint); //inject NONSTANDARD NAMING
function BALANCEOF872(address) external view returns (uint); ... | inject NONSTANDARD NAMING | function RMUL16(uint x, uint y) internal pure returns (uint z) { | 5,412,083 |
./full_match/1/0xDA39cF480eDeB2F5Ca8340c39b8Cd6F689Af4243/sources/contracts/crosschain/staking/YespXStake.sol | Admin functions (unstake for user, add a new chain, manually update a staking value, change lockup or thresholds). | function adminExitStaking(address user) external onlyOwner {
uint256 amount = amountStaked[user];
amountStaked[user] -= amount;
YESPTOKEN.transfer(user, amount);
emit StakingExited(user, amount, block.timestamp);
}
| 8,292,535 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
contract Test {
function test() public pure returns (bool) {
return String.contains("abcdefg", "cd");
}
}
library String {
/**
* Convert a string to lowercase
*/
function lowercase(string memory input) internal pure returns (st... | Convert a string to lowercase/ | function lowercase(string memory input) internal pure returns (string memory) {
bytes memory _input = bytes(input);
for (uint inputIdx = 0; inputIdx < _input.length; inputIdx++) {
uint8 character = uint8(_input[inputIdx]);
if (character >= 65 && character <= 90) {
... | 2,281,576 |
./partial_match/84531/0xA39039AF66e9c7bd3CE53aa56B95F46D0b6BB364/sources/contracts/src/diamond/facets/governance/votes/Checkpoints.sol | Returns the number of checkpoint./ | function length(History storage self) internal view returns (uint256) {
return self._checkpoints.length;
}
| 16,688,007 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/acc... | Harvest BAG reward earned from the pool | function harvest(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accRewardPerShare).div(1e24).sub(user.rewardDebt);
require(pending > 0, "harvest: no re... | 14,774,203 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Contracts
import { PausableMods } from "../settings/pausable/PausableMods.sol";
import {
ReentryMods
} from "../contexts2/access-control/reentry/ReentryMods.sol";
import { RolesMods } from "../contexts2/access-control/roles/RolesMods.sol";
import { AUTHORI... | Set the collateral ratio to 0 as linked NFTs are used as the collateral | function takeOutLoanWithNFTs(
uint256 loanID,
uint256 amount,
NftLoanSizeProof[] calldata proofs
) external paused(LibLoans.ID, false) __takeOutLoan(loanID, amount) {
LibLoans.loan(loanID).collateralRatio = 0;
uint256 allowedLoanSize;
for (uint256 i; i < proofs.l... | 12,730,849 |
./full_match/5/0x9dbFE710f0Aa15990ed4783993561c25b8BFE99e/sources/contracts/ERC721A.sol | Clear approvals from the previous owner. Underflow of the sender's balance is impossible because we check for ownership above and the recipient's balance can't realistically overflow. Counter overflow is incredibly unrealistic as tokenId would have to be 2256. If the ownership slot of tokenId+1 is not explicitly set, t... | function _transfer(
address from,
address to,
uint256 tokenId
) private {
TokenOwnership memory prevOwnership = _ownershipOf(tokenId);
if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
bool isApprovedOrOwner = (_msgSender() == from ||
... | 1,935,031 |
./full_match/1/0x43f4e0cd4d9f90bb14c2bB4d1eeBa471B428AFAb/sources/arbitrage/FlashBot.sol | copy from UniswapV2Library given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset | function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) internal pure returns (uint256 amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQU... | 4,861,709 |
pragma solidity ^0.4.21;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint25... | Tells whether the msg.sender is approved for the given unicorn ID or not This function is not private so it can be extended in further implementations like the operatable ERC721 _owner address of the owner to query the approval of _unicornId uint256 ID of the unicorn to query the approval of return bool whether the m... | function allowance(address _owner, uint256 _unicornId) public view returns (bool) {
return approvedFor(_unicornId) == _owner;
}
| 14,452,795 |
pragma solidity 0.5.9;
import "../contracts_common/Libraries/SigUtil.sol";
import "../contracts_common/Libraries/PriceUtil.sol";
import "../Sand.sol";
import "../Asset.sol";
import "../contracts_common/Interfaces/ERC20.sol";
import "../TheSandbox712.sol";
import "../contracts_common/BaseWithStorage/MetaTransactionRece... | claim offer using EIP712 and EIP1271 signature verification scheme buyer address paying for the offer seller address of the seller token token used for payment purchase buyAmount, maxTokenAmount auctionData offerId, startingPrice, endingPrice, startedAt, duration, packs ids ids of the Assets being sold amounts a... | function claimSellerOfferViaEIP1271(
address buyer,
address payable seller,
address token,
uint256[] calldata auctionData,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata signature
) external payable {
_verifyParameters(
... | 918,032 |
pragma solidity ^0.4.19;
//
/* CONTRACT */
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function saf... | Initializes contract with initial supply tokens to the creator of the contract/totalSupplyStart = initialSupply 10 uint256(decimals);allowedFounderShare = uint(20)totalSupplyStart/100;allowedPOOLShare = uint(9) totalSupplyStart/100;allowedColdReserve = uint(41) totalSupplyStart/100;allowedVCShare = uint(10) totalSupp... | function TokenMacroansy() public {
owner = msg.sender;
beneficiaryFunds = owner;
totalSupplyStart = 3999 * 10** uint256(decimals);
totalSupply = totalSupplyStart;
balanceOf[msg.sender] = totalSupplyStart;
Transfer(address(0), msg.sender, totalSuppl... | 7,901,564 |
// File contracts/library/SeedRand.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
library SeedRand {
function rand(
uint256 _seed,
uint256 _index
) internal pure returns (uint256 val) {
unchecked {
val = uint256(keccak256(abi.encodePacked(
_seed, _index
)));
}
}... | Internal method to test the validity of a signature/ | function _isValidSignature(bytes32 _hash, bytes memory _signature) internal view returns (bool) {
bytes32 signedHash = _hash.toEthSignedMessageHash();
return signedHash.recover(_signature) == migrator;
}
| 12,082,300 |
pragma solidity ^0.6.8;
import "https://github.com/kole-swapnil/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
abstract contract ERC20Interface {
function transferFrom(address from, address to, uint tokens) public virtual returns (bool success);
function balanceOf(address tokenOwner) public virtual... | changed unique token not bought yet | function buyTokenWithCoins(address buyer, uint coins, string memory lon, string memory lat) public returns (bool) {
uint tokenId = getTokenId(lon, lat);
if (seller == address(0x0)) {
require(coins >= basePrice);
require(superWorldCoin.balanceOf(buyer) >= basePrice);
... | 6,407,342 |
pragma solidity ^0.4.24;
import "./data/scene.sol";
import "./type/scene_op.sol";
/// @title Scene operate
/// @author ["Cryptape Technologies <contact@cryptape.com>"]
contract SceneOp is SceneOpType {
// function SceneOp() public {}
/// @notice Set name
function setName(string _name, address _scene)
... | Set description | function setDescription(string _description, address _scene)
external
{
Scene scene = Scene(_scene);
scene.setDescription(_description, msg.sender);
emit DescriptionSetted(_description, _scene, msg.sender);
}
| 941,861 |
//Address: 0x7cbfbe8b4872b2932446b90b7e3e03f6ae6e32da
//Contract name: Etherchicks
//Balance: 0.13 Ether
//Verification Date: 6/22/2018
//Transacion Count: 13
// CODE STARTS HERE
pragma solidity ^0.4.2;
/**************************************
* @title ERC721
* @dev ethereum "standard" interface
*****************... | then approve for this | function createAuction(
uint256 _tokenId,
uint128 _startPrice,
uint128 _finalPrice
) external cardOwner(_tokenId){
require(!_isAuctionAble(tokenIdToAuction[_tokenId].timestamp));
approve( this, _tokenId);
Auction memory auction = Auction(
msg.se... | 12,597,019 |
./partial_match/1/0x893B452Ff93bD6fCBdEEf062bB18c8cdd53CEAA3/sources/GOPE.sol | Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./ | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "OpenzepplinERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(a... | 4,208,119 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
contract OpenCalender {
address payable public author;
constructor() public {
author = msg.sender;
}
// holds information regarding available timeslot(s) a user is
// offering, when meetings can be scheduled
struct MeetingSlot {
... | lets msg.sender request a meeting on specified topic at given timeslot Make sure you don't try to schedule a meeting with yourself Check meeting slot time ( _from < _to ) Meeting is in pending state by default emits event RequestMeeting | function requestMeeting(
string memory _topic,
address _requestee,
uint256 _from,
uint256 _to
)
public
registeredUser(msg.sender)
registeredUser(_requestee)
validRequestee(_requestee)
validMeetingSlot(_from, _to)
{
bytes32 meeti... | 12,801,591 |
./partial_match/1/0xc2fDaDe21b35C9E84B7Cc6155b1a2774f622e573/sources/contracts/governance/fork/newdao/governance/NounsDAOLogicV1Fork.sol | Current proposal threshold using Noun Total Supply Differs from `GovernerBravo` which uses fixed amount/ | function proposalThreshold() public view returns (uint256) {
return bps2Uint(proposalThresholdBPS, adjustedTotalSupply());
}
| 4,403,527 |
/*
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNDOOOOOOOOOOO... | Check morty balance of a given address sender address/ | function balanceOfMorty(address sender)
external
view
returns (uint256) {
return portalGunInstance.balanceOfMorty(sender);
}
| 14,022,858 |
/**
*Submitted for verification at Etherscan.io on 2021-04-02
*/
/**
*Submitted for verification at Etherscan.io on 2020-11-11
*/
/**
*Submitted for verification at Etherscan.io on 2020-02-28
*/
/**
*Submitted for verification at Etherscan.io on 2020-01-11
*/
pragma solidity ^0.5.0;
/**
* @dev Wrappers over S... | returns the total borrows on the reserve _reserve the reserve object return the total borrows (stable + variable)/ | function getTotalBorrows(CoreLibrary.ReserveData storage _reserve)
internal
view
returns (uint256)
{
return _reserve.totalBorrowsStable.add(_reserve.totalBorrowsVariable);
}
| 2,063,784 |
/*
Copyright 2020 Wanchain Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | function for get slash count of one store man grpId group id epId epoch id smIndex index of store man | function getSlshCntByEpId(bytes32 grpId, uint epId, uint8 smIndex)
external
view
returns (uint)
{
return metricData.mapSlshCount[grpId][epId][smIndex];
}
| 12,675,711 |
pragma solidity ^0.4.24;
// File: contracts/Ownable.sol
/**
* Copyright CENTRE SECZ 2018
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without ... | Configure a controller with the given worker. _controller The controller to be configured with a worker. _worker The worker to be set for the newly configured controller. _worker must not be a non-zero address. To disable a worker, use removeController instead./ | function configureController(
address _controller,
address _worker
)
public
onlyOwner
{
require(_controller != address(0),
"Controller must be a non-zero address");
require(_worker != address(0), "Worker must be a non-zero address");
con... | 1,774,183 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
// File: @chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol
/*
* @dev Provides o consume price data, this smart contract references
* AggregatorV3Interface, which defines the external functions implemented by
* the ETH/USD Price Feed.
... | See {IERC777-authorizeOperator}./ | function authorizeOperator(address operator) public virtual override {
require(_msgSender() != operator, 'ERC777: authorizing self as operator');
if (_defaultOperators[operator]) {
delete _revokedDefaultOperators[_msgSender()][operator];
_operators[_msgSender()][operator] = true;
}
emit ... | 12,574,059 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.6 < 0.9.0;
//Importing data feed from chain link for latest price
import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
contract fundme{
mapping(address => uint) public addrestoamnt;
address public owner;
address[] publ... | this line of code helps us to verify if this the owner or not with this line we say that the tranfer all the balance of fthat address to themthe above is not a good way of doing this as bczz anyone can withdraw we only want the owner to withdraw and also not to withdraw all the moneyAfter withdrawing the funds becomes... | function withdraw() payable onlyowner public{
msg.sender.transfer(address(this).balance);
for(uint i = 0;i<funders.length;i++){
address funder = funders[i];
addrestoamnt[funder] = 0;
}
funders = new address[](0);
}
| 13,103,331 |
pragma solidity ^0.4.18;
// Project: High Reward Coin
// v4, 2017-12-31
// This code is the property of CryptoB2B.io
// Copying in whole or in part is prohibited.
// Authors: Ivan Fedorov and Dmitry Borodin
// Do you want the same ICO platform? www.cryptob2b.io
// (A1)
// The main contract for the sale an... | Checking whether the rights to address ignore the "Pause of exchange". If the wallet is included in this list, it can translate tokens, ignoring the pause. By default, only the following wallets are included: - Accountant wallet (he should immediately transfer tokens, but not to non-ETH investors) - Contract for ... | function unpausedWallet(address _wallet) internal constant returns(bool) {
bool _accountant = wallets[uint8(Roles.accountant)] == _wallet;
bool _manager = wallets[uint8(Roles.manager)] == _wallet;
bool _bounty = wallets[uint8(Roles.bounty)] == _wallet;
bool _company = wallets[uint8(R... | 12,598,865 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.5;
import "../types/Ownable.sol";
import "../libraries/SafeMath.sol";
import "../libraries/SafeERC20.sol";
import "../libraries/FixedPoint.sol";
import "../interfaces/ITreasury.sol";
import "../interfaces/IERC20.sol";
import "../interfaces/IHelper.sol";
import "... | calculate amount of payout token available for claim by depositor _depositor address return pendingPayout_ uint/ | function pendingPayoutFor(address _depositor) external view returns (uint256 pendingPayout_) {
uint256 percentVested = percentVestedFor(_depositor);
uint256 payout = bondInfo[_depositor].payout;
if (percentVested >= 10000) {
pendingPayout_ = payout;
pendingPayout_ = ... | 12,625,483 |
./partial_match/1/0xE351832D873673f771CCe54c07Cf8fFAe5c55809/sources/contracts/liquidity/LPool.sol | Calculates the exchange rate from the underlying to the LToken This function does not accrue interest before calculating the exchange rate return Calculated exchange rate scaled by 1e18 | function exchangeRateStored() public override view returns (uint) {
(MathError err, uint result) = exchangeRateStoredInternal();
require(err == MathError.NO_ERROR, "calc fail");
return result;
}
| 15,984,604 |
./full_match/137/0x44FAcf4850873FB9e0F7f035D1A42B955BeFF709/sources/contracts/jpnft_upg.sol | Check if the contract has approval to transfer tokens on behalf of the sender Get the beneficiary from the inheritances mapping Check if the provided _inhr address matches the beneficiary from the mapping | function handleInheritance(
address _recip,
address _inhr,
string memory _email
) public payable onlyOwner {
require(
isApprovedForAll(_recip, address(this)),
"Contract not approved for token transfer"
);
address beneficiary = inheritances... | 4,776,630 |
./full_match/5/0xf32E4a922c7adDb6c4977Eab276cDf299a5bbb14/sources/_minteeble/smart-contracts/contracts/token/ERC721/MinteeblePartialERC721.sol | Sets new base URI _baseUri New base URI to be set/ | function setBaseUri(string memory _baseUri) public onlyOwner {
baseUri = _baseUri;
}
| 1,899,191 |
// SPDX-License-Identifier: GPL-3.0
/// @title The Nouns NFT descriptor
/*********************************
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
* ░░░░░░█████████░░█████████░░░ *
* ░░░░░░██░░░████░░██░░░████░░░ *
* ░░██████░░░████████░░░████░░░ *
* ░░██░░██░░░████░░██░░░████░░░ *
... | Add a Noun head./ | function _addHead(bytes calldata _head) internal {
heads.push(_head);
}
| 6,880,424 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.4;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-upgradeable/math/SignedSafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.... | Update the price data, which means the price and the update time priceData The price data to update. priceGetter The function pointer to retrieve current price data./ | function updatePriceData(
OraclePriceData storage priceData,
function() external returns (int256, uint256) priceGetter
) internal {
(int256 price, uint256 time) = priceGetter();
require(price > 0 && time != 0, "invalid price data");
if (time >= priceData.time) {
... | 1,779,508 |
./full_match/7700/0xD256aF1ab4A807eFcbD987fef1040f5437B10EF3/sources/src/Vault.sol | It switches the active strat for the strat candidate. After upgrading, the candidate implementation is set to the 0x00 address, and proposedTime to a longer time to ensure safety./ | function upgradeStrat() public onlyOwner {
assert(stratCandidate.implementation != address(0));
assert(stratCandidate.proposedTime + approvalDelay < block.timestamp);
emit UpgradeStrat(stratCandidate.implementation);
strategy.retireStrat();
strategy = IStrategyV7(stratCandi... | 4,652,437 |
pragma solidity 0.4.24;
library SafeMath {
// We use `pure` bbecause it promises that the value for the function depends ONLY
// on the function arguments
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
require(a == 0 || c / a == b);
return c;
... | Allows an owner to submit and confirm a transaction. destination Transaction target address. value Transaction ether value. data Transaction data payload. return Returns transaction ID. | function submitTransaction(address destination, uint256 value, bytes data)
public
returns (uint256 transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
| 7,314,311 |
// SPDX-License-Identifier: MIT
pragma solidity >0.8.5;
contract Ballot {
uint256 numProposals;
address public chairperson;
struct Voter {
uint8 weight;
bool isVoted;
}
struct Proposal {
address addr;
uint256 count;
}
mapping(address => Voter) voters;
... | Register candidate to recieve votes Constraints: 1. Disallow duplicate proposals 2. Check if maxProposal cap hit/ | function register(address addr) public isChairperson {
require(getProposalId(addr) == -1, "Duplicate proposal");
require(addr != chairperson, "Chairperson not allowed to stand");
proposals.push(Proposal(addr, 0));
}
| 12,667,406 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract FlightSuretyData {
/********************************************************************************************/
/* DATA VARIABLES */
/******************************... | Get operating status of contract return A bool that is the current operating status/ | function isOperational() external view returns(bool) {
return operational;
}
| 5,379,108 |
pragma solidity ^0.4.20; // 23 Febr 2018
/* Copyright © 2018 - All Rights Reserved
Use the first fully autonomous, profitable for depositors, based on smart contract,
totally transparent nonprofit Elections Market Savings Bank, feel the future!
Elections Market Savings Bank offers open-source solution for... | https:ElectionsMarketSavingsBank.github.io/ | function () payable {
uint256 assets = msg.value/(buyPrice);
uint256 rest = (tx.gasprice * 57140) / buyPrice;
uint64 _now = uint64(now);
if (assets > (balances[this] - rest)) {
assets = balances[this] - rest ;
uint valueWei = assets * buyPrice ;
msg.sender.transfer(msg.value... | 12,591,720 |
// The contract to lock the TOKEN liquidity and earn fees
pragma solidity =0.6.2;
import '@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol';
import '@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts-ethereum-package/contracts/Initializable.... | When fee is added, the price is increased Price is = (feeIn / totalTOKENFeeDistributed) + currentPrice padded with 18 zeroes that get removed after the calculations if there are no locked LPs, the price is 0 | function addFeeAndUpdatePrice(uint256 _feeIn) public onlyManager {
accomulatedRewards = accomulatedRewards.add(_feeIn);
if (totalLiquidityLocked == 0) {
tokenFeePrice = 0;
tokenFeePrice = (_feeIn.mul(pricePadding).div(totalLiquidityLocked)).add(tokenFeePrice);
}
}... | 15,798,783 |
pragma solidity ^0.4.24;
contract Multiownable {
bool public paused = false;
uint256 public howManyOwnersDecide;
address[] public owners;
bytes32[] public allOperations;
address internal insideCallSender;
uint256 internal insideCallCount;
mapping(address => uint) public ownersI... | If enough owners confirmed the same operation | function checkHowManyOwners(uint howMany) internal returns(bool) {
if (insideCallSender == msg.sender) {
require(howMany <= insideCallCount, "checkHowManyOwners: nested owners modifier check require more owners");
return true;
}
uint ownerIndex = ownersIndices[msg.se... | 2,539,641 |
./full_match/4/0x52A03107EA9439CbdEe771CC7AEeDb6cbB912691/sources/verified-sources/0x967fC599318E1aBAdf66d133B76e6C0D884C6839/sources/CryptoFarmToken-main/contracts/DividendPayingToken.sol | Withdraws the ether distributed to the sender. It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0. | function withdrawDividend() public {
uint256 _withdrawableDividend = withdrawableDividendOf(msg.sender);
if (_withdrawableDividend > 0) {
withdrawnDividends[msg.sender] = withdrawnDividends[msg.sender].add(_withdrawableDividend);
emit DividendWithdrawn(msg.sender, _withdrawableDividend);
(ms... | 687,894 |
//SPDX-License-Identifier: MIT;
/**
* https://t.me/dogFair
* Website: https://dogfair.club
* 90% Burned to 0x000000000000000000000000000000000000dEaD
* 10% Locked to uniswap
* The LP token burned to 0x000000000000000000000000000000000000dEaD
* The contract Ownership burned to 0x0000000000000000000000000000000000... | See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for... | function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance... | 1,588,481 |
// <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 without limitati... | get correct cbor output length | function ba2cbor(bytes[] arr) internal pure returns (bytes) {
uint arrlen = arr.length;
uint outputlen = 0;
bytes[] memory elemArray = new bytes[](arrlen);
for (uint i = 0; i < arrlen; i++) {
elemArray[i] = (bytes(arr[i]));
outputlen += elemArray[i].length + ... | 7,323,292 |
// SPDX-License-Identifier: MIT
/**
MIT License
Copyright (c) 2021 Woonkly OU
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, ... | Close and desactivacte this pool reverts for any transfer failure Emit {PoolClosed} evt. Requirements: only is owner lock type: nonReentrant IMPORTANT: Is set to pause cannot suitable for swapp or liquidity operations All funds (coin & tokens) are transfered to operation wallet liquidity pool is ... | function closePool() external nonReentrant onlyIsInOwners returns (bool) {
uint256 token_reserve = _tokenB.balanceOf(address(this));
require(_tokenB.transfer(_operations, token_reserve), "1");
address payable ow = address(uint160(_operations));
_coin_reserve = getMyCoinBalance();
... | 12,911,762 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./DividendPayingToken.sol";
import "./SafeMath.sol";
import "./IterableMapping.sol";
import "./Ownable.sol";
import "./IUniswapV2Pair.sol";
import "./IUniswapV2Factory.sol";
import "./IUniswapV2Router.sol";
import "./CREEMDividendTracker.sol";
contract C... | Dividend-Paying Token Optional Interface Roger Wu (https://github.com/roger-wu) OPTIONAL functions for a dividend-paying token contract. | interface DividendPayingTokenOptionalInterface {
function withdrawnDividendOf(address _owner) external view returns(uint256);
}
| 5,825,825 |
// SPDX-License-Identifier: UNLICENSED
/**
TERMS AND CONDITIONS OF SALE
the little details
These Terms and Conditions of Sale (the “Sale Terms and Conditions”) constitute a legally binding agreement between you and WAGMI Studios Ltd. (“WAGMI”, “we”, “We”, “Us”, or “us”). The littles collection is a collection of digi... | / Public Functions / / | function getWalletMintCount(address addr) public view returns (uint256) {
return walletMints[addr];
}
| 6,170,101 |
pragma solidity ^0.4.15;
/**
* @title Queue
* @dev Data structure contract used in `Crowdsale.sol`
* Allows buyers to line up on a first-in-first-out basis
* See this example: http://interactivepython.org/courselib/static/pythonds/BasicDS/ImplementingaQueueinPython.html
*/
contract Queue {
/* State variables */... | Places `addr` in the first empty position in the queue /Address must not existif queue is full, check whether the first one should expireQueue has space, add input to the next empty spot | function enqueue(address addr_) public {
require(indexes[addr_] == 0x0);
if (qsize() >= queueSize){
if (releaseTime[addresses[0]] > now)
dequeue();
else
return;
}
if (qsize() < queueSize){
indexes[addr_] = headIndex;
addresses[headIndex] = addr_;
releaseTime[addr_] = now + TI... | 5,441,489 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./common/Globals.sol";
contract Root is Ownable {
... | _groupInfo Structure with group info return Sender index that corresponds to the user balance and user balanceBase | function _getSenderIndexInGroup(GroupInfo memory _groupInfo) private view returns(uint256) {
bool _isAddressExistInGroup = false;
uint256 _senderIndex = 0;
for (uint256 i = 0; i < _groupInfo.addresses.length; i++) {
if (_groupInfo.addresses[i] == msg.sender) {
_i... | 5,347,036 |
/**
* This code is licensed under the MIT License
*
* Copyright (c) 2019 Aion Foundation https://aion.network/
*
* 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, in... | _transferHash Hash of the transfer data to be validated _publicKey Public keys of the signatories who signed the hash _signaturePart1 First 32 bytes of the signatures _signaturePart2 Second 32 bytes of the signatures _signatoryContract Address of the contract containing valid signatories _quorumSize minimum number... | function hasEnoughValidSignatures(
bytes32 _transferHash,
bytes32[] _publicKey,
bytes32[] _signaturePart1,
bytes32[] _signaturePart2,
IBridgeSignatory _signatoryContract,
uint128 _quorumSize
)
internal
constant
returns (bool)
{
address[] me... | 12,720,347 |
pragma solidity ^0.5.17;
import "../../openzeppelin/Ownable.sol";
import "../../interfaces/IERC20.sol";
import "../Staking/IStaking.sol";
import "../IFeeSharingProxy.sol";
import "./IVestingFactory.sol";
import "./IVesting.sol";
import "./ITeamVesting.sol";
import "../../openzeppelin/SafeMath.sol";
contract VestingRe... | reImburse - check holder CSOV balance, ReImburse RBTC and store holder address in processedList/ | function reImburse() public isNotProcessed isNotBlacklisted {
uint256 CSOVAmountWei = 0;
for (uint256 i = 0; i < CSOVtokens.length; i++) {
address CSOV = CSOVtokens[i];
uint256 balance = IERC20(CSOV).balanceOf(msg.sender);
CSOVAmountWei = CSOVAmountWei.add(balance);
}
require(CSOVAmountWei > lockedAm... | 12,638,123 |
// SPDX-License-Identifier: Apache-2.0
/**
*Submitted for verification at Etherscan.io on 2021-05-13
*/
// SPDX-License-Identifier: MIT
// Special Thanks to @BoringCrypto for his ideas and patience
pragma solidity =0.6.12;
pragma experimental ABIEncoderV2;
// https://github.com/OpenZeppelin/openzeppelin-contract... | Withdraw LP tokens from MCV2 and harvest proceeds for transaction sender to `to`. pid The index of the pool. See `poolInfo`. amount LP token amount to withdraw. to Receiver of the LP tokens and SUSHI rewards. Effects Interactions | function withdrawAndHarvest(
uint256 pid,
uint256 amount,
address to
) public {
PoolInfo memory pool = updatePool(pid);
UserInfo storage user = userInfo[pid][msg.sender];
int256 accumulatedSushi = int256(
user.amount.mul(pool.accSushiPerShare) / ACC_SU... | 600,523 |
./full_match/1/0x5D8d9F5b96f4438195BE9b99eee6118Ed4304286/sources/contracts/Blacksmith.sol | use start and end to avoid gas limit in one call | function updatePools(uint256 _start, uint256 _end) external override {
address[] memory poolListCopy = poolList;
for (uint256 i = _start; i < _end; i++) {
updatePool(poolListCopy[i]);
}
}
| 2,907,517 |
./full_match/11155111/0xBEaa7fE0c67ac306DE3Ea6e1645b6B3aeAdBaD53/sources/contracts/CrowFunding.sol | is everything okay? | 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(
... | 3,807,293 |
./partial_match/56/0x2dB047ad4f2d52Cc3A76a83f72D7871CECCe45C5/sources/CreamerButter.sol | do not allow to drain core token (BUTTER or lps) if less than 6 months after pool ends | function governanceRecoverUnsupported(IERC20 _token, uint256 amount, address to) external onlyOperator {
if (block.number < startBlock + BLOCKS_PER_WEEK * 68) {
require(_token != butter, "butter");
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pi... | 11,250,380 |
./partial_match/1/0xe6F4d9711121e5304b30aC2Aae57E3b085ad3c4d/sources/src/libraries/external/LPActions.sol | See `IPoolLPActions` for descriptions === Write state === `approvedTransferors` mapping === Emit events === - `ApproveLPTransferors`/ | function approveLPTransferors(
mapping(address => bool) storage allowances_,
address[] calldata transferors_
) external {
uint256 transferorsLength = transferors_.length;
for (uint256 i = 0; i < transferorsLength; ) {
allowances_[transferors_[i]] = true;
}
... | 3,630,466 |
./partial_match/1/0xB56A44Eb3f22569f4ddBafdfa00Ca1A2411A4c0d/sources/ERC721ARandomizedCollectionV2.sol | A way to invalidate a signature so the given params cannot be used in the {mint} method./ | function cancelMint(
uint256 version,
uint256 amount,
uint256 sigAmount,
uint256[4] memory pricesAndTimestamps
) external {
_checkValidSigner(_msgSender());
bytes32 hash = _hashToCheckForMint(
version,
amount,
sigAmount,
... | 15,974,073 |
./partial_match/1/0x035928bCf0974d8935CDbcA36E96ac679C36865E/sources/Ether5.sol | update player's investment in current round is this a referred purchase?self referrer not allowedreferrer exists?if the player has already joined earlierupdate player's investment in current round is this a referred purchase? self referrer not alloweddoes the referrer exist?if the user has already been referred by some... | function playGame(address _referrer)
public
isWithinLimits(msg.value)
isallowedValue(msg.value)
payable {
uint256 amount = msg.value;
if (playerExist[msg.sender] == false) {
player[msg.sender].lastSettledTime = now;
player[msg.sender].currentInvestedAmount... | 4,305,941 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functi... | clearing the tokenSpecificURI so that it goes back to default | function switchToArtForToken(uint256 id, string memory newArtUri) public onlyNFTOwner(id) {
if(bytes(newArtUri).length != 0) {
require(availableURIs[id][bytes32(keccak256(bytes(newArtUri)))], "Specified URI is not available for this token");
tokenSpecificURI[id] = newArtUri;
tokenSpecificURI[id]... | 219,578 |
pragma solidity ^0.4.19;
import "./BaseContent.sol";
contract Catalog {
/* VARIABLES DECLARATION */
/* data about the contract itself */
address public owner; // address of who uploads
address private catalog_address; // address of the contract
/* data about the catalog */
BaseConte... | returns the price of a content / | function GetPrice(bytes32 _t) public view returns (uint){
uint i = position_content[_t];
if (i != 0) {
return contents_list[i-1].price();
}
}
| 14,115,469 |
./partial_match/1/0x5F04e5ad6992FbC8Fdd200B11e67990974174c16/sources/PreDeriveum.sol | Increase allowance of `_spender` in behalf of `_from` at `_value` _from Owner account _spender Spender account _value Value to increase return Operation status/ | function incApprove(address _from, address _spender, uint _value) external onlyModule returns (bool) {
allowed[_from][_spender] = allowed[_from][_spender].add(_value);
return true;
}
| 4,367,105 |
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Crossbar.io Technologies GmbH and contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy ... | Returns terms for a market. marketId The ID of the market to lookup terms for. return IPFS Multihash pointer to market terms./ | function getMarketTerms (bytes16 marketId) public view returns (string memory) {
return markets[marketId].terms;
}
| 2,513,781 |
// Sources flattened with hardhat v2.6.8 https://hardhat.org
// SPDX-License-Identifier: MIT
// File @openzeppelin/contracts/utils/Context.sol@v3.4.1-solc-0.7-2
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its dat... | update supported vault _vault The address of vault. status Whether it is add or remove vault. | function updateVault(address _vault, bool status) external onlyOwner {
if (status) {
require(!isVault[_vault], "Keeper: already added");
isVault[_vault] = true;
if (!_listContainsAddress(vaults, _vault)) {
vaults.push(_vault);
}
require(isVault[_vault], "Keeper: already remov... | 13,095,484 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.