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/4/0x5Fa046d6f146d49DB2855C571F8D8610BDE96091/sources/contracts/ERC721A.sol | See {IERC721Enumerable-totalSupply}./ Counter underflow is impossible as _burnCounter cannot be incremented more than _currentIndex times | function totalSupply() public view override returns (uint256) {
unchecked {
return _currentIndex - _burnCounter;
}
}
| 12,346,920 |
/**
*Submitted for verification at Etherscan.io on 2019-12-12
*/
pragma solidity ^0.5.0;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requi... | If lockupinfo was deleted, loop restart at same position. | function _autoUnlock(address holder) internal returns(bool) {
for(uint256 idx =0; idx < timelockList[holder].length ; idx++ ) {
if (timelockList[holder][idx]._releaseTime <= now) {
if( _unlock(holder, idx) ) {
idx -=1;
}
}
}... | 1,366,603 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidit... | inject NONSTANDARD NAMING | function GETPOOLINFO427(address pool) external view returns (POOL_STATE state, uint256 weight); | 1,840,733 |
./full_match/40/0x523073f029C889242beBFbB7eE3BDaB52942a39A/sources/contracts/FeeCollector.sol | returns the last time the reward was modified or periodFinish if the reward has ended | function lastTimeRewardApplicable(address token) public view returns (uint)
{
return Math.min(block.timestamp, periodFinish[token]);
}
| 9,544,752 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
//
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amou... | Mints new pool token. _account The account address used to mint. _amounts Unconverted token balances used to mint pool token. _minMintAmount Minimum amount of pool token to mint./ We don't perform input validations here as they are done in ACoconutSwap. | function mintToken(address _account, uint256[] calldata _amounts, uint256 _minMintAmount) external validAccount(_account) {
Account account = Account(payable(_account));
ACoconutSwap _swap = swap;
for (uint256 i = 0; i < _amounts.length; i++) {
if (_amounts[i] == 0) continue;
... | 7,662,568 |
./full_match/1/0x70F2C0330528000BA806aE8F4254B45Ea980a34c/sources/contracts/core/RenovaCommandDeckBase.sol | Base class initializer function. _renovaAvatar The address of the Avatar contract. _renovaItem The address of the Item contract. _hashflowRouter The address of the Hashflow Router. | function __RenovaCommandDeckBase_init(
address _renovaAvatar,
address _renovaItem,
address _hashflowRouter,
address _questOwner
) internal onlyInitializing {
__Ownable_init();
require(
_renovaAvatar != address(0),
'RenovaCommandDeckBase::_... | 2,914,095 |
./full_match/1/0xaa282C8aB681fbD501A2B8fA0Ea558cbF5785F73/sources/contracts/AvocadoMultisig/AvocadoMultisigCore.sol | action ran out of gas. can not add action index as that again might run out of gas. keep revert minimal | function _handleActionFailure(uint256 actionMinGasLeft_, uint256 i, bytes memory result_) internal view {
if (gasleft() < actionMinGasLeft_) {
revert("AVO__OUT_OF_GAS");
}
revert(string.concat(Strings.toString(i), _getRevertReasonFromReturnedData(result_)));
}
| 3,129,018 |
pragma solidity ^0.4.23;
import "../libraries/StateMachine.sol";
import "../pandora/IPandora.sol";
import "../jobs/IComputingJob.sol";
import "./IWorkerNode.sol";
/**
* @title Worker Node Smart Contract
* @author "Dr Maxim Orlovsky" <orlovsky@pandora.foundation>
*
* @dev # Worker Node Smart Contract
*
* Worker ... | No arguments @fixme onlyOwner / | function declineAssignment(
requireState(Assigned)
transitionToState(Idle)
{
require(activeJob != IComputingJob(0));
activeJob.gatheringWorkersResponse(false);
}
| 14,102,302 |
./full_match/56/0xD803719B1a6Aac1dcB2c815d987f0CB5E8f4cCAf/sources/happy.sol | solhint-disable-next-line func-name-mixedcase | interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns(uint256);
function DOMAIN_SEPARATOR() external... | 3,238,523 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import '@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol';
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
impo... | transferOwnership(0x86a8A293fB94048189F76552eba5EC47bc272223); | function initialize(string memory _uri, address payable _qtWallet, address __signer) initializer public {
__ERC721_init('CREW Coin', 'CREW');
__Ownable_init();
__UUPSUpgradeable_init();
qtWallet = _qtWallet;
_signer = __signer;
baseURI = _uri;
_symbol = 'CREW';
_nam... | 6,251,850 |
./partial_match/56/0xA80a8d99b1d96fdBdb9cbFA0a96a288D66265B4C/sources/ThePoolLP3.sol | stakeFor visibility is public as overriding LPTokenWrapper's stakeFor() function | function stakeFor(address staker,uint256 amount) public override updateReward(staker) {
require(msg.sender==devFund,"Unauthorized account.");
require(amount > 0, "Cannot stake 0");
super.stakeFor(staker,amount);
emit Staked(staker);
}
| 11,096,988 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
contract EncryptedSender {
struct TopicData {
// An (optional) public key used to encrypt messages for this topic. This is only necessary if the sender will
// not have access to the public key offchain.
bytes publicKey;
//... | Internal method to initialize a shared role, `roleId`, which will be managed by `managingRoleId`. `initialMembers` will be immediately added to the role. Should be called by derived contracts, usually at construction time. Will revert if the role is already initialized./ | function _createSharedRole(uint roleId, uint managingRoleId, address[] memory initialMembers)
internal
onlyInvalidRole(roleId)
{
Role storage role = roles[roleId];
role.roleType = RoleType.Shared;
role.managingRole = managingRoleId;
role.sharedRoleMembership.init(... | 1,827,066 |
./partial_match/1/0x43434343d4869d9B340e1B00feC1e6924aD08E43/sources/StringToken.sol | Returns if the seed is free/ | function isSeedFree(uint256 seed) public view returns (bool) {
return (_seedUsed[seed] == false);
}
| 15,603,290 |
pragma solidity ^0.4.21;
// SecureWallet - A smart contract that handles sent tokens and ether with
// owner access control with optional one-time key rotation
// that locks contract functionality.
// ERC20 interface
contract ERC20Token {
function totalSupply() public constant returns (uint);
function balan... | unregisterToken - unregister a token assigned to the contract _tokenId index of registered token address | function unregisterToken(uint _tokenId) public onlyOwner {
emit UnregisterToken(tokens[_tokenId]);
delete tokens[_tokenId];
}
| 5,531,532 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/***************************************************************************************... | Credits payouts to insurees/ | function creditInsurees
(
string flight,
uint256 timestamp,
address airline
)
external
... | 1,842,618 |
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value... | transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ | function transfer(address _to, uint256 _value) public returns (bool) {
if (msg.sender != owner && msg.sender != addressTeam){
require(!frozenAccountICO);
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _v... | 1,574,649 |
./partial_match/1/0xF406F7A9046793267bc276908778B29563323996/sources/VisionToken.sol | Confirms the transfer of `_quantityToInvest` currency to the contract. currency is ETH Math: if _msgValue was not sufficient then revert currency is ERC20 | function _collectInvestment(
address payable _from,
uint _quantityToInvest,
uint _msgValue,
bool _refundRemainder
) internal
{
if(address(currency) == address(0))
{
if(_refundRemainder)
{
uint refund = _msgValue.sub(_quantityToInvest);
if(refund > 0)
{
... | 3,562,307 |
./partial_match/3/0x79d196D0a03955704aD722DCfcDa32b26C03cEDD/sources/zzz.sol | require(lgeEndTime.add(3 days) < now, "Liquidity generation grace period still ongoing");require(LPGenerationCompleted, "Event not over yet"); | function emergencyRecoveryAllTokens() public onlyOwner {
require(tokenAddress != address(0), "ERC20: can not zero address");
require(tokenUniswapPair != address(0), "ERC20: can not zero address");
uint256 tokenBalance = IERC20(tokenAddress).balanceOf(address(this));
LPGenerationCompl... | 5,059,311 |
pragma solidity ^0.6.0;
// import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "../contracts/SmartRentalToken.sol";
//import "../contracts/OwnershipExtension.sol";
import "../contracts/ExtensionInfo.sol";
contra... | (bool a, bytes memory _len) = currentExtension.call("getnumExtensions()");uint len = bytesToUint(_len);call(abi.encodeWithSignature("getExtensionIndex(uint)", i)); _contract.delegatecall( abi.encodeWithSignature(ExtendedFunctions[i]._extensionSignature, _sign) ); | function check_preconditions() public returns (bool) {
for (uint j = 0; j < extensionsNames.length; j++){
OwnershipExtension currentExtension = extensions[extensionsNames[j]];
uint len = currentExtension.getnumExtensions();
(string memory _a, bool precond, string memo... | 1,783,899 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarvest;
uint256 maxDebtPerHarvest;
uint256 lastReport;
uint... | DyDx calls this function after doing flash loanif in deficit we repay amount and then withdrawif we are withdrawing we take more to cover feereverts on a non zero returnborrow more to cover fee fee is so low for dydx that it does not effect our liquidation risk. | function callFunction(
address sender,
Account.Info memory account,
bytes memory data
) public override {
(bool deficit, uint256 amount) = abi.decode(data, (bool, uint256));
require(msg.sender == SOLO);
require(sender == address(this));
uint256 repayAmount... | 6,921,425 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.10;
import "./libraries/Oracle.sol";
import "./libraries/Volatility.sol";
import "./interfaces/IVolatilityOracle.sol";
/*
#
##... | metadata The pool's metadata (may be cached) data A summary of the pool's state from `pool.slot0` `pool.observe` and `pool.liquidity` a The pool's cumulative feeGrowthGlobals some time in the past b The pool's cumulative feeGrowthGlobals as of the current block return An estimate of the 24 hour implied volatility sc... | function estimate24H(
PoolMetadata memory metadata,
PoolData memory data,
FeeGrowthGlobals memory a,
FeeGrowthGlobals memory b
) internal pure returns (uint256) {
uint256 volumeGamma0Gamma1;
{
uint128 revenue0Gamma1 = computeRevenueGamma(
... | 6,370,009 |
pragma solidity ^0.5.0;
import "./UsingTellor.sol";
/**
* @title Optimistic
* This contracts allows users to use Tellor as a fallback oracle. It allows two parties to centrally
* enter the data used to settle a contract but allows either party to dispute the data. If a dispute is
* initiated their contract will sett... | allows user to initiate dispute on the value of the specified timestamp _timestamp is the timestamp for the value to be disputed/require that isValue for the timestamp being disputed to exist/be true assert disputePeriod is still openset the disputValues for the disputed timestamp to trueadd the disputed timestamp to ... | function disputeOptimisticValue(uint256 _timestamp) external payable {
require(msg.value >= disputeFee, "Value is below dispute fee");
require(isValue[_timestamp], "Value for the timestamp being disputed doesn't exist");
require(now - (now % granularity) <= _timestamp + disputePeriod, "Dispu... | 12,965,495 |
// SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.5;
pragma experimental ABIEncoderV2;
interface IIntegralReader {
struct Parameters {
int256[] bidExponents;
int256[] bidQs;
int256[] askExponents;
int256[] askQs;
}
... | SPDX-License-Identifier: GPL-3.0-or-later Deployed with donations via Gitcoin GR9 | interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decim... | 345,353 |
./partial_match/1/0x73F6af4495404E3dD076c5C33802532fa394d49E/sources/SHIAInu.sol | set minimum tokens required to swap. | function setSwapTokenThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapExactAmount = swapTokensAtAmount;
}
| 2,620,779 |
./full_match/5/0x0BdAd0BBbC7E5F9DBF212E5e2D567462F20bBfF1/sources/contracts/Doggyv5.sol | unblacklist address; not affected by blacklistRenounced incase team wants to unblacklist v3 pools down the road | function unblacklist(address _addr) public onlyOwner {
blacklisted[_addr] = false;
}
| 1,857,163 |
pragma solidity ^0.4.24;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
... | Gives owner the ability to update lockup period for all wallets. Owner can pass an epoch timecode into the function to: 1. Extend lockup period, 2. Unlock all wallets by passing &39;0&39; into the function | function updateGlobalUnlockTime(uint256 _epoch) public onlyOwnerOrAdmin returns (bool) {
require(_epoch >= 0);
globalUnlockTime = _epoch;
emit UpdateGlobalUnlockTime(_epoch);
}
| 6,655,485 |
/*
* Copyright ConsenSys AG.
*
* 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 writing... | move last address into index being vacated (unless we are dealing with last index) | function removeInternal(bytes32 _participant) internal returns (bool) {
uint256 index = distributionIndexOf[_participant];
if (index > 0 && index <= distributionList.length) {
if (index != distributionList.length) {
bytes32 lastPublicKey = distributionList[distributionLis... | 12,557,939 |
./partial_match/97/0x1a8B7C95aA9766ACad44ed667CBB6A5F4aB683B2/sources/MasterChefV2.sol | Add a new lp to the pool. Can only be called by the owner. | function add(uint256 _allocPoint, IBEP20 _lpToken, uint16 _depositFeeBP, bool _withUpdate) public onlyOwner nonDuplicated(_lpToken) {
require(_depositFeeBP <= 10000, "add: invalid deposit fee basis points");
if (_withUpdate) {
massUpdatePools();
}
uint256 lastRewardBlock ... | 17,204,411 |
pragma solidity ^0.5.16;
import "./CCapableErc20Delegate.sol";
import "./EIP20Interface.sol";
/**
* @notice Compound's Comptroller interface to get Comp address
*/
interface IComptroller {
function getCompAddress() external view returns (address);
function claimComp(address[] calldata holders, CToken[] call... | Transfer the underlying from this contract to Address to transfer funds to amount Amount of underlying to transfer/ | function doTransferOut(address payable to, uint amount) internal {
harvestComp();
updateSupplyIndex();
updateSupplierIndex(to);
super.doTransferOut(to, amount);
}
| 10,063,891 |
pragma solidity ^0.6.0;
import "../utils/GasBurner.sol";
import "../interfaces/IAToken.sol";
import "../interfaces/ILendingPool.sol";
import "../interfaces/ILendingPoolAddressesProvider.sol";
import "../utils/SafeERC20.sol";
/// @title Basic compound interactions through the DSProxy
contract AaveBasicProxy is GasBur... | Buys a _destAmount of tokens at Kyber _srcAddr From token _destAddr To token _destAmount To amount return uint srcAmount | function buy(address _srcAddr, address _destAddr, uint _destAmount, bytes memory _additionalData) external override payable returns(uint) {
ERC20 srcToken = ERC20(_srcAddr);
ERC20 destToken = ERC20(_destAddr);
address walletAddr = feeRecipient.getFeeAddr();
uint srcAmount = 0;
... | 380,859 |
./partial_match/1/0x3355fE877a869Dd98454B4C4a5dDE24C881a4E26/sources/JETTON.sol | Maximum tx size and wallet size exclude from paying fees or having max transaction amount | constructor() ERC20("JetTon Games", "JETTON") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pa... | 15,751,013 |
./full_match/1/0x37ff4bc9a425F37d3Af95662c9D88A88d05f3417/sources/browser/TokensTypeStorage.sol | allow add new token type from trade portals Don't flag this token if this token alredy registred convert string to bytes32 flag new token Add new type | function addNewTokenType(address _token, string calldata _type) external onlyPermitted {
if(isRegistred[_token])
return;
bytes32 typeToBytes = stringToBytes32(_type);
getType[_token] = typeToBytes;
isRegistred[_token] = true;
if(!isTypeRegistred[typeToBytes]){
isTypeRegistred[typeTo... | 4,951,271 |
pragma solidity ^0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high ... | Facilitates a trade of the funds holdings via the exchange portal _source ERC20 token to convert from _sourceAmount Amount to convert (in _source token) _destination ERC20 token to convert to _type The type of exchange to trade with _proof Merkle tree proof (if not us... | function trade(
IERC20 _source,
uint256 _sourceAmount,
IERC20 _destination,
uint256 _type,
bytes32[] calldata _proof,
uint256[] calldata _positions,
bytes calldata _additionalData,
uint256 _minReturn
)
external
onlyOwner
{
verifyTradeBetweenDW();
require(_minReturn >... | 1,432,713 |
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d9fa59f30a27f095c48b09555106fed0200654e0/contracts/utils/Strings.sol
pragma solidity ^0.6.0;
/**
* @dev String operations.
*/
library Strings {
/**
* @dev Converts a `uint256` to its ASCII `string` representation.
*/
function ... | Function to set the primary sale fee percentage. _percentage uint256 fee to take from purchases./ | function setPrimarySaleFee(uint256 _percentage)
public onlyOwner
{
primarySaleFee = _percentage;
}
| 1,020,066 |
// Sources flattened with hardhat v2.6.8 https://hardhat.org
// SPDX-License-Identifier: MIT
// File @openzeppelin/contracts/math/SafeMath.sol@v3.4.1-solc-0.7-2
pragma solidity ^0.7.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity w... | Atomically decreases the allowance granted to `spender` by the caller./ | function decreaseAllowance(address _spender, uint256 _subtractedValue) public returns (bool) {
uint256 currentAllowance = _allowances[msg.sender][_spender];
require(currentAllowance >= _subtractedValue, "XALD: decreased allowance below zero");
_approve(msg.sender, _spender, currentAllowance.sub(_subtract... | 305,859 |
pragma solidity ^0.6;
import "../../lib/SafeMath.sol";
import {Classifier64} from "./classification/Classifier.sol";
import {DataHandler64} from "./data/DataHandler.sol";
import {IncentiveMechanism64} from "./incentive/IncentiveMechanism.sol";
/**
* The main interface to sharing updatable models on the blockchain.
... | Report bad or old data and attempt to get a reward. data The data to report. classification The label originally submitted with `data`. addedTime The time when the data was added. originalAuthor The address that originally added the data./ determine the reward amount update the claimable amount after this reward (t... | function report(
int64[] memory data,
uint64 classification,
uint256 addedTime,
address originalAuthor
) public {
initialDeposit: The amount that was initially deposited when the data contribution was submitted.
claimableAmount: The amount remainining that can be ... | 909,529 |
pragma solidity ^0.5.11;
contract Owned {
// State variable
address payable owner;
// Modifiers
modifier onlyOwner() {
require(msg.sender == owner, "Only owner can call this function.");
_;
}
// constructor
constructor() public {
owner = msg.sender;
}
}
contra... | kill the smart contract | function kill() onlyOwner public {
withdrawFees();
closeAllMoneypot();
selfdestruct(owner);
}
| 5,369,446 |
./partial_match/56/0xd4cC0C9a71Cb716097B753eE45FEB83a758B1fbF/sources/STEAMER.sol | Burn SOAK to get STEAM | function burnSoakForSteam(uint256 _amount) public {
require(steamerEnable, "STEAM: Steamer isn't enabled");
require(_amount > 0, "STEAM: Amount must be over 0");
require(soak.balanceOf(msg.sender) >= _amount, "STEAM: You have not enough SOAK");
soak.safeTransferFrom(address(... | 11,059,097 |
./partial_match/1/0xA34757fC1e8EAD538C4ef2Ef23286517A7a9d0a7/sources/DexnesCaptain.sol | Migrate lp token to another DEXNES lp contract. Can only be called by the owner. Tip: Reuse the contract used by SushiSwap on their successful migration | function migrate(uint256 _pid) public onlyOwner {
require(address(migrator) != address(0), "migrate: no migrator");
PoolInfo storage pool = poolInfo[_pid];
IERC20 lpToken = pool.lpToken;
uint256 bal = lpToken.balanceOf(address(this));
lpToken.safeApprove(address(migrator), ba... | 2,653,275 |
./partial_match/1/0x21B8bfbbefc9E2b9A994871Ecd742A5132B98AeD/sources/CryptoRealEstate.sol | Withdraws the Eth balance from the contract./ | function withdrawEth() external onlyOwner {
uint256 amount = address(this).balance;
address payable to = payable(msg.sender);
to.sendValue(amount);
emit WithdrawedEth(to, amount);
}
| 4,289,844 |
pragma solidity >=0.4.4 <0.7.0;
contract causasBeneficas{
//Declaraciones necesarias
struct Causa{
uint Id;
string name;
uint precio_objetivo;
uint cantidad_recaudada;
}
uint contador_causas = 0;
mapping (string => Causa) causas;
//Permite dar de ... | Esta funcion nos dice si hemos llegado al precio objetivo | function comprobar_causa(string memory _nombre) public view returns(bool, uint) {
bool limite_alcanzado = false;
Causa memory causa = causas[_nombre];
if(causa.cantidad_recaudada >= causa.precio_objetivo){
limite_alcanzado = true;
}
retu... | 5,458,371 |
./partial_match/42/0x4ffADC639B57e864150ff98a55D249fed53fa63B/sources/ZuniBadge.sol | Externally check permissions using the Enum self - Rights struct containing the permissions permission - The permission to check return Boolean true if it has the permission/ | function hasPermission(Rights calldata self, Permissions permission)
external
pure
returns (bool)
{
if (Permissions.PAUSE_SWAPPING == permission) {
return self.canPauseSwapping;
return self.canChangeSwapFee;
return self.canChangeWeights;
... | 3,448,934 |
./full_match/1/0x92Cc4c289cA8821A233A404c58479a0f209cF285/sources/contracts/libraries/LmTick.sol | Updates a tick and returns true if the tick was flipped from initialized to uninitialized, or vice versa self The mapping containing all tick information for initialized ticks tick The tick that will be updated tickCurrent The current tick liquidityDelta A new amount of liquidity to be added (subtracted) when tick ... | function update(
mapping(int24 => LmTick.Info) storage self,
int24 tick,
int24 tickCurrent,
int128 liquidityDelta,
uint256 rewardGrowthGlobalX128,
bool upper,
uint128 maxLiquidity
) internal returns (bool flipped) {
LmTick.Info storage info = self[... | 4,989,625 |
./full_match/80001/0x68B870eC968abB8974398c5B7d43D19317f7C5fD/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.accStopPerShar... | 9,496,388 |
/**
*Submitted for verification at Etherscan.io on 2020-10-22
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
//
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() ext... | Exchange between two underlying tokens. _i Token index to swap in. _j Token index to swap out. _dx Unconverted amount of token _i to swap in. _minDy Minimum token _j to swap out in converted balance./ If swap is paused, only admins can swap. balance[i] = balance[i] + dx precisions[i] dy = (balance[j] - y - 1) / pr... | function swap(uint256 _i, uint256 _j, uint256 _dx, uint256 _minDy) external nonReentrant {
uint256[] memory _balances = balances;
require(!paused || admins[msg.sender], "paused");
require(_i != _j, "same token");
require(_i < _balances.length, "invalid in");
require(_j < _bal... | 12,730,953 |
./partial_match/1/0xd8bcFD9dE4aEF52Eb92Faa56bFc7A75016bE127b/sources/TelegramDiceRoulette.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
... | 4,332,323 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import './interfaces/Burnable.sol';
import "./libraries/SafeMath.sol";
import './tokens/PausableToken.sol';
contract SoldiersPresaleToken is PausableToken, Burnable {
using SafeMath for uint;
event WhitelistedAddressAdded(address addr);
event White... | add addresses to the whitelist addrs addresses return success if at least one address was added to the whitelist, false if all addresses were already in the whitelist/ | function addAddressesToWhitelist(address[] memory addrs) onlyOwner public returns(bool success) {
for (uint256 i = 0; i < addrs.length; i++) {
addAddressToWhitelist(addrs[i]);
}
return true;
}
| 5,402,572 |
/**
*Submitted for verification at Etherscan.io on 2021-07-22
*/
/*
Website: uPlexa.com
$$$$$$$\ $$\
$$ __$$\ $$ |
$$\ $$\ $$ | $$ |$$ | $$$$$$\ $$\ $$\ $$$$$$\
$$ | $$ |$$$$$$$ |$$ |$$ __$$\ \$$\ $$ |\____$$\
$$ | $$ |$$ ____/ $$ |$$$$$$$$ | \$$$$ / $$$$$$$ |
$$ | $$ |$$ | ... | multiMint mints to multiple addresses to reduce TX's in bridge queue / | function _multiMint(address[] memory account, uint256[] memory amount) internal virtual {
require(account.length == amount.length, "Account length does not match amount");
uint256 length = account.length;
for (uint256 addy = 0; addy < length; ++addy) {
_mint(account[addy], amount[ad... | 6,678,605 |
pragma solidity ^0.4.24;
/**
* Based on the open source code of PowerH3D, we built our UPower application ecosystem.
* We will inherit the open source spirit of PowerH3D and accept the community review.
* In future, we will launch more creative games to enrich UPower ecosystem.
* Thanks to Just Team!
*/
contra... | logic runs whenever a reload order is executed. determines how to handle incoming eth depending on if we are in an active round or not/ setup local rID grab time if round is active get earnings from all vaults and return unused to gen vault because we use a custom safemath library. this will throw if player tried to ... | function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, MC2datasets.EventReturns memory _eventData_)
private
{
uint256 _rID = rID_;
uint256 _now = now;
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_... | 14,361,337 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move con... | Get total debt ratio. Total debt ratio helps us keep buffer in pool | function totalDebtRatio() external view returns (uint256) {
return IPoolAccountant(poolAccountant).totalDebtRatio();
}
| 166,389 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.8.0;
// Sources flattened with hardhat v2.6.2 https://hardhat.org
// File contracts/Curve/IStableSwap3Pool.sol
interface IStableSwap3Pool {
// Deployment
function __init__(address _owner, address[3] memory _coins, address _pool_token, uint256 _A, ui... | Withdraw 3pool from the metapool | function metapoolWithdraw3pool(uint256 metapool_lp_in) public onlyByOwnGov {
uint256 min_3pool_out = metapool_lp_in.mul(slippage_metapool).div(PRICE_PRECISION);
metapool_token.remove_liquidity_one_coin(metapool_lp_in, 1, min_3pool_out);
}
| 404,444 |
./full_match/1/0x4c2EeC8C4D8C51152deDc022a39Be3ac3d4BA5C0/sources/FlatFactory.sol | Removes a template creator _newTemplateCreator Address of the to be removed creator/ | function removeTemplateCreator(address _newTemplateCreator)
external
onlyFactoryOwner
{
for (uint256 i = 0; i < templateCreator.length - 1; i++) {
if (templateCreator[i] == _newTemplateCreator) {
templateCreator[i] = templateCreator[i + 1];
}
... | 3,017,024 |
pragma solidity >= 0.6.0;
// Interface of the contract we want to interact with.
abstract contract IBounceCallee {
function receiveMoney(uint128 value) public payable virtual;
function receiveValues(uint16 value1, bool value2, uint64 value3) public virtual;
}
// Contract that can handle errors during intercontract... | Function that calls another contract function and attaches some currency to the call. | function sendMoney(address callee, uint128 amount) public payable alwaysAccept {
IBounceCallee(callee).receiveMoney.value(amount)(amount);
}
| 5,375,995 |
pragma solidity ^0.4.18;
/************************************************** */
/* WhenHub Token Smart Contract */
/* Author: Nik Kalyani nik@whenhub.com */
/* Copyright (c) 2018 CalendarTree, Inc. */
/* https://interface.whenhub.com */
/******************... | Checks if referral tokens are available referralSignupTokens is doubled because both referrer and recipient get referral tokens return A bool indicating if referral tokens are available/ | function isReferralSupported()
public
view
returns(bool)
{
uint256 requiredJiffys = referralSignupJiffys.mul(2);
return (referralJiffysBalance >= requiredJiffys) && (balances[platformManager] >= requiredJiffy... | 1,334,571 |
./full_match/5/0x17FB0da853309F723aba6d0c08E445a3384Ee7F7/sources/contracts/CrowdFunding.sol | _id is the id of campaign | function donateToCampaign(uint256 _id) public payable {
uint256 amount = msg.value;
Campaign storage campaign = campaigns[_id];
campaign.donators.push(msg.sender);
campaign.donations.push(amount);
if(sent) {
campaign.amountCollected = campaign.amountCollected... | 1,911,936 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@ope... | Updates NFT claiming that 1 to n tons have been retired | function updateBatchWithData(
address to,
uint256 tokenId,
string memory _projectIdentifier,
string memory _vintage,
string memory _serialNumber,
uint256 quantity)
public onlyVerifier
returns (uint256)
{
nftList[tokenId].projectIdentifier =... | 13,119,301 |
pragma solidity 0.4.19;
contract IConnections {
// Forward = the connection is from the Connection creator to the specified recipient
// Backwards = the connection is from the specified recipient to the Connection creator
enum Direction {NotApplicable, Forwards, Backwards, Invalid}
function createUser... | External function Creates a new user entity with an address of the msg.sender/ | function createUser() external returns (address entityAddress) {
entityAddress = msg.sender;
assert(entityOfUser[msg.sender] == address(0));
createEntity(entityAddress, msg.sender);
entityOfUser[msg.sender] = entityAddress;
}
| 6,630,465 |
// File: @openzeppelin/upgrades/contracts/Initializable.sol
pragma solidity >=0.4.24 <0.7.0;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer... | Slashes `_amount` tokens from _slashAddress Callable from DelegateManager _amount - Number of tokens slashed _slashAddress - Address being slashed/ Burn slashed tokens from account | function slash(
uint256 _amount,
address _slashAddress
) external
{
_requireIsInitialized();
_requireDelegateManagerAddressIsSet();
require(
msg.sender == delegateManagerAddress,
ERROR_ONLY_DELEGATE_MANAGER
);
_burnFor(_slashA... | 1,231,729 |
./partial_match/84531/0xA39039AF66e9c7bd3CE53aa56B95F46D0b6BB364/sources/contracts/src/diamond/utils/cryptography/EIP712.sol | The hash of the version parameter for the EIP712 domain. NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead./ If the version is empty, the contract may have been upgraded without initializing the new storage. We return the version hash in storage if non-ze... | function _EIP712VersionHash() internal view returns (bytes32) {
string memory version = _EIP712Version();
if (bytes(version).length > 0) {
return keccak256(bytes(version));
bytes32 hashedVersion = EIP712Storage.layout()._hashedVersion;
if (hashedVersion != 0) {
return hashedVersion;
... | 16,688,102 |
./partial_match/1/0x640f7B78830db57BAfDF6F462d2B458dA80825D3/sources/contracts/protocol/leverage/GeneralLevSwap.sol | This function is called after your contract has received the flash loaned amount overriding executeOperation() in IFlashLoanReceiver/ approve the Aave LendingPool contract allowance to pull the owed amount | function executeOperation(
address[] calldata assets,
uint256[] calldata amounts,
uint256[] calldata premiums,
address initiator,
bytes calldata params
) external override returns (bool) {
require(initiator == address(this), Errors.LS_INVALID_CONFIGURATION);
require(msg.sender == AAVE_LE... | 15,492,419 |
./full_match/1/0x48deE19C0e44c147934702c12dc98963CA831009/sources/src/Asset/ERC1155ERC721.sol | A distinct Uniform Resource Identifier (URI) for a given asset. id token to get the uri of. return URI string | function tokenURI(uint256 id) public view returns (string memory) {
require(_ownerOf(id) != address(0), "NFT does not exist");
return toFullURI(_metadataHash[id & URI_ID], id);
}
| 4,919,232 |
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
uint voteCount;
}
struct Bribe {
uint amount;
uint8 vote;
}
address chairperson;
mapping... | Give $(toVoter) the right to vote on this ballot. May only be called by $(chairperson). | function giveRightToVote(address toVoter) public {
if (msg.sender != chairperson || voters[toVoter].voted) return;
voters[toVoter].weight = 1;
emit rightGiven(toVoter, voters[toVoter].weight);
}
| 5,536,741 |
./full_match/4/0x011F0DA68ce3F80b2C8DCd6D94B2f36280ff3b6f/sources/contracts/ico.sol | _Stake is used to make a stake for an sender. It will remove the amount staked from the stakers account and place those tokens inside a stake container StakeID/ Simple check so that user does not stake 0 Mappings in solidity creates all values, but empty, so we can just check the address block.timestamp = timestamp of ... | function _stake(uint256 _amount) internal{
require(_amount > 0, "Cannot stake nothing");
uint256 index = stakes[msg.sender];
uint256 timestamp = block.timestamp;
if((index == 0 && stakeholders[0].stake.amount == 0)||(index == 0 && stakeholders[0].user != msg.sender) ){
... | 740,436 |
./partial_match/1/0xBf6E1F1Fd72080C4793e89aCB8FB61ef1A61cA67/sources/Proposal32.sol | Contracts and ERC20 addresses Withdraw USDC Comp transfers E compSend(0x8A8acf1cEcC4ed6Fe9c408449164CE2034AdC03f, 0, 0, 1); Chilly compSend(0x01e0C7b70E0E05a06c7cC8deeb97Fa03d6a77c9C, 0, 0, 1); Designer compSend(0x3FdcED6B5C1f176b543E5E0b841cB7224596C33C, 0, 0, 1); Ross Feddas compSend(0xbdac5657eDd13F47C3DD924eAa3... | function execute() public {
withdrawToken(
address(USDC),
address(this),
IERC20(USDC).balanceOf(RESERVES)
);
compSend(0x88c868B1024ECAefDc648eb152e91C57DeA984d0, 6438, 0, 1);
uint256 usdcBalance = USDC.balanceOf(address(this));
USDC.tran... | 4,473,888 |
./partial_match/42/0x3e6d34F22878A10b8F49f4ba8B9d42cBc2fF0037/sources/EtherCollateralsUSD.sol | repay any accrued interests first Max repay is the accruedInterest amount | function _splitInterestLoanPayment(
uint256 _paymentAmount,
uint256 _accruedInterest,
uint256 _loanAmount
)
internal
pure
returns (
uint256 interestPaid,
uint256 loanAmountPaid,
uint256 accruedInterestAfter,
uint256 ... | 3,308,180 |
/**
*Submitted for verification at Etherscan.io on 2019-10-31
*/
/**************************************************************************
* ____ _
* / ___| | | __ _ _ _ ___ _ __
* | | _____ | | / _` || | | | / _ \| '__|
* ... | withdraw all ETH funds/ | function withdrawAllETHFunds() public onlyOperator returns (bool) {
uint256 balance = address(this).balance;
withdrawETHInternal(balance);
return true;
}
| 12,886,920 |
// File: contracts/wallet_trading_limiter/interfaces/IWalletsTradingLimiter.sol
pragma solidity 0.4.25;
/**
* @title Wallets Trading Limiter Interface.
*/
interface IWalletsTradingLimiter {
/**
* @dev Increment the limiter value of a wallet.
* @param _wallet The address of the wallet.
* @param _v... | Return the contract which implements the IWalletsTradingDataSource interface./ | function getWalletsTradingDataSource() public view returns (IWalletsTradingDataSource) {
return IWalletsTradingDataSource(getContractAddress(_IWalletsTradingDataSource_));
}
| 5,343,775 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import "./interfaces/IERC677Receiver.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@o... | Harvest proceeds for transaction sender to `to`. pid The index of the pool. See `poolInfo`. to Receiver of token rewards. Effects Interactions | function harvest(uint256 pid, address to) public {
PoolInfo memory pool = updatePool(pid);
UserInfo storage user = userInfo[pid][msg.sender];
int256 accumulatedReward = int256((user.amount * pool.accRewardPerShare) / ACC_PRECISION);
uint256 _pendingReward = uint256(accumulatedReward ... | 5,360,074 |
./full_match/3/0x3Dc329b324cDC77aC885740B524F82d066Ca0d0b/sources/stakingOliver/UBXTStaking.sol | Call epoch to distribure perf pool ubxt to users this method will call in every 12 hours at fixed time/ This comparison also ensures there is no reentrancy. Snap the Epoch time to the start of this window. | function distributePerfPoolRewards() public onlyOwner {
require(inEpochWindow(), "Can not call epoch that time");
require(lastEpochTimestampSec.add(minEpochTimeIntervalSec) < now, "Epoch will call after some time");
uint256 ubxtBal = IERC20(token).balanceOf(perfPool);
IERC20(token)... | 8,239,108 |
./partial_match/1/0x27BE2e83c3D098625DDF98e687a9353f31646527/sources/contracts/Governor.sol | Admin function for setting the proposal threshold newProposalThreshold must be greater than the hardcoded min newProposalThreshold new proposal threshold/ | function setProposalThreshold(uint256 newProposalThreshold) public {
require(msg.sender == admin, "setProposalThreshold: admin only.");
require(newProposalThreshold >= MIN_PROPOSAL_THRESHOLD && newProposalThreshold <= MAX_PROPOSAL_THRESHOLD, "_setProposalThreshold: invalid proposal threshold.");
... | 16,092,484 |
pragma solidity =0.6.6;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "./libraries/TransferHelper.sol";
import "./interfaces/IPancakeRouter02.s... | execute swap directly on Uniswap/Pancake/... swapData stores the swapData information amountOutMin minimum expected tokens to receive path Sell path. | function swapExactETHForTokensSupportingFeeOnTransferTokens(
SwapData calldata swapData,
uint256 amountOutMin,
address[] calldata path
) external payable whenNotPaused isValidFork(swapData.fork) isValidReferee(swapData.referee) {
require(path[0] == WETH, "FloozRouter: INVALID_PAT... | 600,862 |
./full_match/1/0x6f737614cC5b89bbAd665f0e6803eE6867835d58/sources/contracts/CErc20AuraDelegator.sol | Accrue interest then return the up-to-date exchange rate return Calculated exchange rate scaled by 1e18/ | function exchangeRateCurrent() override public returns (uint) {
bytes memory data = delegateToImplementation(abi.encodeWithSignature("exchangeRateCurrent()"));
return abi.decode(data, (uint));
}
| 3,001,933 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
contract TextModule {
event TextDelivered(address user,string tofro); // Event
mapping (address => string) toCreator;
mapping (address => string) fromCreator;
address TEXTowner;
constructor() {
TEXTowner=msg.sender;
}
function ownerR... | address(this)if (balanceOf(msg.sender)>0){} | function ownerWrites(string memory txt) public {
toCreator[msg.sender] = txt;
}
| 14,125,043 |
./full_match/80001/0x139A67ABdAb91a0d54aD3b6fC9AF46c1457667E2/sources/contracts/User.sol | Check if user already exists require(users[_user].address == address(0), "User already exists"); Store user address in nameToAddress mapping | function createUser(address _user, string memory _role, string memory _name) public {
require(_user != address(0), "User address can't be zero");
require(bytes(_role).length > 0, "Role can't be empty");
require(bytes(_name).length > 0, "Name can't be empty");
Role role = new Role()... | 5,589,729 |
./full_match/56/0xBbD8Cb37Fa7eBCc6081d1785784C9E15c8903A2E/sources/BEP20Mintable.sol | Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {BEP20-_burn} and {BEP20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`./ | function burnFrom(address account, uint256 amount) public virtual {
uint256 decreasedAllowance = _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance");
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
| 3,236,759 |
// SPDX-License-Identifier: MIT
// CREDIT: https://github.com/alexanvl/bloccwarz/blob/master/contracts/BloccWarz.sol
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../token/ERC20/CollabLandERC20Mintable.sol";
contract BondingC... | Owner can withdraw tokens collected by the contract above the lockup amount | function withdrawTokens(uint256 _tokensBWCWei) public onlyOwner {
require(
balanceOf(address(this)) > tokenBWCWeiLockup,
"Not enough tokens locked up"
);
_transfer(msg.sender, owner, _tokensBWCWei);
}
| 12,923,253 |
./partial_match/42161/0x8B90fb7960c2324CE6D2427fcE49ffaa0357b3d9/sources/1.sol | Purchase a bundle of tokens required for all Arbitrum guild.xyz roles/ | function purchaseBundle() external payable nonReentrant {
if (msg.value != price) revert IncorrectPrice();
uint256 tokensLength = tokens.length;
for (uint256 i; i < tokensLength;) {
tokens[i].transfer(msg.sender, amounts[i]);
}
}
| 3,493,358 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity =0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/cont... | Get ETH worth of a certain amount of a token. _amount Amount of token to convert. _fromAddress Address of token to convert from. _toAddress Address of token to convert to. excludeFees If uniswap fees is considered./ | function _getAAmountByBAmount(
uint256 _amount,
address _fromAddress,
address _toAddress,
bool excludeFees
) private view returns (uint256) {
address[] memory path = new address[](2);
path[0] = _fromAddress;
path[1] = _toAddress;
if (path[0] == pa... | 12,155,567 |
./partial_match/1/0x77fB32743eDF3FefEA422cF71dA22c2594F75663/sources/SaffronERC20StakingPool.sol | Update state for removal via dsec token Get info about the v1 dsec token from its address and check that it exists Token epoch must be a past epoch Dsec gives user claim over a tranche's earned SFI and interest Update state for removal via principal token Get info about the v1 dsec token from its address and check that... | function remove_liquidity(address dsec_token_address, uint256 dsec_amount, address principal_token_address, uint256 principal_amount) external override {
require(dsec_amount > 0 || principal_amount > 0, "can't remove 0");
uint256 SFI_owned;
uint256 dsec_percent;
if (dsec_token_address != address(0x0)... | 2,702,027 |
./partial_match/56/0x9d34F2C6D072388afA2cAbEc1BfBe99666fb85e2/sources/StratHomora.sol | Swap half earned to token0 Swap half earned to token1 | function earn() public whenNotPaused {
require(isAutoComp, "!isAutoComp");
if (onlyGov) {
require(msg.sender == govAddress, "Not authorised");
}
earnedAmt = distributeFees(earnedAmt);
earnedAmt = buyBack(earnedAmt);
if (isCAKEStaking) {
las... | 11,290,377 |
pragma solidity 0.5.16;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the token symbol.
*/
... | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount... | 73,405 |
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: Pyramid.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthet... | created solely to display total amount of dividends on rug.money | function displayDividends(address staker) public view returns(uint256) { | 7,620,904 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "./upgradeable/LnAdminUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./SafeDecimalMath.sol";
import "./LnAddressCache.sol";
import "./interfaces/ILnAccessControl.sol";
import "./interfaces/ILnAssetSystem.sol";
contract LnDe... | ------------------------------------------------------- | function __LnDebtSystem_init(address _admin) public initializer {
__LnAdminUpgradeable_init(_admin);
}
event UpdateAddressStorage(address oldAddr, address newAddr);
event UpdateUserDebtLog(address addr, uint256 debtProportion, uint256 debtFactor, uint256 timestamp);
event PushDebtLog(uint25... | 5,497,117 |
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/ECRecovery.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./Vault.sol";
contract Market {
using SafeMath for uint256;
using ECRecovery for bytes32;
Vault public trustedVault;
event LogProductBought(address... | Convert to a signed message in Ethereumsends value to seller | function buyProduct(
bytes _signature,
uint256 _tagId,
address _seller,
address _stockist)
public
payable
{
require(msg.value > 0, "It is not allowed to buy a product paying 0.");
bytes32 temp = keccak256(abi.encodePacked(_tagId));
bytes32... | 12,828,556 |
pragma solidity 0.5.16;
import 'OpenZeppelin/openzeppelin-contracts@2.3.0/contracts/ownership/Ownable.sol';
import 'OpenZeppelin/openzeppelin-contracts@2.3.0/contracts/math/SafeMath.sol';
import 'OpenZeppelin/openzeppelin-contracts@2.3.0/contracts/utils/ReentrancyGuard.sol';
import 'Synthetixio/synthetix@2.28.4-beta/co... | Re-invest whatever this worker has earned back to staked LP tokens. 1. Withdraw all the rewards. 2. Send the reward bounty to the caller. 3. Convert all the remaining rewards to BNB. 4. Use add BNB strategy to convert all BNB to LP tokens. 5. Mint more LP tokens and stake them for more rewards. | function reinvest() public onlyEOA nonReentrant {
staking.getReward();
uint reward = uni.myBalance();
if (reward == 0) return;
uint bounty = reward.mul(reinvestBountyBps) / 10000;
uni.safeTransfer(msg.sender, bounty);
address[] memory path = new address[](2);
path[0] = address(uni);
pa... | 7,239,136 |
./full_match/56/0x1C5C0E1B96E7ADDC14AED3688E547A6103A244d9/sources/project_/contracts/Router1.sol | Adds liquidity to PancakeSwap pool using the PancakeSwap router tokenAmount The amount of tokens to add to the liquidity pool bnbAmount The amount of BNB to add to the liquidity pool/ Approve token transfer to PancakeSwap router | function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private {
_approve(address(this), address(pancakeRouter), tokenAmount);
address(this),
tokenAmount,
0,
0,
address(this),
block.timestamp
);
}
| 3,227,223 |
./full_match/80001/0xD9409a073a6Ca9C6b7f87e001212F7E4C699A192/sources/contracts/NftTokenCrowdsale.sol | Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. _buyer Address performing the token purchase/ total of every token minted total of every token type minted balance of every token type in user's wallet | function _deliverTokens(address _buyer, uint256 _typeId) internal {
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
string memory metadata = _types[_typeId].metadata;
token.mintWithRoyalties(_buyer, metadata, newItemId, royaltiesRecipientAddress, percentageBasisPoi... | 9,485,158 |
./partial_match/1/0xdDc2c27eA8a42b35B329c4e0216600F12EED13d1/sources/contracts/wombat-governance/rewarders/MultiRewarderPerSecV2.sol | View function to see pending tokens that have been distributed but not claimed by the user yet. _user Address of user. return rewards_ reward for a given user. use `max(totalShare, 1e18)` in case of overflow | function pendingTokens(address _user) public view virtual override returns (uint256[] memory rewards_) {
uint256 length = rewardInfos.length;
rewards_ = new uint256[](length);
uint256[] memory toDistribute = rewardsToDistribute();
for (uint256 i; i < length; ++i) {
Rewar... | 2,762,894 |
./full_match/80001/0x33f2D9f19E1203Db1A98ed43CE01110Aac2bc469/sources/src/metadata/Cre8orsCollectiveMetadataRenderer.sol | Standard init for drop metadata from root drop contract data passed in for initialization data format: string baseURI, string newContractURI | function initializeWithData(bytes memory data) external {
(
string memory initialBaseURI,
string memory initialBaseCollectiveURI,
string memory initialContractURI
) = abi.decode(data, (string, string, string));
_updateMetadataDetails(
msg.sende... | 9,482,742 |
./full_match/43113/0x34b31147209f00AF8F7d4008fa057AC6ac8E2594/sources/LendingPool_flat.sol | Flash loan record how much user will have to pay back e.g. borrow 100, debt = 100.1 send borrower the tokens hand over control to borrwer repay the debt | function flashLoan(address flashLoanAddress, uint256 amount) external returns(bool){
EVRTFlashLoan flashLoanContract;
flashLoanContract = EVRTFlashLoan(flashLoanAddress);
uint256 totalAmount = scale(amount);
uint256 debt = totalAmount.mul(ONE.add(flashLoanFee)).div(ONE);
... | 13,192,114 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
import "./Interfaces/IPriceFeed.sol";
import "./Interfaces/ITellorCaller.sol";
import "./Dependencies/AggregatorV3Interface.sol";
import "./Dependencies/SafeMath.sol";
import "./Dependencies/Ownable.sol";
import "./Dependencies/CheckContract.sol";
import "./Depe... | Check for response call reverted Check for an invalid timeStamp that is 0, or in the future Check for zero price | function _tellorIsBroken(TellorResponse memory _response) internal view returns (bool) {
return false;
}
| 897,728 |
./full_match/80001/0xef280916594A36C96C48B626B483F14e3E86B921/sources/contracts/GeniosClub.sol | set current levelset current levelset current level | function updateG3X2(
address userAddr,
address refAddr,
uint8 level,
int x2
) private {
if (x2 == 0) {
Users[Users[refAddr].G3X2Matrix[level].FirstLevelRefs[0]]
.G3X2Matrix[level]
.FirstLevelRefs
.push(userAddr);
Users[Users[refAddr].G3X2Matrix[level].FirstLe... | 872,738 |
/**
*Submitted for verification at Etherscan.io on 2021-07-13
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
/**
* @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 b... | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but performing a static call. _Available since v3.3._/ | function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: Low-level static call failed");
}
| 7,792,891 |
pragma solidity ^0.4.15;
/*
Bancor Converter v0.6
The Bancor version of the token converter, allows conversion between a smart token and other ERC20 tokens and between different ERC20 tokens and themselves.
ERC20 connector balance can be virtual, meaning that the calculations are based on the virtual bal... | / get the full allowance amount transfer all tokens from the sender to the contract calculate ETH value of the tokens send the ETH amount to the seller | note that the function will sell the full allowance amount
@return ETH sent in return
function sell() public returns (uint128 amount) {
uint128 allowance = token.allowance(msg.sender, this);
assert(token.transferFrom(msg.sender, this, allowance));
uint128 etherValue = safeMu... | 2,545,981 |
pragma solidity ^ 0.5.8;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath
for uint256;
/********************************************************************************************/
/* DATA VAR... | check if address is of airline or not/ | function isAirline(
address _airlineAccount
)
external
view
returns(bool) {
return airlines[_airlineAccount].isRegistered == true;
}
| 14,037,466 |
./full_match/80001/0x32E22c81f636C68cC3b6882E291e706fA4E96C1f/sources/contracts/member.sol | Function for a member to self-register with their details Make sure the member has inputted a registration ID from the admin Initialize the member's profile information | function registerSelf(
string memory _name,
string memory _phoneNumber,
string memory _image,
string memory _maritalStatus,
string memory _emailAddress,
string memory _houseAddress,
string memory _sex,
string memory _dateOfBirth,
string memory ... | 5,610,766 |
./partial_match/3/0xa269107FF4a5046CB07A48bB088b006Eae7E8f3C/sources/RecoverToken.sol | A method to add a stakeholder. _stakeholder The stakeholder to add./ | function addStakeholder(address _stakeholder) public onlyOwner
{
(bool _isStakeholder, ) = isStakeholder(_stakeholder);
if(!_isStakeholder) stakeholders.push(_stakeholder);
}
| 5,119,265 |
// File: openzeppelin-solidity\contracts\token\ERC20\ERC20Basic.sol
pragma solidity 0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function b... | Allows the current owner to add an authorized account. _account The address being added as authorized./ | function addAuthorized(address _account) public onlyOwner {
if (authorizedIndex[_account] == false) {
authorizedIndex[_account] = true;
authorized.length++;
authorized[authorized.length.sub(1)] = _account;
numAuthorized++;
}
}
| 15,854,263 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;
import "./Shop.sol";
contract ShopFactory {
mapping(bytes32=>address) private shopMapping;
string[] private names;
event ShopAdded(string name, address shopAddress);
constructor() public {
}
... | Determine if the text is safe for use Each character is individually checked str The string to interrogate return Boolean indicating if the text contains unexpected characters | function isSafeString(string memory str) private pure returns (bool ) {
bytes memory b = bytes(str);
for(uint i; i < b.length; i++) {
bytes1 char = b[i];
)
return false;
}
return true;
}
| 1,757,834 |
./partial_match/56/0x820F1716e605d8D8DD6cdF872eb2Eb49C17351d0/sources/TajToken.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "TAJ::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0... | 11,074,752 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.