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/42/0x4063270362F942C265CCcB257c616852b1759AE2/sources/contracts/UniswapV2Router2.sol | charge 0.3% fee on trading of pair(weth, dai, usdt, wbtc, usdc) | function chargeTransactionFeeIn(uint amountIn, address[] memory path) internal returns (uint) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
address pair = UniswapV2Library.pairFor(factory, path[0], path[1]... | 16,278,792 |
pragma solidity ^0.8.2;
// SPDX-License-Identifier: MIT
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(msg.sender);
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability w... | _sendToCharity(tCharity, sender); | function _transferStandard(address sender, address recipient, uint256 tAmount) private {
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tBurn, uint256 tCharity) = _getValues(tAmount);
uint256 rBurn = ... | 6,038,208 |
./full_match/1/0xBBecdE7bea79d456a203fD9cF13e1209D6458809/sources/RUSHLABSX.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("RushLabs.XYZ", "RUSHLABS") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IU... | 4,843,767 |
./full_match/1/0x09c78EB6A65CbF17a589A387A6752316A65b4D3f/sources/contracts/strategies/compound/CompoundStrategy.sol | Approve all required tokens | function _approveToken(uint256 _amount) internal override {
collateralToken.approve(pool, _amount);
collateralToken.approve(address(cToken), _amount);
for (uint256 i = 0; i < swapManager.N_DEX(); i++) {
IERC20(COMP).approve(address(swapManager.ROUTERS(i)), _amount);
}
... | 17,066,709 |
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
contract ORAcURLCaller {
//dispatcher proxy contract address
DispatcherInterface public dispatcher = DispatcherInterface(0x9565B24fbe3E386191B61f56cC6249ECFF3ab489);
address dispatcherAddress = 0x9565B24fbe3E386191B61f56cC6249ECFF3ab489;
//D... | cURL receives the endpointID, the name of the callback function, and vars to be sent in the cURL You can optionally specify the wei to send for the trip back + tip as a parameter, otherwise it will send all of msg.value/todo: verifynonce to be able to re-try or unstick a call with insufficient fundscreate callID using ... | function cURL(uint128 _endpointID, bytes32 _callback, bytes32 _calldata, uint _value) internal returns(bytes32, uint) {
uint _nonce = 0;
bytes32 _callID = keccak256(abi.encodePacked(
_endpointID, _callback, _calldata, _nonce, block.timestamp));
if(useLocalQueueFeatures){
... | 6,467,047 |
./full_match/3/0xaAA567FBA9D8C427E6cEB97280fA5ef32E53EF16/sources/interface.sol | interface IUniswapV2Pair | interface V2PoolInterface {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function deci... | 8,111,199 |
./partial_match/1/0xc880c252db7C51F74161633338A3BdafA8E65276/sources/BancorBridge.sol | solhint-disable no-empty-blocks Payable fallback to receive ETH from Bancor/WETH. Poor man's receive in 0.5.9 | function ()
external
payable
{
require(msg.data.length == 0);
}
| 10,999,203 |
// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.1;
//
/******************************************************************************\
* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)
/************************************************************... | if function does not exist then do nothing and return replace selector with last selector, then delete last selector if not the same then replace _selector with lastSelector delete the last selector if no more selectors for facet address then delete the facet address replace facet address with last facet address and de... | function removeSelector(address _oldFacetAddress, bytes4 _selector) internal {
DiamondStorage storage ds = diamondStorage();
require(_oldFacetAddress != address(0), "LibDiamondCut: Can't remove or replace function that doesn't exist");
require(_oldFacetAddress != address(this), "LibDiamondCu... | 2,193,502 |
./partial_match/42/0xDaFBf3142aEC7FCbE3c7600287A3D5476FE0ceBC/sources/MySuperCompliance.sol | See {ICompliance-destroyed}./ | function destroyed(address _from, uint256 _value) external onlyToken override {
destructionActionOnCountryRestrictions(_from, _value);
}
| 8,842,178 |
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/Marketplace.sol | Changes The Amount Of NFTs For Sale/ | function __ChangeFixedPriceAmountForSale(uint SaleIndex, uint AmountForSale) external onlyAdmin { FixedPriceSales[SaleIndex]._AmountForSale = AmountForSale; }
| 8,471,316 |
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract Exchange {
using SafeMath for uint256;
//vars
address constant ETHER = address(0);
address payable public feeAccount;
uint256 public feePe... | charge fees - taken from filler of order (msg.sender)DO TRADEmsg.sender is the person filling order, _user the person who made the ordermove order fillers tokens to order maker, whilst subtracting fees from fillertake fees to fee accountmove order makers tokens to order filleremit event | function _trade(uint256 _id, address _user, address _tokenGet, uint256 _amountGet, address _tokenGive, uint256 _amountGive) internal {
uint256 _feeAmount = _amountGet.mul(feePercent).div(100);
tokens[_tokenGet][msg.sender] = tokens[_tokenGet][msg.sender].sub(_amountGet.add(_feeAmount));
toke... | 2,576,615 |
pragma solidity ^0.8.11;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {Unauthorized, IllegalState, IllegalArgument} from "./base/Errors.sol";
import "./base/Multicall.sol";
import "./base/Mutex.sol";
import "./interfaces/IAlchemistV2.sol";
import "./interfaces/IERC20Minimal.sol... | Increases the debt by `amount` for the account owned by `owner`. owner The address of the account owner. amount The amount to increase the debt by. | function _updateDebt(address owner, int256 amount) internal {
Account storage account = _accounts[owner];
account.debt += amount;
}
| 504,835 |
pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;
//SPDX-License-Identifier: MIT
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {
ISuperfluid,
ISuperToken,
SuperAppBase,
SuperAppDefiniti... | /divides amount to be distributed by of outstanding shares (& removes excess - do NOT test with low of wei!) | function _distribute(uint256 cashAmount) internal {
(uint256 actualCashAmount,) = _ida.calculateDistribution(
_ethx,
address(this), INDEX_ID,
cashAmount
);
_host.callAgreement(
_ida,
abi.encodeWithSelector(
_ida.distribute.selector,
_ethx,
... | 7,307,396 |
./full_match/137/0x839ddcCea2cA70A66d08397E0047D2C272465Cd4/sources/mrat.sol | reward claim protocol | function activateContract() public onlyOwner {
disableEasyRewardFrom = block.timestamp + 1 weeks;
rewardCycleBlock = 7 days;
easyRewardCycleBlock = 1 days;
winningDoubleRewardPercentage = 5;
disruptiveTransferEnabledFrom = block.timestamp;
liquidityAdded = true;
... | 3,751,429 |
./full_match/42161/0xF7246C656D8AFf1e7da5547D8A7C0A88Fcb76831/sources/interfaces/libs/BalancerUtils.sol | Return a completed fund management struct, not stored here due to library restrictions. return funds Struct is always the same with receiver address the same as sender./ | function funds() private view returns (IBalancerVault.FundManagement memory) {
return IBalancerVault.FundManagement(
address(this),
false,
payable(address(this)),
false
);
}
| 16,299,626 |
pragma solidity ^0.4.16;
/*
* Abstract Token Smart Contract. Copyright ยฉ 2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <mikhail.vladimirov@gmail.com>
*/
pragma solidity ^0.4.20;
/*
* EIP-20 Standard Token Smart Contract Interface.
* Copyright ยฉ 2016โ2018 by ABDK Consulting.
* Author: Mikhail Vladimirov... | Change how many tokens given spender is allowed to transfer from message spender. In order to prevent double spending of allowance, this method receives assumed current allowance value as an argument. If actual allowance differs from an assumed one, this method just returns false. _spender address to allow the owner... | function approve (address _spender, uint256 _currentValue, uint256 _newValue)
public returns (bool success) {
if (allowance (msg.sender, _spender) == _currentValue)
return approve (_spender, _newValue);
else return false;
}
| 715 |
/**
*Submitted for verification at Etherscan.io on 2022-04-08
*/
//SPDX-License-Identifier: MIT
/*
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
โ โ โ โ โ โโโโโโโ โ โ โ โโโโ... | market status flag normal transaction tx limitsbuysell liquidity generator for tokenomics send converted eth from fees to respective walletsif any account belongs to excludedFromFees account then remove the fee | function _transfer(address from, address to, uint256 amount) private {
uint trade_type = 0;
bool takeFee = true;
bool overMinimumTokenBalance = balanceOf(address(this)) >= minimumTokensBeforeSwap;
require(from != address(0), "ERC20: transfer from the zero address");
if(!marke... | 14,967,831 |
./full_match/5/0x3c4A81308e287a4d1a315415205b6499a3C9286a/sources/project_/contracts/BaseContracts/BaseVault.sol | owner can change timeLock; the new `timeLock` cannot be lower than `absoluteMinTimeLock` _newTimeLock Sets the new minimum default `timeLock` in seconds; pending payments maintain their `earliestPayTime` | function setTimelock(uint256 _newTimeLock) public onlyOwner {
require(
_newTimeLock > absoluteMinTimeLock,
"BaseVault: _newTimeLock should be higher than absoluteMinTimeLock"
);
timeLock = _newTimeLock;
}
| 1,929,467 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./interfaces/IConvenience.sol";
import "./authorizers/interfaces/IAuthorizer.sol";
import "./interfaces/IAirnode.sol";
contract Convenience is IConvenience {
IAirnode public airnode;
constructor (address _airn... | A convenience function to retrieve provider parameters and the block number with a single call providerId Provider ID return admin Provider admin return xpub Master public key of the provider node return blockNumber Block number | function getProviderAndBlockNumber(bytes32 providerId)
external
view
override
returns (
address admin,
string memory xpub,
uint256 blockNumber
)
{
(admin, xpub) = airnode.getProvider(providerId);
blockNumber = block.numb... | 5,360,031 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./interfaces/ITrancheTokens.s... | Grant the minter role to a specified account | function setPossumMinter(address _jYearn) external onlyOwner {
PossumAddress = _jYearn;
_setupRole(MINTER_ROLE, _jYearn);
}
| 1,029,549 |
pragma solidity >=0.7.0 <0.9.0;
import "../../../node_modules/@openzeppelin/contracts/access/Ownable.sol";
contract Quorum is Ownable {
using SafeERC20 for IERC20;
uint256 public gasPerTimeUnit = 100;
IERC20 public token;
event QuorumChanged(
address indexed consumer,
address index... | start existing processes on new DSP emit event to existing DSPs | function addDSP(address dsp) public {
consumers[msg.sender].dsps = dsps;
}
| 2,510,986 |
pragma solidity 0.6.6;
// SPDX-License-Identifier: MIT
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when de... | Revoke contract's access (only approved contracts or msg.sender==tx.origin can call this strategy) Can only be called by the owner account Contract's address/ | function revokeContractAccess(address account) external onlyOwner {
require(account != address(0), "0x0");
approved[account] = false;
}
| 361,859 |
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not ... | Mandatory overrides. | function _beforeTokenTransfer(address _from, address _to, uint _amount) internal override {
super._beforeTokenTransfer(_from, _to, _amount);
LPS_beforeTokenTransfer(_from, _to, _amount);
}
| 13,497,868 |
//โโโโโโโ โโโโโโ โโโ โโโโโโ โโโโโโโ โโโโโโโ โโโ
//โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโ
//โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโ โโโ
//โโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโ
//โโโ โโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโ
//โโโ โโโ โโโโโโโโโโโโโโ โโโโโโโโ... | Proposes the address of a new Implementation (the new Controller contract)/ | function proposeImplementation(address newPendingImplementation) public adminOnly {
address oldPendingImplementation = pendingImplementation;
pendingImplementation = newPendingImplementation;
emit NewPendingImplementation(oldPendingImplementation, newPendingImplementation);
}
| 1,062,175 |
./full_match/5/0xFa485843F86074F35a05aDEF4F9e10f921aa5493/sources/contracts/CrowdFunding.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(campaign.deadline < block.timestamp, "Deadline should be d... | 1,853,334 |
./full_match/80001/0xd55A0Ca328477b75d6f7F738237473005c90B809/sources/project_/contracts/KeyHolder.sol | implementation of the addKey function of the ERC-734 standard Adds a _key to the identity. The _purpose specifies the purpose of key. Initially we propose four purpose: 1: MANAGEMENT keys, which can manage the identity 2: ACTION keys, which perform actions in this identities name (signing, logins, transactions, etc.) 3... | function addKey(
bytes32 key,
uint256 purposeType,
uint256 keyType
) public override mOnlyManagementKey returns (bool success) {
if (_keys[key].key == key) {
uint256[] memory _purposes = _keys[key].purposes;
for (
uint256 keyPurposeIndex = ... | 5,638,151 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
import "Initiative_Legislative_lib.sol";
import "Register.sol";
import "Citizens_Register.sol";
import "IVote.sol";
import "IDelegation.sol";
*/
import "contracts/Initiative_Legislative_lib.sol";
import "contracts/Register.sol";
import "contracts/Citizens_Reg... | Get various Delegation state variables values. return legislatif_process_version Current version of parameters related to delegation law project process. return internal_governance_version Current version of parameters related to delegation internal governance. return actual_mandate Id number of the current mandate ret... | function Get_Delegation_Infos()external view returns (uint legislatif_process_version, uint internal_governance_version, uint actual_mandate, uint potentialy_lost_amount, bool in_election_stage){
return (Legislatif_Process_Version, Internal_Governance_Version, Actual_Mandate, Potentialy_Lost_Amount, In_elec... | 12,618,302 |
./full_match/5/0x2743d6F0fb1E4CCb768D4530841d35dC44C59789/sources/contracts/extension/upgradeable/PermissionsEnumerable.sol | Returns the PermissionsEnumerable storage. | function _permissionsEnumerableStorage() internal pure returns (PermissionsEnumerableStorage.Data storage data) {
data = PermissionsEnumerableStorage.data();
}
| 11,603,080 |
./full_match/84531/0x9E8962EdF2f07DcA542f6C51d07Fcf6DFf17E8af/sources/votewithfrens.sol | Modified function to get vote options and votes by Proposal index | function getVoteOptionsAndVotesByProposal(address _address, uint256 index, bool isActive) public view returns (string[] memory voteOptions, uint256[] memory voteCounts) {
require(index < (isActive ? activeProposals[_address].length : inactiveProposals[_address].length), "Index out of bounds");
Prop... | 11,516,268 |
pragma solidity 0.5.11;
/**
* @title OUSD Vault Contract
* @notice The Vault contract stores assets. On a deposit, OUSD will be minted
and sent to the depositor. On a withdrawal, OUSD will be burned and
assets will be sent to the withdrawer. The Vault accepts deposits of
interest for... | _strategyAddr Address of the strategy to collect rewards from/ | function collectRewardTokens(address _strategyAddr) public onlyGovernor {
IStrategy strategy = IStrategy(_strategyAddr);
strategy.collectRewardToken();
}
| 1,233,240 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.5;
contract FlightSuretyData {
// using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABLES */
... | Get funded status of an airline airline address of the airline return A bool that is the current airline registration status/ | function isAirlineFunded(address airline)
external
view
returns(bool)
{
return airlines[airline].isFunded;
}
| 6,442,413 |
pragma solidity ^0.4.0;
/**
* The contract is a Smart ID, and all derived 'Smart IDs' should match the bytecode
* of a known 'good SmartIdentity' version. See the 'SmartIdentityRegistry' contract
* for a mechanism for verifying valid SmartIdentities.
*/
contract SmartIdentity {
address private owne... | The override address is another ethereum address that can reset the owner. In practice this could either be another multi-sig account, or another smart contract that this control could be delegated to./ | function setOverride(address _override) onlyBy(owner) checkBlockLock() blockLock() returns(bool) {
override = _override;
sendEvent(SIG_CHANGE_EVENT, "Override has been changed");
return true;
}
| 6,455,295 |
./full_match/5/0x1A0d58a79fB4e74f6a7d45bFD91C0EF3DEEfcF86/sources/contracts/libs/MathUtils.sol | Compute percentage of a value with the percentage represented by a fraction _amount Amount to take the percentage of _fracNum Numerator of fraction representing the percentage _fracDenom Denominator of fraction representing the percentage/ | function percOf(
uint256 _amount,
uint256 _fracNum,
uint256 _fracDenom
) internal pure returns (uint256) {
return (_amount * percPoints(_fracNum, _fracDenom)) / PERC_DIVISOR;
}
| 1,887,359 |
./full_match/42/0xAfCd2405298C2FABB2F7fCcEB919B4505A6bdDFC/sources/browser/MerkleDistributor.sol | Check claimed proof against merkle window at given index. Check the account has not yet claimed for this window. Proof is correct and claim has not occurred yet; check that claim window has begun. | function _markClaimed(Claim memory claim) private {
require(_verifyClaim(claim), "Incorrect merkle proof");
require(!claimed[claim.windowIndex][claim.account], "Account has already claimed for this window");
require(getCurrentTime() >= merkleWindows[claim.windowIndex].start, "Claim window h... | 16,243,984 |
./full_match/5/0xA13E43d299dd822677f3Cc62d3E77b84DC3665c3/sources/project_/contracts/base/MetawinMinterProxy.sol | Private function to calculate the purchase price./ | function _getPrice(uint256 amount) private view returns (uint256 price) {
price = _currentAuctionPrice() * amount;
}
| 1,942,884 |
// Sources flattened with hardhat v2.6.1 https://hardhat.org
// File @openzeppelin/contracts/utils/Context.sol@v4.3.2
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these ar... | Copies a piece of memory to another location. _dest Destination location. _src Source location. _len Length of memory to copy./ | function _memcpy(
uint256 _dest,
uint256 _src,
uint256 _len
) private pure {
uint256 dest = _dest;
uint256 src = _src;
uint256 len = _len;
for (; len >= 32; len -= 32) {
assembly {
mstore(dest, mload(src))
}
... | 366,129 |
./partial_match/8453/0xD65Abd7014B638e4b9b8657063389Eb1abB9689a/sources/contracts/enforcer/HolographRoyalties.sol | Gets the default royalty base points(percentage) from storage slot. return bp Royalty base points(percentage) for royalty payouts./ | function _getDefaultBp() private view returns (uint256 bp) {
assembly {
bp := sload(_defaultBpSlot)
}
}
| 16,799,295 |
pragma solidity ^0.5.9;
// Files Validator
contract Validator{
mapping(string => bytes32) public files_hashes;
// add file to the validator
function add_file_hash(string calldata _file_name, bytes32 _file_hash) external {
files_hashes[_file_name] = _file_hash;
}
// a casting func... | check if a question is valid does the validator has the files' info? | function is_valid_question(bytes32[] calldata _question) view external returns(bool){
bytes memory question = bytes32array_to_bytes(_question);
string memory file_name = string(question);
if (files_hashes[file_name] != bytes32(0)) {
return true;
}
return false;
... | 1,048,278 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.10 <0.8.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
im... | Total shares of the fund, as if all Token A and B are merged. | function getTotalShares() public view override returns (uint256) {
return
_totalSupplies[TRANCHE_M].add(_totalSupplies[TRANCHE_A]).add(_totalSupplies[TRANCHE_B]);
}
| 12,579,391 |
./partial_match/4/0x84F7d65E1D82cb8c839b21945c085eC794D93d5b/sources/TetherToken.sol | Forward ERC20 methods to upgraded contract if this one is deprecated | function approve(address _spender, uint256 _value)
public
virtual
override
onlyPayloadSize(2 * 32)
{
if (deprecated) {
return
UpgradedStandardToken(upgradedAddress).approveByLegacy(
msg.sender,
_spender,
_value
);
return super.approve(_sp... | 8,758,946 |
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.6.2;
import './Utilities.sol';
/// @notice ERC-20 contract with support for EIP-2612 and other niceties.
contract HabitatToken is Utilities {
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (... | Approves `amount` from sender to be spend by `spender`. spender Address of the party that can draw from msg.sender's account. amount The maximum collective amount that `spender` can draw. return (bool) Returns True if approved. | function approve (address spender, uint256 amount) public virtual returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
| 5,466,821 |
./full_match/40/0x41c98Ba90f8f5555C269d3Fb63f3B8E5033d75aA/sources/omnidex/omnidex-pools/CharmVaultV2.sol | Reinvests CHARM tokens into ZenMaster Only possible when contract not paused./ | function harvest(address _caller) external onlyAuthorized whenNotPaused {
IZenMaster(zenmaster).leaveStaking(0);
uint256 bal = available();
uint256 currentPerformanceFee = bal.mul(performanceFee).div(10000);
token.safeTransfer(treasury, currentPerformanceFee);
uint256 curre... | 9,550,184 |
pragma solidity ^0.4.20;
pragma experimental ABIEncoderV2;
import "github.com/oraclize/ethereum-api/oraclizeAPI_0.4.sol";
// Changed MAGic to Magic
// Changed ua to userAddress
contract MagicIDContract is usingOraclize{
address public contractOwner;
mapping (bytes32 => uint16) uin_version;
mapping (byte... | Change return variables' names here | function getIDGender(bytes32 uin) constant isAccessAgency returns (bool isRet, string ret_gender) {
AccessAgencyStruct queryingAgency = address_AccessAgencyStruct[msg.sender];
if(uin_AgencyID_IDInstance[uin][queryingAgency.agency_id].time_fence < now){
return (false, "");
}
... | 12,686,918 |
pragma solidity ^0.5.8;
interface ierc2068 { //inject NONSTANDARD NAMING
function TOTALSUPPLY3() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF80(address account) external view returns (uint256); //inject NONST... | inject NONSTANDARD NAMING | function BALANCEOF80(address account) public view returns (uint256) { | 12,763,989 |
./full_match/1/0xCc09F34Accdb36ee3ED98358A3B8a6AE5C29Ea07/sources/contracts/AnonWeb3Token.sol | Transfers tokens from one address to another with the sender's approval | function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"... | 8,346,011 |
./full_match/5/0xbc5E27602fB899964743b09381E3410cbb83E018/sources/contracts/Punkillaz.sol | Returns the unpacked `TokenOwnership` struct from `packed`./ | function _unpackedOwnership(uint256 packed)
private
pure
returns (TokenOwnership memory ownership)
{
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);
ownership.burned = packed & BITMASK_BURNED != 0;
... | 1,922,125 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
// Part: IBasicRewards
interface IBasicRewards {
function stakeFor(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function withdrawAll(bool) external;
function getReward() external ret... | Check if the index has been marked as claimed. index - the index to check return true if index has been marked as claimed. | function isClaimed(uint256 index) public view returns (bool) {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
uint256 claimedWord = claimedBitMap[week][claimedWordIndex];
uint256 mask = (1 << claimedBitIndex);
return claimedWord & mask == mask;... | 5,713,448 |
./full_match/80001/0xE369423ea9f02B201f179E64e2298B4E2F6937f0/sources/contracts/TicketManagement.sol | Adding the Tickets' Owner Details. Store the addEmployee transaction into the logs | function addTicketOwner(
address _owner,
uint256 _amount,
string memory _typeOfTicket,
string memory _imgUrl
) public payable returns (uint256) {
address newOwner = msg.sender;
bool success;
require(success, "Transfer failed.");
Transaction storag... | 5,609,228 |
./full_match/42/0x492f2B3372425C7De48ac40B3B8B8B2fE66EFEDD/sources/browser/LeadToken.sol | Get current day from launch | function currentDay() external view returns (uint256){ return _currentDay();}
| 16,240,830 |
// SPDX-License-Identifier: MIT
// Soldity version 0.8.X
pragma solidity ^0.8.0;
// (๐ See brownie-config.yaml for dependencies)
// For Chainlink price feeds
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
// For contract ownership management
import "@openzeppelin/contracts/access/Ownabl... | Ends the lottery and requests randomness Lock other functionality (Request and receive data cycle) Requesting data from VRFCoordinator Emit an event for testing purposes | function endLottery() public onlyOwner {
lottery_state = LOTTERY_STATE.CALCULATING_WINNER;
bytes32 requestId = requestRandomness(keyHash, fee);
emit RequestedRandomness(requestId);
}
| 12,920,814 |
// SPDX-License-Identifier: BlueOak-1.0.0
pragma solidity 0.8.9;
import "contracts/libraries/Fixed.sol";
import "contracts/p0/RToken.sol";
import "contracts/p0/mixins/Component.sol";
import "contracts/p1/RToken.sol";
import "contracts/interfaces/IBackingManager.sol";
import "contracts/interfaces/IBasketHandler.sol";
i... | amount {BU} return erc20s The addresses of the ERC20 tokens in the reference basket return quantities {qTok} The quantity of each ERC20 token to issue `amount` baskets | function quote(uint192 amount, RoundingMode rounding)
external
view
returns (address[] memory erc20s, uint256[] memory quantities)
{
erc20s = new address[](1);
erc20s[0] = modeA ? address(tokenA) : address(tokenB);
quantities = new uint256[](1);
quantities... | 1,833,298 |
pragma solidity ^0.7.5;
// ----------------------------------------------------------------------------
// BokkyPooBah's DateTime Library v1.01
//
// A gas-efficient Solidity date and time library
//
// https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
//
// Tested date range 1970/01/01 to 2345/12/31
//
// Co... | emit ClaimUnstaked(msg.sender, amount); | function withdrawUnstakedwNXM(uint amount) external {
_nonReentrant();
_Locked = TRUE;
IERC20Upgradeable wnxm = IERC20Upgradeable(_WNXMAddress);
uint balance = wnxm.balanceOf(address(this));
require(amount <= balance);
require(_getStakingDataContract(... | 11,785,452 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMathLibrary {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint... | add an address to the whitelist addr address return true if the address was added to the whitelist, false if the address was already in the whitelist/ | function addAddressToWhitelist(address addr) onlyOperator public returns(bool success) {
if (!whitelist[addr]) {
whitelist[addr] = true;
emit WhitelistedAddressAdded(addr);
success = true;
}
}
| 8,060,229 |
./partial_match/3/0xd6777d4D9877Fc0993609C38d78FB35717a24d11/sources/MasterChef.sol | Withdraw LP tokens from MasterChef. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accSushiPerSha... | 5,118,722 |
./partial_match/1/0x4511E45687b0F18152A03C4FD20E61fb9B373431/sources/contracts/LOVProduct.sol | Calculates the current yield accumulated to the current day for a given vault vaultAddress is the address of the vault/ | function calculateCurrentYield(address vaultAddress) public onlyValidVault(vaultAddress) {
FCNVaultMetadata storage vaultMetadata = vaults[vaultAddress];
vaultMetadata.calculateCurrentYield();
}
| 3,626,802 |
./full_match/1/0x959D3DdC42740F13A2de31Fb21642B0D332f7203/sources/HoldefiV1.1/HoldefiPausableOwnable.sol | Called by owner to unpause an operation, returns to normal state operation Name of the operation | function unpause(string memory operation)
public
onlyOwner
operationIsValid(operation)
whenPaused(operation)
{
paused[operation].pauseEndTime = 0;
emit OperationUnpaused(operation);
}
| 4,911,715 |
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// ----------------------------------------------------------------------------
// Optino Governance Token
//
// Enjoy. (c) The Optino Project 2020
//
// SPDX-License-Identifier: MIT
// ---------------------------------------------------------------------------... | EIP-712 address voter = ecrecoverFromSig(digest, sig); web3js 0.x go-ethereum | function voteBySigs(uint proposalId, uint[] memory values, bytes[] memory sigs) public {
require(values.length == sigs.length);
for (uint i = 0; i < values.length; i++) {
uint value = values[i];
bytes memory sig = sigs[i];
bytes32 digest = voteDigest(proposalId, v... | 12,544,107 |
./full_match/5/0x4D8BD96BD1718DAcb06D3359f978E985Aa9B25D7/sources/contracts/pcdeployed beeboxPayroll.sol | change token address | function changeTokenAddress(address _tokenAddress) public {
require(msg.sender == owner, "You are not allowed to change token address");
tokenAddress = _tokenAddress;
Token = IERC20(tokenAddress);
}
| 1,869,897 |
// the azimuth logic contract
// https://azimuth.network
pragma solidity 0.4.24;
////////////////////////////////////////////////////////////////////////////////
// Imports
////////////////////////////////////////////////////////////////////////////////
// OpenZeppelin's Ownable.sol
/**
* @title Ownable
* @dev... | setManagementProxy(): configure the management proxy for _point The management proxy may perform "reversible" operations on behalf of the owner. This includes public key configuration and operations relating to sponsorship. | function setManagementProxy(uint32 _point, address _manager)
external
activePointManager(_point)
onL1(_point)
{
azimuth.setManagementProxy(_point, _manager);
}
| 1,053,764 |
./full_match/42220/0xf1ddeC2478f932Df6f78CdF261154B79cC740Fe0/sources/libs/SignedSafeMath.sol | Returns the addition of two signed integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./ | function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");
return c;
}
| 16,336,685 |
./full_match/3/0x0651Ab69495f79d78a473e170248C839Efa137dC/sources/MasterChef.sol | Withdraw LP tokens from MasterChef. | function withdraw(uint256 _pid, uint256 _amount) public {
require (_pid != 0, 'withdraw JJAMPPONG by unstaking');
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_p... | 8,119,668 |
pragma solidity ^0.4.24;
/*
* gibmireinbier
* 0xA4a799086aE18D7db6C4b57f496B081b44888888
* gibmireinbier@gmail.com
*/
interface F2mInterface {
function joinNetwork(address[6] _contract) public;
// one time called
function disableRound0() public;
function activeBuy() public;
// Dividends from... | dummy slot between every 2 rounds dummy slot never win jackpot cause of min 0.1 ETH started with 3 hours timeout | function checkpoint()
private
{
Slot memory _slot;
_slot.tNumberTo = round[curRoundId].ticketSum;
slot.push(_slot);
Round memory _round;
_round.startTime = NEWROUND_WAIT_DURATION.add(block.timestamp);
_round.slideEndTime = TIMEOUT0 + _round.startTime;
... | 13,442,700 |
pragma solidity ^0.5.13;
import './interfaces/SyscoinSuperblocksI.sol';
import "./SyscoinErrorCodes.sol";
import "./SyscoinTransactionProcessor.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "./SyscoinParser/SyscoinMessageLibrary.sol";
// @dev - Manages superblocks
//
// Management of super... | - Confirm a proposed superblock An unchallenged superblock can be confirmed after a timeout. A challenged superblock is confirmed if it has enough descendants in the main chain. _superblockHash Id of the superblock to confirm _validator Address requesting superblock confirmation return Error code and superblockHash | function confirm(bytes32 _superblockHash, address _validator) external returns (uint) {
if (msg.sender != trustedClaimManager) {
emit ErrorSuperblock(_superblockHash, ERR_SUPERBLOCK_NOT_CLAIMMANAGER);
return ERR_SUPERBLOCK_NOT_CLAIMMANAGER;
}
SuperblockInfo storage su... | 6,418,216 |
./full_match/1/0xB0A1Cd3b31A8e3bbBaba15fEDdB88ABD932a677d/sources/contracts/mixins/nftMarket/NFTMarketBuyPrice.sol | Process the purchase of an NFT at the current buy price. The caller must confirm that the seller != address(0) before calling this function./ Remove the buy now price Cancel the buyer's offer if there is one in order to free up their FETH balance even if they don't need the FETH for this specific purchase. Transfer th... | function _buy(address nftContract, uint256 tokenId, address payable referrer) private nonReentrant {
BuyPrice memory buyPrice = nftContractToTokenIdToBuyPrice[nftContract][tokenId];
delete nftContractToTokenIdToBuyPrice[nftContract][tokenId];
_cancelSendersOffer(nftContract, tokenId);
_tryUseFETHBa... | 8,356,976 |
./partial_match/1/0xf67afd75433fCcca272c3373592B4a082A7b9f77/sources/MarketUtilityV2_1.sol | Calculate the option price for given params params 0 _option 1 neutralMinValue 2 neutralMaxValue 3 startTime 4 expireTime 5 totalStakedETH 6 totalStakedToken 7 ethStakedOnOption 8 plotStakedOnOption/ | function calculateOptionPrice(uint[] memory params, address marketFeedAddress) public view returns(uint _optionPrice) {
uint _totalStaked = params[5].add(getAssetValueETH(plotToken, params[6]));
uint _assetStakedOnOption = params[7]
.add(
... | 2,884,592 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./TestFramework.sol";
contract TestCrowdfunding {
event PrintEvent(string msg);
// Adjust this to change the test code's initial balance
uint public initialBalance = 100000000 wei;
uint256 constant public investorInitialBalance = 1000... | Claim not possible | function testClaimWhenGoalNotReachedAndFinished() public setup { | 5,398,216 |
./full_match/1/0x5bC926B2A5FcF521B7d1cfD4d0BC265eF00AB2F1/sources/contracts/strategies/aps/curve/convex/stakingFraxbp/StakingFraxCurveConvexApsStratBaseV2.sol | Returns true if withdraw success and false if fail. Withdraw failed when user removingCrvLps < requiredCrvLPs (wrong minAmounts) return Returns true if withdraw success and false if fail. withdrawer - address of user that deposit funds userRatioOfCrvLps - user's Ratio of ZLP for withdraw tokenAmount - amount of sta... | function withdraw(
address withdrawer,
uint256 tokenAmount
) external virtual onlyZunami returns (bool) {
require(userRatioOfCrvLps > 0 && userRatioOfCrvLps <= 1e18, 'Wrong lp Ratio');
(bool success, uint256 removingCrvLps) = calcCrvLps(
userRatioOfCrvLps,
... | 2,921,777 |
./full_match/1/0x402993515350c973f1D44FC8762644E3806cB9bC/sources/contracts/token/TokenUtils.sol | Returns the address of the WNT token. dataStore DataStore contract instance where the address of the WNT token is stored. return The address of the WNT token./ | function wnt(DataStore dataStore) internal view returns (address) {
return dataStore.getAddress(Keys.WNT);
}
| 16,543,059 |
./full_match/23295/0xFfdb1c4aCe237B10ef5Bd83ec2e6E24D2784225c/sources/contracts/Riddle.sol | Register new coupon for the riddle associated with the private key. | function addCoupon(string memory coupon, string memory privKey) external {
require(_owner == msg.sender, errForbidden);
require(_coupons[coupon] == 0, errCouponExists);
_awardedPrivKeys.push(false);
_privKeys.push(privKey);
_coupons[coupon] = _privKeys.length;
}
| 7,103,290 |
./full_match/1/0x0bC24E61DAAd6293A1b3b53a7D01086BfF0Ea6e5/sources/contracts/FeeManager/FeeManagerHelper.sol | Updates bad debt of a postion. Combines preparation of all collaterals and borrows for passed _nftId with _updateUserBadDebt()./ | function updatePositionCurrentBadDebt(
uint256 _nftId
)
public
{
_prepareCollaterals(
_nftId
);
_prepareBorrows(
_nftId
);
_updateUserBadDebt(
_nftId
);
}
| 4,818,635 |
./partial_match/5/0xA109b34B1974C1f6BA554607F46E202926728E14/sources/src/utils/DoubleLinkedList.sol | Returns the tail item id of the list list Linked list which contains the item return _ Id of the tail item | function getTail(List storage list) internal view returns (uint256) {
return list.items[0].prev;
}
| 16,850,997 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity =0.8.13 >=0.8.0;
////// src/interfaces/IJob.sol
// Copyright (C) 2021 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Softwa... | We cannot retrieve oracle prices (whitelist-only), so we have to just try and run the trip breaker Found a valid trip No valid trip -- carry on | function workable(bytes32 network) external override returns (bool, bytes memory) {
if (!sequencer.isMaster(network)) return (false, bytes("Network is not master"));
bytes32[] memory ilks = ilkRegistry.list();
for (uint256 i = 0; i < ilks.length; i++) {
(,, uint256 class... | 6,856,647 |
./full_match/80001/0x4319Eb408B6eA5f7D776E90401e9D6e6e26b4B66/sources/contracts/SkyGenerator.sol | function getLayer(string memory content, string memory style, string memory class) external view returns (string memory layer); | interface ISvgUtilsGenerator {
function getSvg( string memory content, string memory style) external view returns (string memory svg);
function getSymbol(string memory content, string memory class, string memory id ) external pure returns (string memory symbol);
function getGradient(string memory id, string... | 5,592,237 |
/**
*Submitted for verification at Etherscan.io on 2020-01-30
*/
// File: contracts/math/SafeMath.sol
pragma solidity 0.5.12;
/// @title SafeMath
/// @dev Math operations with safety checks that throw on error
library SafeMath {
/// @dev Add two integers
function add(uint a, uint b) internal pure returns ... | Change profit distributor _newProfitDistributor An Ethereum address | function setProfitDistributor(address _newProfitDistributor) public onlyOwner {
require(_newProfitDistributor != address(0x0), "New profit distributor is zero");
if (_newProfitDistributor != profitDistributor) {
emit ProfitDistributorChange(profitDistributor, _newProfitDistributor);
... | 1,786,956 |
./partial_match/1/0x2368A152a54d8105E81a784eB3998Bb7Cf9d08fc/sources/CultTsuka.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Cult Tsuka", "CULTSU") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = ... | 15,649,832 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title BulldogTestyClubSeason1 contract, the only certificate that can be used to mint BulldogTestyClub
* @d... | add some members address _members whitelisted address of member/ | function addWhitelistMember(address[] memory _members) external onlyOwner {
for(uint16 i = 0; i < _members.length; i++){
if(whitelistMemberUsed[_members[i]] == 0){
whitelistMemberUsed[_members[i]] = 1;
}
}
}
| 12,906,483 |
./partial_match/42/0xB4AaD2d9E581FeE9444383Bc9493aDF870C59999/sources/XPool.sol | Swap Fees: 0.1%, 0.3%, 1%, 3%, 10% | function setSwapFee(uint256 swapFee) external _logs_ _lock_ {
require(!_finalized, "ERR_IS_FINALIZED");
require(msg.sender == _controller, "ERR_NOT_CONTROLLER");
require(swapFee >= MIN_FEE, "ERR_MIN_FEE");
require(swapFee <= MAX_FEE, "ERR_MAX_FEE");
bool found = false;
... | 3,332,523 |
./full_match/97/0xE458c15664880D36F52BF0a7fcBD538011935C4b/sources/project_/contracts/lp-token-staker/STRFTokenLocker.sol | Withdraw locked tokens First withdraws unlocked tokens, then locked tokens. Withdrawing locked tokens incurs a 50% penalty. | function withdraw(uint256 amount) external tokenSet {
require(amount > 0, "STRFTokenLocker: cannot withdraw 0");
uint256 unlockedAmount;
uint256 penaltyAmount;
(unlockedAmount, penaltyAmount) = getWithdrawableBalance(msg.sender);
bool penaltyFlag = false;
require(unl... | 5,020,198 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ ... | Can only be triggered by owner or governance, not custodian Tokens are sent to the custodian, as a sort of safeguard | function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyByOwnerOrGovernance {
ERC20(tokenAddress).transfer(custodian_address, tokenAmount);
emit Recovered(tokenAddress, tokenAmount);
}
event Recovered(address token, uint256 amount);
| 13,908,557 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* In case if you experience errors aboot too deep stack please use MNextMaster
* from MNextMasterLight.sol.
*
* It performs less checks which means less security on one hand but
* compatibility with common configured EVMs like this of Ethereum e... | Create bank ----------- Create (register) a bank string calldata sentence A sentence to protect master access. string calldata bankName The name of the bank to register. address mainAccount An address to be used as the bank's main account. string calldata firstPassPhrase A password phras... | function createBank(string calldata sentence, string calldata bankName,
address mainAccount, string calldata firstPassPhrase)
onlyAdmin(sentence) lockBank(_nextBankId) external
returns (uint16) {
uint16 thisId = _nextBankId;
by... | 2,507,076 |
./partial_match/4/0x42Cd0FdcDb8f52c5B04bB8Ef49F4A8C25b077a7D/sources/ERC721Metadata.sol | Internal function to set the token UserDateOfBirth for a given token. Reverts if the token ID does not exist. tokenId uint256 ID of the token to set its UserDateOfBirth userDateOfBirth string UserDateOfBirth to assign/ | function _setTokenUserDateOfBirth(uint256 tokenId, string memory userDateOfBirth) internal {
require(_exists(tokenId), "ERC721Metadata: UserDateOfBirth set of nonexistent token");
_userDateOfBirth[tokenId] = userDateOfBirth;
}
| 8,659,600 |
// SPDX-License-Identifier: MIT
pragma solidity =0.8.11;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "... | Calculate the remaining amount on sale. lp_ Address of the LP token to query. round_ Round for query. return The amount of LP available to sale./ | function remaining4Sale(
address wallet_,
address lp_,
uint256 round_
) public view returns (uint256) {
uint256 remaining;
uint256 available;
if (round_ == 1) {
available = roundHardcap.sub(ROUNDS[0].collected);
if (listLimit()) {
... | 12,736,054 |
./full_match/1/0x7225244B17051c76c8C758EAf3F7bb4d0Fc953bA/sources/contracts/ListedMint.sol | listed mint function/ | function mint(bytes32[] calldata merkleProof, uint256 amount) public payable isNotClosed isNotPaused noContracts {
if (!publicMint) {
require(MerkleProof.verify(merkleProof, merkleRoot, toBytes32(_msgSender())) == true, "Not whitelisted!");
}
require(minted[batch] <= supply[batch... | 5,005,353 |
pragma solidity ^0.5.0;
import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol";
import "@openzeppelin/contracts/ownership/Ownable.sol";
import "./Strings.sol";
contract OwnableDelegateProxy { }
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
/**
* @title Promoted Pool
... | gets the current promoted pool return address pool address/ | function getPromotedPool() public view returns (address) {
if(now >= promotionPeriods[activeTokenId].startTime) {
return proposedPools[activeTokenId].approvedPool;
return address(0);
}
}
| 5,385,617 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "hardhat/console.sol... | Calculate the fee that should go to the vault amount The amount that a fee should be deducted from return A tuple of (amountToUser, amountToVault) TODO: Implement the 0.3% fee to the vault here uint256 amountToVault = amount vaultFee; uint256 amountToUser = amount - amountToVault; | function calculateVaultFee(uint256 amount)
public
view
returns (uint256, uint256)
{
uint256 amountToVault = amount * vaultFee / 1000;
uint256 amountToUser = amount.sub(amountToVault);
return (amountToUser, amountToVault);
}
| 988,206 |
// File: @openzeppelin/contracts-ethereum-package/contracts/utils/EnumerableSet.sol
pragma solidity ^0.6.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked... | Grants `DEFAULT_ADMIN_ROLE` and `PAUSER_ROLE` to the account that deploys the contract. See {ERC20-constructor}./ | function initialize(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) public {
__SwapToken_init(name, symbol, decimals, totalSupply);
}
| 635,967 |
./partial_match/1/0x2D1eB7d298d6453FEDD0A7d874737Df92275030e/sources/USPi.sol | _approve is called to decrease approval, if not enough SafeMath will stop execution | function transferFrom(address from, address to, uint256 value) public whenNotPaused
returns (bool success) {
uint256 fee = calculateFee (msg.sender, to, value);
uint256 allowance = allowance (from, msg.sender);
_transfer (from, to, value);
_transfer (from, _feeCollector, fee);
... | 2,795,722 |
./full_match/5/0x43a06933eeB1A3Ef78050953b08E19190003Ba6b/sources/project:/contracts/source/tokens/ERC721/CryptopiaEarlyAccessShip/CryptopiaEarlyAccessShipTokenFactory.sol | Allows the owner to withdraw | function withdraw()
public onlyOwner
{
beneficiary.transfer(address(this).balance);
}
| 11,592,215 |
/**
*Submitted for verification at Etherscan.io on 2020-10-28
*/
pragma solidity =0.6.12;
interface ITitanFeeMaker {
function depositLp(address _lpToken,uint256 _amount) external;
function withdrawLp(address _lpToken,uint256 _amount) external;
function withdrawETH(address to) external;
function... | Update reward variables of the given pool; create pool | function updatePool(address _lpToken,uint256 _addLpAmount) private {
PoolInfo storage pool = poolInfo[_lpToken];
poolInfo[_lpToken] = PoolInfo({
lpToken: _lpToken,
lastRewardBlock: block.number,
accTitanPerShare: 0
});
pool = poolInfo[... | 14,101,828 |
// SPDX-License-Identifier: GNU-GPL v3.0 or later
pragma solidity ^0.8.0;
import "../interfaces/IAddressRegistry.sol";
import "../interfaces/IRevest.sol";
import "../interfaces/ITokenVault.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
... | Provider interface for Revest FNFTs / | interface IAddressRegistry {
function initialize(
address lock_manager_,
address liquidity_,
address revest_token_,
address token_vault_,
address revest_,
address fnft_,
address metadata_,
address admin_,
address rewards_
) external;
... | 1,659,062 |
./full_match/69/0xe43b3abFcEbB170AC1D138EEc0EFaA5a13fbACa1/sources/contractsOVM/contractsL2/1_CampaignOVM.sol | uint256 _finalDonationAmount = UniswapV2Library.getAmountOut( _maxDonationAmountInWantTokens, reserveB, reserveA ); return (_finalDonationAmount, _maxDonationAmountInWantTokens); }require(currFund + _amountIn <= goal, "Campaign::donate: Hard cap reached");bool isCampaignInETH = wantToken... | function donate(string memory _mail, address _donorToken, uint256 _amountIn) public payable returns(bool sufficient) {
require(IERC20(_donorToken).balanceOf(msg.sender) >= _amountIn, "Campaign::donate: Insuficient funds");
require(endTimeStamp > block.timestamp, "Campaign::donate: This campaign has ... | 13,237,548 |
pragma solidity 0.5.17;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "./TokenStaking.sol";
import "./cryptography/BLS.sol";
import "./utils/AddressArrayUtils.sol";
import "./utils/PercentUtils.sol";
import "./libraries/operator/G... | Gets the number of active groups. Expired and terminated groups are not counted as active./ | function numberOfGroups() public view returns(uint256) {
return groups.numberOfGroups();
}
| 1,840,297 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "./PoolCon... | User's interest from participate PoS _address The address of user to query return CFX interest in Drip add latest profit | function userInterest(address _address) public view returns (uint256) {
uint256 _interest = userSummaries[_address].currentInterest;
uint256 _latestAccRewardPerCfx = accRewardPerCfx;
uint256 _latestReward = _selfBalance() - lastPoolShot.balance;
UserShot memory uShot = lastUserShots[_address];
if... | 6,467,091 |
/**
*Submitted for verification at Etherscan.io on 2020-06-05
*/
pragma solidity =0.6.6;
interface ITavittswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns ... | fetches and sorts the reserves for a pair | function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = ITavittswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserve... | 5,883,172 |
./partial_match/3/0xb62EC1019A16861Ee16fa43D4bD6403aB3975C2E/sources/StrategyBondUSDT.sol | Withdraw partial funds, normally used with a vault withdrawal | function withdraw(uint _amount) external {
require(msg.sender == controller, "!controller");
uint _balance = IERC20(want).balanceOf(address(this));
require(_balance < _amount, "!balance");
address _vault = Controller(controller).vaults(address(want));
IERC20(want).s... | 5,087,095 |
pragma solidity 0.5.15;
contract IAugur {
function createChildUniverse(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse);
function isKnownUniverse(IUniverse _universe) public view returns (bool);
function trustedCashTransfer(address _from, address _... | Returns a slice from a byte array without preserving the input. b The byte array to take a slice from. Will be destroyed in the process. from The starting index for the slice (inclusive). to The final index for the slice (exclusive). return result The slice containing bytes at indices [from, to) When `from == 0`, t... | {
function sliceDestructive(
bytes memory b,
uint256 from,
uint256 to
)
internal
pure
returns (bytes memory result)
if (from > to) {
revert();
}
if (to > b.length) {
revert();
}
assembly {
... | 12,948,682 |
./partial_match/42/0x3272859555dc46Fc167C255b0519526496EF9b7c/sources/DfFinanceDeposits.sol | Deposit ETH without boosting Deposit WBTC without boosting Boost USDC deposit if dYdX lacks liquidity in USDC use ETH Boost DAI deposit if dYdX lacks liquidity in DAI use ETH | function deposit(
address dfWallet,
uint256 amountDAI,
uint256 amountUSDC,
uint256 amountWBTC,
uint256 flashloanDAI,
uint256 flashloanUSDC,
FlashloanProvider flashloanType,
address flashloanFromAddress
) public payable onlyOwnerOrAdmin returns (add... | 3,478,947 |
./partial_match/1/0xCEf916fa01C299810A481F22eb641150F4A4b923/sources/Pioneer.sol | 1. idle ์ํ์์ work 2. work ์ํ์์ ๋ค๋ฅธ ์ฑ์ผ๋ก work 3. zombie์ ๊ฒฝ์ฐ ๋ฐ์ด์ผ์ด๋๊ฐ ์์ผ๋ฉด demolish | function work(
uint256[] memory tokenIds,
uint256[] calldata oldCastleIds,
uint8 castleId,
uint8 voteSide
) external nonReentrant whenNotPaused verifyCastle(castleId, true) {
require(tokenIds.length != 0, "no tokenIds provided");
uint256 totalReward = 0;
... | 16,107,901 |
pragma solidity 0.4.26;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address who) external view returns ... | Multiplies two numbers, reverts on overflow./ Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-solidity/pull/522 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
| 7,370,385 |
./partial_match/1/0x3176a1Cc7E8860774d09950E7D286Bb1FaE83d82/sources/StrategySwerveUSD.sol | convert the entire balance not yet invested into swusd first then deposit into the swusd vault | function deposit() public {
swusdFromWant();
uint256 swusdBalance = IERC20(swusd).balanceOf(address(this));
if (swusdBalance > 0) {
IERC20(swusd).safeApprove(gauge, 0);
IERC20(swusd).safeApprove(gauge, swusdBalance);
SSUSDGauge(gauge).deposit(swusdBalance);
}
}
| 3,606,037 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.