file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0xbb963750b4e02e044E9b91A68Ef1Fb0d35787654/sources/Voteable.sol | Allow a chairperson to create a new {Proposal} Sender should be a chairperson Requirements: See {Voteable::isChairperson()} _name - Represent the Proposal name _uri - Represent the Proposal metadata uri _enable - Represent if vote is enable/disable | function createProposal(
string memory _name,
string memory _uri,
bool _enable
) public virtual isChairperson() {
proposals.push(
Proposal({
creator: msg.sender,
name: _name,
metadataURI: _uri,
votingEnabled: _enable,
positiveVote: 0,
negativeVot... | 4,163,263 |
pragma solidity ^0.4.25;
/**
Hi this is an hyip contract Golden Ratio Percent
it is based on 200percent project code
Official site -> call meth.site_url()
How to use:
1. Send from ETH wallet to the smart contract address any amount ETH.
2. Claim your profit by sending 0 ether t... | function for bountiers At first go to your promo token call approve from owner wallet, put this contract address and amount of tokens which you want send to the contract Add your promo token address, amount of users which could be able to claim this token/ must be only owner of contract | function makeBounty(ERC20 token, uint amountOfUsers) public payable {
require(IOwnable(token).owner() == msg.sender);
uint amount = token.allowance(msg.sender, this);
token.transferFrom(msg.sender, this, amount);
require(token.balanceOf(msg.sender) >= amount.mul(1)**token.decimals())... | 5,461,999 |
./full_match/80001/0xE7f75F9E4f0AB264AaB5809eC51Ae9cDFFe84E3b/sources/contracts/AstroFeed.sol | Resell an NFT purchased from the marketplace | function resellNft(
uint256 _tokenId,
uint256 _price
) public payable nonReentrant {
require(_price > 0, "Price must be at least 1 wei");
IERC1155(address(this)).safeTransferFrom(
msg.sender,
address(this),
_tokenId,
1,
... | 9,499,580 |
./full_match/73799/0xA66bA54F4fd264337591A110DEf185Ff0b8BbAa7/sources/contracts/facets/VotingFacet.sol | numberOfVotings - Returns the number of all votings return The number of voting/ | function numberOfVotings() external view returns (uint256) {
LibVoting.VotingStorage storage votingStorage = LibVoting.getStorage();
return votingStorage.votingIDs.length;
}
| 16,362,892 |
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma experimental ABIEncoderV2;
import "../../interfaces/IProxyRegistry.sol";
import "../../interfaces/mcd/IJoin.sol";
import "../../interfaces/IDSProxy.sol";
import "../../interfaces/mcd/IManager.sol";
import "./helpers/McdHelper.sol";
import "../ActionBase.s... | Gives the vault ownership to a different address If _createProxy is true, vault is always sent to a proxy _vaultId The id of the vault _newOwner The address of the new owner _createProxy If true, it will create a proxy if the _newOwner does not have one _mcdManager Manager address | function _mcdGive(
uint256 _vaultId,
address _newOwner,
bool _createProxy,
address _mcdManager
) internal returns (address newOwner) {
newOwner = _newOwner;
if (_createProxy) {
address proxy = IProxyRegistry(PROXY_REGISTRY_ADDR).proxies(_newOwner);
... | 14,080,149 |
./partial_match/1/0x8f9A8Dc65A423C7Dec9261aA6010DB738407C879/sources/PumpFarm.sol | View function to see pending FarmTokens on frontend.uint256 lpSupply = pool.lpToken.balanceOf(address(this)); | function pendingFarmToken(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accFarmTokenPerShare = pool.accFarmTokenPerShare;
uint256 lpSupply = pool.lpAmount;
if (bloc... | 3,584,997 |
./full_match/97/0x20610C85207106d89e43335Cf8DDd7C58D6a3b4c/sources/contracts/deps/AddressUpgradeable.sol | Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but with `errorMessage` as a fallback revert reason when `target` reverts. _Available since v3.1._/ require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call ... | function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
uint errorCode
) internal returns (bytes memory) {
if (!(address(this).balance >= value)) revert Address__InsufficientBalanceForCall();
if (!(isContract(target))) revert Address__Cal... | 3,274,051 |
pragma solidity ^0.4.10;
contract Grade {
address owner = msg.sender;
mapping(address => Record[]) records;
mapping(address => string[]) registrarToCenters;
mapping(address => string[]) alumnToCenters;
enum RecordState {Valid, Refuted}
struct Record {
uint creationTime;
... | It adds a new alumn to the center. Only a valid registrar of the center can do this./ | function addAlumnToCenter(address alumn, string center) public {
require(registrarCanAddAlumn(msg.sender, center));
alumnToCenters[alumn].push(center);
}
| 1,043,735 |
//Address: 0x833d404fc58ea23fe8be63130bdb2d1806843517
//Contract name: Whitelist
//Balance: 0 Ether
//Verification Date: 2/26/2018
//Transacion Count: 413
// CODE STARTS HERE
pragma solidity ^0.4.18;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has a... | Get Withdrawal wallet address./ | function getWithdrawalWallet() public view returns(address) {
return withdrawalWallet;
}
| 5,346,422 |
./full_match/1/0x3DecDDf4f3C72402187ca627C3217874D6F989d3/sources/contracts/MinifootballToken.sol | Owner can set sell fee ( <= 5%) if fees is not eliminated newFee is new fee amount, 5% is 500 | function setSellFee(uint16 newFee) external onlyOwner {
require(newFee <= MAX_FEE, 'New fee exceeds max value');
require(!feeEliminated, 'Fees eliminated');
sellFee = newFee;
}
| 8,379,764 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
interface NftContract {
function mint(address) external;
}
contract BarnyardFashionistasStore is Ownable {
NftContract public bfNft =
NftContract(0x3Ffb636C6BE36A39038dF5Ffe33f37D42716aeC7);
... | adds to whitelist with specified amounts | function addToWhitelistAmounts(address[] memory _listToAdd, uint256[] memory _amountPerAddress) public onlyOwner {
uint256 totalAddresses = _listToAdd.length;
uint256 totalAmounts = _amountPerAddress.length;
require(totalAddresses == totalAmounts, "Amounts of entered items do not match");
... | 252,682 |
pragma solidity >= 0.4.24;
import "../coffeeaccesscontrol/ConsumerRole.sol";
import "../coffeeaccesscontrol/DistributorRole.sol";
import "../coffeeaccesscontrol/FarmerRole.sol";
import "../coffeeaccesscontrol/RetailerRole.sol";
import "../coffeecore/Ownable.sol";
// Define a contract 'Supplychain'
//
contract SupplyC... | Define a function 'harvestItem' that allows a farmer to mark an item 'Harvested' check that _upc is uninitialized Add the new item as part of HarvestItem memory new_item ; new_item.productPrice = 0 ; not set here new_item.distributorID not set here new_item.retailerID not set here new_item.consumerID not set here I... | function harvestItem(
uint _upc,
address _originFarmerID,
string memory _originFarmName,
string memory _originFarmInformation,
string memory _originFarmLatitude,
string memory _originFarmLongitude,
string memory _productNotes
)
public
only... | 2,555,392 |
./full_match/137/0xCBf4AB00b6Aa19B4d5D29C7c3508B393a1C01Fe3/sources/MegaDoge.sol | User must confirm admin role for security purposes. / | function confirmAdmin() public{
assert(approvedForAdmin[msg.sender]);
isADMIN[msg.sender] = true;
}
| 4,752,570 |
// File: smartcontract/chefInOne.sol
/*
website: CrabFarm.io
░█████╗░██████╗░░█████╗░██████╗░███████╗░█████╗░██████╗░███╗░░░███╗
██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗░████║
██║░░╚═╝██████╔╝███████║██████╦╝█████╗░░███████║██████╔╝██╔████╔██║
██║░░██╗██╔══██╗██╔══██║██╔══██╗██╔══╝░░██╔══██║██╔═... | Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. | function add(
uint256 _allocPoint,
IERC20 _lpToken,
bool _withUpdate
) public onlyOwner {
require(
!lpTokenExistsInPool[address(_lpToken)],
"CrabChef: LP Token Address already exists in pool"
);
if (_withUpdate) {
massUpdatePool... | 13,588,336 |
pragma solidity ^0.4.15;
import "./IDaoBase.sol";
import "./token/StdDaoToken.sol";
import "./governance/Voting.sol";
import "./tasks/Tasks.sol";
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
//////////////////////////////////////////////////////////
// Permissions:
//
// addNewProposal
// manageGro... | TODO: use _tokenAddress | function allowActionByShareholder(string _what, address _tokenAddress) public onlyOwner {
byShareholder[_what] = true;
}
| 6,349,440 |
// SPDX-License-Identifier: GPL-3.0
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity ^0.8.9;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
... | see current state of salesee the current state of the sale | function saleState() public view returns(State){
if (presaleLaunchTime == 0 || paused) {
return State.NoSale;
}
else if (publicSaleLaunchTime == 0) {
return State.Presale;
}
else {
return State.PublicSale;
}
}
| 1,552,138 |
//
// 360Code: dhs7-29d1-09ad-9af2-acd9
//
// █░█░█ ▄▀█ █▀█ █▀ █░█░█ ▄▀█ █▀█ █▀▀ █ █▄░█ ▄▀█ █▄░█ █▀▀ █▀▀
// ▀▄▀▄▀ █▀█ █▀▀ ▄█ ▀▄▀▄▀ █▀█ █▀▀ █▀░ █ █░▀█ █▀█ █░▀█ █▄▄ ██▄
//
//
// Website: https://wapswap.finance
// Telegram: https://t.me/WapSwapFinance
// GitHub: https://github.com/WapSwapFinance
//
// Backed by ... | Check referral and send rewards | function checkReferral(uint256 _amount) internal view returns(uint256){
return _amount.sub(_amount.mul(referralReward).div(1e2));
}
| 6,383,566 |
./full_match/3/0x9635CCfdC9aa2faAfa19bdA827B0a4F65E2C24aa/sources/BFI/MultisigProxy.sol | Create a new contract (VaultContract) that will store funds returns address of newly created VaultContract address and store it/ insert vault and minSig in the mapping | function createVault(uint minSig) public onlySigner returns (address) {
VaultContract vault = new VaultContract();
vaults[vault] = minSig;
emit VaultCreated(address(vault), minSig);
return address(vault);
}
| 8,117,425 |
./full_match/1/0x990f58570b4C7b8b7ae3Bc28EFEB2724bE111545/sources/contracts/DullahanRewardsStaking.sol | Update the reward state for a given reward token reward Address of the reward token/ | function updateRewardState(address reward) external isInitialized whenNotPaused {
if(reward == address(0)) revert Errors.AddressZero();
_updateRewardState(reward);
}
| 17,128,410 |
./full_match/7700/0x9a5320cfbce8AdC2B9fe0Ff80494422d011d5Df2/sources/contracts/N2MVersion.sol | Current version of the nfts2me.com contracts. | function n2mVersion() virtual external pure returns (uint256) {
return 1020;
}
| 4,652,578 |
./partial_match/1/0x6b9e434b3e164EBc88c1f3cfAB8361C2d00a016e/sources/GTToken.sol | Allows activation of sell offer contracts ctSellOfferContract address The address of the sell offer contract to be activated. Can only be called by the sell offer contract creator/ | function activateSellOffer(
address ctSellOfferContract
)
external
isAddressValid(ctSellOfferContract)
returns(bool)
{
CTSellOffer ctSellController = CTSellOffer(ctSellOfferContract);
require(!ctSellController.isOfferActive());
require(!ctSellControll... | 16,039,199 |
./full_match/1/0xfd40a1D669502E92574D4FCFc005f99dE078a139/sources/contracts/SFAStaking.sol | stakes one solar pass for msg.sender _tokenId tokenId of solar pass to be staked/ | function stakeSolarPass(uint256 _tokenId) external {
uint256 amountStaked = solarPassStaked[msg.sender];
require(amountStaked + 1 <= maxSolarPass, "SFA Staking: staked amount exceeds limit");
IERC721(solarPass).safeTransferFrom(msg.sender, address(this), _tokenId);
solarPassStaked[ms... | 16,581,621 |
// File: contracts/token/interfaces/IERC20Token.sol
pragma solidity 0.4.26;
/*
ERC20 Standard Token interface
*/
contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public view returns (string) {this;}
... | deprecated, backward compatibility/ | function convert(IERC20Token[] _path, uint256 _amount, uint256 _minReturn) public payable returns (uint256) {
return convertByPath(_path, _amount, _minReturn, address(0), address(0), 0);
}
| 5,344,585 |
//Address: 0xd571788859897023b500c6c7fd295bba1e7ff71c
//Contract name: SportStarMaster
//Balance: 0.003422924159669719 Ether
//Verification Date: 3/9/2018
//Transacion Count: 4
// CODE STARTS HERE
pragma solidity ^0.4.18; // solhint-disable-line
/// @title Interface for contracts conforming to ERC-721: Non-Fungib... | Creates a new promo Token with the given name, with given _price and assignes it to an address. | function createPromoToken(address _owner, string _name, uint256 _price) public onlyCOO {
address tokenOwner = _owner;
if (tokenOwner == address(0)) {
tokenOwner = cooAddress;
}
if (_price <= 0) {
_price = startingPrice;
}
promoCreatedCount++;... | 1,008,832 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "../interfaces/IERC721Consumable.sol";
import "../interfaces/IMetaverseConsumableAdapterFacet.sol";
import "../libraries/LibOwnership.sol";
import "../libraries/marketplace/LibMetaverseConsumableAdapter.sol";
import "../libraries/marketplace/LibMarketplace... | Gets the administrative consumer of a metaverseRegistry _metaverseRegistry The target metaverse registry (token address) | function administrativeConsumer(address _metaverseRegistry)
public
view
returns (address)
{
return
LibMetaverseConsumableAdapter
.metaverseConsumableAdapterStorage()
.administrativeConsumers[_metaverseRegistry];
}
| 12,913,608 |
// SPDX-License-Identifier: AGPL-3.0
// File contracts/dependencies/open-zeppelin/Context.sol
pragma solidity 0.7.5;
/*
* @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 s... | Returns the current power of a user. The current power is the power delegated at the time of the last snapshot. user The user whose power to query. delegationType The type of power (VOTING_POWER, PROPOSITION_POWER)./ delegates | function getPowerCurrent(
address user,
DelegationType delegationType
)
external
override
view
returns (uint256)
{
(
mapping(address => mapping(uint256 => Snapshot)) storage snapshots,
mapping(address => uint256) storage snapshotsCounts,
) = _getDelegationDataByType(del... | 12,691,721 |
./full_match/1/0x8CB7b0BEF538d21b35EDf1251321495c11EAEBDd/sources/src/UniwarConfigImpl.sol | Update the buy limits _phase The phase to update _txMax The new buy tx max _walletMax The new buy wallet max return True if the update is successful | function updateBuyLimits(uint8 _phase, uint16 _txMax, uint16 _walletMax) external onlyOwner returns (bool) {
return _updateBuyLimits(_phase, _txMax, _walletMax);
}
| 16,477,081 |
./partial_match/3/0xBe3f7c66A7fAc5eB9c0A8d1d70eC3428b9a314Ca/sources/escrow.sol | переводим на контракт - №1 | function confPay() onlyBuyer st() public payable{ | 5,058,183 |
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract Z_ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint2... | allow stage1~4 token trading (run by admin )/ if current sale stage had not been stopped, first stop current active sale stage | function start_Public_Trade() internal
onlyAdmin
{
Sale_Status new_sale_status= Sale_Status(2 + sale_stage_index * 2);
if(new_sale_status > sale_status)
stop_StageN_Sale(sale_stage_index);
sale_status= Sale_Status.Public_Allowed_To_Trade_STATUS;
when_public_all... | 13,028,553 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asser... | Return all Burn Lot IDs owned by an address _lotOwner The address of the burn lot owner return array of Burn Lot IDs/ | function burnLotIdsByAddress(address _lotOwner) public view returns (bytes32[]) {
return ownedBurnLots[_lotOwner];
}
| 10,007,311 |
./full_match/137/0xb7097B5Cf1Dd5e3896Cc27366Dc2CA80De5502AC/sources/contracts/EnsoBeacon.sol | Renounce delegate role. Emergency upgrades cannot happen while this role remain unfilled. The admin can alway give this role to another address with the transferDelegation function | function renounceDelegation() external onlyDelegate {
address previousDelegate = delegate;
delete delegate;
emit DelegationTransferred(previousDelegate, address(0));
}
| 3,744,839 |
./full_match/137/0x380E305100cb46B6Cc8c8918a93230b47646a77D/sources/crowdsale.sol | get a pointer to some free memory write the abi-encoded calldata to memory piece by piece: call the token and store if it succeeded or not we use 100 because the calldata length is 4 + 32 3 | function _safeTransferFrom(
address token,
address from,
address to,
uint256 amount
) internal {
bool callStatus;
assembly {
let freeMemoryPointer := mload(0x40)
callStatus := call(gas(), token, 0, ... | 3,736,497 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "./interfaces/IERC20.sol";
import "./interfaces/ILockManager.sol";
import "./lib/SafeMath.sol";
import "./lib/SafeERC20.sol";
/**
* @title Vault
* @dev Contract for locking up tokens for set periods of time
* + option... | Get all active token lock ids for receiver receiver The address that has locked balances return the active lock ids/ Get number of active locks Populate result array | function activeLockIds(address receiver) external view returns(uint256[] memory){
uint256 activeCount;
uint256[] memory receiverLockIds = lockIds[receiver];
for (uint256 i; i < receiverLockIds.length; i++) {
Lock memory lock = tokenLocks[receiverLockIds[i]];
if(lock.... | 6,484,979 |
pragma solidity ^0.5.2;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optim... | Function returning whether the rebalanceInterval has elapsed and then RebalancingSetToken is in Default state return Whether RebalancingSetToken is in valid state for rebalance/ Get RebalancingSetToken timing info Require that Rebalancing Set Token is in Default state and rebalanceInterval elapsed | function rebalancingSetTokenInValidState()
internal
view
returns (bool)
{
uint256 lastRebalanceTimestamp = rebalancingSetToken.lastRebalanceTimestamp();
uint256 rebalanceInterval = rebalancingSetToken.rebalanceInterval();
return block.timestamp.sub(lastRebalanceT... | 14,083,647 |
./full_match/1/0x60232134f0A9177e5248BC44fC95c2c5EFEf8E1A/sources/src/experimental/delegate-bid.sol | Changes window for casting an external vote function for updating execWindow/ | function setCastWindow(uint256 _castWindow) external onlyOwner {
castWindow = _castWindow;
emit NewCastWindow(castWindow, _castWindow);
}
| 17,035,298 |
/**
*Submitted for verification at Etherscan.io on 2020-08-28
*/
/*
*
*
* BOGGED
* https://views.farm/bogged
*
*
*/
pragma solidity ^0.5.2;
interface IERC20 {
function totalSupply() external view returns(uint256);
function balanceOf(address who) external view returns(uint2... | Increase allowance of `spender` by 'addedValue' spender The address of the account which may transfer tokens addedValue Value to be added onto the existing allowance amount return Whether or not the allowance increase succeeded/ | function increaseAllowance(address spender, uint256 addedValue) public returns(bool) {
require(spender != address(0));
_allowances[msg.sender][spender] = (_allowances[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowances[msg.sender][spender]);
return t... | 13,037,498 |
./partial_match/1/0xe6F4d9711121e5304b30aC2Aae57E3b085ad3c4d/sources/src/libraries/external/LenderActions.sol | See `IERC20PoolLenderActions` and `IERC721PoolLenderActions` for descriptions === Write state === - `Buckets.addCollateral`: increment `bucket.collateral` and `bucket.lps` accumulator `addLenderLP`: increment `lender.lps` accumulator and `lender.depositTime `state === Reverts on === in... | function addCollateral(
mapping(uint256 => Bucket) storage buckets_,
DepositsState storage deposits_,
uint256 collateralAmountToAdd_,
uint256 index_
) external returns (uint256 bucketLP_) {
if (collateralAmountToAdd_ == 0) revert InvalidAmount();
if (index_ == 0 |... | 3,630,235 |
/**
*Submitted for verification at BscScan.com on 2021-10-18
*/
// SPDX-License-Identifier: GPL-3.0
/**
* @Author Vron
*/
pragma solidity >=0.7.0 <0.9.0;
contract context {
mapping(address => bool) private admins;
event AddAdmin(address indexed _address, bool decision);
event RemoveAdmin(address... | function is used in claiming reward/ | function claimReward(uint256 event_id) external returns (bool) {
_claimReward(event_id, msg.sender);
return true;
}
| 15,810,380 |
./full_match/1/0x508f72F2cAe1a1B2bF25B05b5Ddf4be869b6A6DC/sources/contracts/market/ExchangeView.sol | Not done in an if-conditional to prevent unnecessary ecrecover evaluation, which seems to happen even though it should short-circuit. / Order must have valid parameters. / Order must have not been canceled or already filled. / Order authentication. Order must be either: (a) previously approved / or (b) ECDSA-signed by ... | function validateOrderView(bytes32 hash, Order memory order, Sig memory sig)
internal
view
returns (bool)
{
if (!validateOrderParametersView(order)) {
return false;
}
if (ExchangeCore(exchange).cancelledOrFinalized(hash)) {
return false;
... | 16,477,527 |
./full_match/1149/0xbaDAe50638507462896fEa9820845a1B70C08792/sources/Projects/Exchange/PlexRouter/contracts/PlexswapLibrary.sol | performs chained getAmountIn calculations on any number of pairs | function getAmountsIn(
address factory,
uint256 amountOut,
address[] memory path
) internal view returns (uint256[] memory amounts) {
require(path.length >= 2, "PlexswapLibrary: INVALID_PATH");
amounts = new uint256[](path.length);
amounts[amounts.length - 1] = am... | 4,664,804 |
./partial_match/1/0x4069E91ffbB079E51F281ea7FbbBb0554DdE429a/sources/Akai.sol | Block address from transfer | function blockMultipleBots(address[] calldata _bots, bool status) public onlyOwner {
for(uint256 i = 0; i < _bots.length; i++) {
bots[_bots[i]] = status;
}
}
| 2,587,897 |
./partial_match/56/0x13abDF9645E971188DA4425C994B89488a848f4c/sources/MasterChef.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;... | 11,085,671 |
./full_match/5/0x68cD423F3077890FC84d68e7C7186dbbE7031Dd4/sources/contracts/patient.sol | Store patient details patient_id patient id _patient_name patient name _age age _gender gender _height height _weight weight _patient_address address _phone_no phone number _email_id mail id _date date/ | function store_patient_details(uint256 patient_id,string memory _patient_name,uint256 _age,string memory _gender,string memory _height,uint256 _weight,string memory _patient_address,uint256 _phone_no,string memory _email_id,uint256 _date)public isOwner {
p.patient_name=_patient_name;
... | 11,627,881 |
./partial_match/1/0x943039A588046cB4Fe0cDbb5Dd7BB61B729880a9/sources/contracts/interfaces/IOndoCoinlistDistributor.sol | Allows anyone to claim a token if they exist in a merkle root. Returns the ondo token address. Returns the merkle root of the merkle tree containing account balances available to claim. Returns true if the index has been marked claimed. Claim the given amount of the token to the given address. Reverts if the inputs are... | interface IOndoCoinlistDistributor {
function ondo() external view returns (address);
function merkleRoot() external view returns (bytes32);
function isClaimed(uint256 index) external view returns (bool);
function claim(
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkl... | 4,048,245 |
pragma solidity 0.5.11;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address w... | Send WRAP to withdraw their normalized value in DAI If we're not past the deposit lock time, we have to check signature | function withdraw(
uint256 _value,
uint8 v,
bytes32 r,
bytes32 s,
uint256 signatureValidUntilBlock
) external returns (bool success) {
if (depositLock[msg.sender] >= now) {
require(block.number < signatureValidUntilBlock);
require(
... | 1,047,630 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "./IPlus.sol";
/**
* @title Interface for composite plus token.
* Composite plus is backed by a basket of plus with the same peg.
*/
interface ICompositePlus is IPlus {
/**
* @dev Returns the address of the underlying token.
*/
functio... | Interface for composite plus token. Composite plus is backed by a basket of plus with the same peg./ | interface ICompositePlus is IPlus {
function tokens(uint256 _index) external view returns (address);
function tokenSupported(address _token) external view returns (bool);
function mint(address[] calldata _tokens, uint256[] calldata _amounts) external;
function redeem(uint256 _amount) external;
pragma... | 13,136,361 |
./full_match/5/0xCf86e56b395032163dd4Af966500e2F189f29637/sources/contracts/contracts-V6/src/StandardCampaign.sol | Enrol to project as worker when no application is required ✅ iscampaignrunning isprojectrunning ismoneyintended ismorethanenrolstake Get structs Can't be a worker already Create application | function workerEnrolNoApplication(
uint256 _id,
uint256 _stake
)
public
payable
isCampaignRunning(projects[_id].parentCampaign)
isProjectRunning(_id)
isMoneyIntended(_stake)
isMoreThanEnrolStake(_stake)
{
checkProjectExists(_id);
... | 7,070,522 |
/**
*Submitted for verification at Etherscan.io on 2021-02-07
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.12;
contract Governed {
event NewGov(address oldGov, address newGov);
event NewPendingGov(address oldPendingGov, address newPendingGov);
address public gov;
address public pendin... | Gov ONLY _newManager Manager to set on the set token/ | function setManager(address _newManager) external onlyGov {
setToken.setManager(_newManager);
}
| 7,965,173 |
./full_match/1/0x090b1DE324fEA5f0A0B4226101Db645819102629/sources/contracts/0xApes.sol | Remember to zero the pending refund before sending to prevent re-entrancy attacks | function withdraw() public nonReentrant() {
uint amount = pendingWithdrawals[msg.sender];
pendingWithdrawals[msg.sender] = 0;
_safeTransferETH(msg.sender, amount);
}
| 2,945,600 |
pragma solidity 0.5.11; // optimization runs: 200, evm version: petersburg
/**
* @title DTokenInterface
* @author 0age
* @notice Interface for dTokens (in addition to the standard ERC20 interface).
*/
interface DTokenInterface {
// Events bear similarity to Compound's supply-related events.
event Mint(address... | Deprecated./ | function accrueInterest() external {
revert("Interest accrual is longer supported.");
}
| 1,547,826 |
// This file is part of the Blockchain-based Fair Exchange Benchmark Tool
// https://gitlab.com/MatthiasLohr/bfebench
//
// Copyright 2021-2022 Matthias Lohr <mail@mlohr.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// Y... | function to verify Merkle Tree proofs | function vrfy(uint _index, bytes32 _value, bytes32[] memory _proof, bytes32 ciphertextRoot) public view returns (bool) {
for (uint i = 0; i < _proof.length; i++) {
if ((_index & 1 << i) >>i == 1)
_value = keccak256(abi.encodePacked(_proof[_proof.length - i - 1], _value));
... | 12,976,506 |
pragma solidity ^0.4.24;
contract SinglePaymentChannel {
address public alice;
address public bob;
uint256 public startDate;
uint256 public startChallengePeriod;
uint256 public challengePeriodLength = 15 minutes;
uint256 public amountDeposited;
uint256 public timeout = 1 days;
struct Payment {
u... | Used in case no messages get transferred from Alice to Bob or if Bob never sends back a signature acknowledging the value alice sent Before the timeout occurs, bob could send the message he received from alice and his own signature to close the channel Ensure we reached the timeout period Ensure the channel is not in t... | function TimeoutClose() external returns(bool) {
require(now > startDate + timeout , "timeout on the channel has not been reached");
require(startChallengePeriod == 0, "the channel is in the closed state");
alice.transfer(amountDeposited);
return true;
}
| 15,833,888 |
./full_match/3/0x4F7b47B972598ae54d405C4Faac05268A9247913/sources/contracts/ERC2981.sol | Check Writer Royalty | function royalty(uint256 tokenid, uint256 price) private view returns(address to,uint256 ro){
RoyaltyInfo memory royalties = _royalties[tokenid];
address receiver = royalties.recipient;
uint256 royaltyAmount = (price * royalties.amount) / 10000;
return (receiver,royaltyAmount);
}... | 8,112,159 |
./partial_match/1/0x4eD8FA5741340115b1De5002DE7502B9b166aDF6/sources/ERC721FullMintable.sol | Internal function to mint a new token Reverts if the given token ID already exists _to address the beneficiary that will own the minted token _tokenId uint256 ID of the token to be minted by the msg.sender/ | function _mint(address _to, uint256 _tokenId, string _url, string _input1, string _input2, string _input3) internal {
super._mint(_to, _tokenId);
_setTokenURI(_tokenId, _url);
tokenIDtometaData[_tokenId].data = _input1;
tokenIDtometaData[_tokenId].data1 = _input2;
tokenIDtometaData[_tokenId].d... | 11,019,502 |
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./EmergencyStop.sol";
/**
* Game contract of Tic Tac Toe game.
*/
contract TicTacToe is Ownable, EmergencyStop {
/**
* Game phases.
*/
enum GamePhase {
/** Players joining. */
Join,
... | Perform player turn for calling player & flag field at position./ | function playerTurn(uint8 x, uint8 y)
public
stoppedInEmergency onlyInPlayerTurnPhase onlyPlayer
returns (GamePhase) {
uint8 playerNum = getPlayerNum(msg.sender);
return playerTurnForNum(playerNum, x, y);
}
| 15,785,749 |
pragma solidity ^0.5.0;
// import "openzeppelin-eth/contracts/ownership/Ownable.sol";
import "zos-lib/contracts/Initializable.sol";
import "openzeppelin-solidity-2.1.1/contracts/math/SafeMath.sol";
contract Propose is Initializable {
using SafeMath for uint256;
//uint256 public proposerId;
//uint256 pu... | Get number of total proposer / | function getNumberOfTotalProposer() public view returns (uint) {
return proposers.length;
}
| 14,034,685 |
/**
*Submitted for verification at Etherscan.io on 2021-09-27
*/
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wra... | Private Withdraw send funds | function _withdraw(address _to, uint256 _amount) private {
payable(_to).transfer(_amount);
}
| 2,054,077 |
/**
*Submitted for verification at Etherscan.io on 2021-07-08
*/
// Sources flattened with hardhat v2.4.0 https://hardhat.org
// File contracts/auxiliary/interfaces/v0.8.4/IERC20Aux.sol
pragma solidity 0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Aux {
/**
... | Called to get the current staked tokens of the user userAddress User address return Current staked tokens of the user | function userStake(address userAddress)
public
view
override
returns (uint256)
{
return userShares(userAddress) * totalStake / totalShares();
}
| 2,456,783 |
// "SPDX-License-Identifier: Apache-2.0"
pragma solidity ^0.7.0;
/**
* Fixed point math library for signed integers
*/
library FixedPointMath {
int256 constant private INT256_MIN = -2 ** 255;
uint256 constant public PRECISION = 18;
uint256 constant public MULTIPLICATOR = 10 ** PRECISION;
/**
... | Returns the largest of two signed numbers./ | function max(int256 a, int256 b) internal pure returns (int256) {
return a >= b ? a : b;
}
| 5,385,643 |
pragma solidity ^0.4.18;
import "./ERC20.sol";
contract TimeLockedWallet {
address public creator;
address public owner;
uint256 public unlockDate;
uint256 public createdAt;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
constructor(
address _creator,
... | callable by owner only, after specified time, only for Tokens implementing ERC20now send all the token balance | function withdrawTokens(address _tokenContract) onlyOwner public {
require(now >= unlockDate);
ERC20 token = ERC20(_tokenContract);
uint256 tokenBalance = token.balanceOf(this);
token.transfer(owner, tokenBalance);
emit WithdrewTokens(_tokenContract, msg.sender, tokenBalance);
... | 6,452,761 |
./full_match/1/0xDcFD8b5180F3147E1F1dDeeceF6D6EfF0ed5ac73/sources/contracts/Token_v3.sol | Function to deposit ERC20 tokens of sender into the contract. tokenAddress The address of the ERC20 token to deposit. amount The amount of tokens to deposit. Before calling this function, the sender must approve this contract to spend the specified amount of tokens./ | function depositToken(address tokenAddress, uint256 amount) external whenNotPaused {
require(tokenAddress != address(0), "Invalid token address");
require(amount > 0, "Invalid amount");
IERC20 token = IERC20(tokenAddress);
uint256 balanceBefore = token.balanceOf(msg.sender);
require(balanceBef... | 4,921,548 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/IContractsRegistry.sol";
import "./interfaces/IBMIStaki... | Getting withdraw information return _amountBMIRequested is amount of bmi tokens requested to unlock return _amountStkBMI is amount of stkBMI that will burn return _unlockPeriod is its timestamp when user can withdraw returns 0 if it didn't unlocked yet. User has 48hs to withdraw return _availableFor is the end ... | function getWithdrawalInfo(address _userAddr)
external
view
override
returns (
uint256 _amountBMIRequested,
uint256 _amountStkBMI,
uint256 _unlockPeriod,
uint256 _availableFor
)
{
_unlockPeriod = whenCanWithdrawBMIRe... | 5,928,396 |
/*
Copyright 2021 Dolomite.
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 wr... | `accountNumber` `0` is at index `accountsLength - 1` solium-disable indentation solium-enable indentation | function _getActionArgsForModifyPosition(
ModifyPositionCache memory cache,
Account.Info[] memory accounts,
address[] memory pools
) internal view returns (Actions.ActionArgs[] memory) {
Actions.ActionArgs[] memory actions;
if (cache.params.depositToken == address(0)) {
... | 2,522,076 |
./partial_match/42/0xAf5d2BC0A47f0aE99b7E7225349e3d5C48F46Fd5/sources/STERegistryV1.sol | Sets the address of the owner/ | function _setUpgradeabilityOwner(address _newUpgradeabilityOwner) internal {
require(_newUpgradeabilityOwner != address(0), "Address should not be 0x");
__upgradeabilityOwner = _newUpgradeabilityOwner;
}
| 3,412,095 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.5;
/*
FrAactionHub v1.0
Quentin for FrAaction Gangs
*/
// ============ External Import: Inherited Contract ============
// NOTE: we inherit from an OpenZeppelin upgradeable contract
import {
ReentrancyGuardUpgradeable
} from "@openzeppelin/contracts-upgradeabl... | Initiate a funding round to buy an Aavegotchi or an item Emits a NewFunding event upon success; callable by anyone/ | function startPurchase(
bool _isNft,
bool _inGhst,
bool _baazaarPurchase,
uint256 _listingId,
uint256 _quantity,
uint256 _usedTreasury
) external {
require(
fundingStatus == FundingStatus.INACTIVE,
"startPurchase: funding already a... | 1,782,826 |
// File: contracts/interfaces/ISaffronBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.1;
interface ISaffronBase {
enum Tranche {S, AA, A}
enum LPTokenType {dsec, principal}
// Store values (balances, dsec, vdsec) with TrancheUint256
struct TrancheUint256 {
uint256 S;
uint256 AA;
ui... | LP user adds liquidity to the pool Pre-requisite (front-end): have user approve transfer on front-end to base asset using our contract address if (tranche == Tranche.AA) {} v1: AA tranche disabled (S tranche is effectively AA) Find capacity for S tranche to facilitate a deposit into A. Deposit is min(principal, capaci... | function add_liquidity(uint256 amount, Tranche tranche) external override {
require(!_shutdown, "pool shutdown");
require(tranche == Tranche.S || tranche == Tranche.A, "v1: can't add_liquidity into AA tranche");
uint256 epoch = get_current_epoch();
require(amount != 0, "can't add 0");
require(epoc... | 14,562,798 |
pragma solidity 0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
functio... | Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value. | function approve(address _spender, uint256 _amount)public returns (bool success) {
require( _spender != 0x0);
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
| 6,036,397 |
./full_match/1/0x70F2C0330528000BA806aE8F4254B45Ea980a34c/sources/contracts/core/RenovaQuest.sol | @inheritdoc IRenovaQuest | function depositAndEnter(
uint256 depositAmount
) external payable override nonReentrant {
_depositAndEnter(_msgSender(), depositAmount);
}
| 2,914,105 |
./partial_match/1/0xfE21d9467B11Dfdf1AEa295108F658E825b5067A/sources/contracts/RadbroWebringV2.sol | Set the RAD bonding curve config. | function setRADCurve(RadLinearCurve.RadCurve calldata _radCurve) external onlyOperator {
radCurve = _radCurve;
}
| 15,757,755 |
./full_match/5/0x0609Df316a292BfBbd581e668E6505E6De075C6C/sources/contracts/defi_otc_exchange.sol | Claim tokenAmount tokens for given tokenAddress from all limit order exectutions for caller | function claimTokens(address tokenAddress, uint256 tokenAmount) external nonReentrant {
uint256 claimableAmount = getClaimableTokens(msg.sender, tokenAddress);
if (claimableAmount < tokenAmount) revert ExceedsClaimableAmount();
claimableTokenAmounts[msg.sender][tokenAddress] -= tokenAmount;
if (!IERC20(tokenAd... | 11,599,587 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/... | this is import, every subsequent stake re-starts the time -to avoid stakers from back loading the investment.This encourages people to put all their money early in one go | function _stakeNft(address from) internal {
stakes[from].amount++;
stakes[from].stakeStart = block.timestamp;
}
| 5,432,306 |
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/u... | Ensure deposit amount is not more than maximum Ensure deposit period is at least MinDepositPeriod Apply fee to deposit amount Update totalDeposit Calculate interest Update funding related data Update totalInterestOwed Mint MPH for msg.sender Record deposit data for `msg.sender` | function _deposit(uint256 amount, uint256 maturationTimestamp) internal {
require(
amount >= MinDepositAmount && amount <= MaxDepositAmount,
"DInterest: Deposit amount out of range"
);
uint256 depositPeriod = maturationTimestamp.sub(now);
require(
... | 9,879,393 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../erc20/ERC20.sol";
import "../utils/SafeMath.sol";
import "../utils/Ownable.sol";
import "../utils/ReentrancyGuard.sol";
import "./GothTokenV2.sol";
contract GothStake is ERC20("GOTH Bits", "bGOTH"), Ownable, ReentrancyGuard {
using SafeMath for ui... | We can remove part of, or all of the share. This is also taken into consideration when minting the users reward based on how much they are removing from the pool. We update total staked in the pool here, we do this because the balance of the account might be different from the total actually entered by stakers, this wo... | function leave(uint256 share) public nonReentrant payable
{
require(msg.value >= leaveFee, "leave: supplied fee too little");
require(balanceOf(msg.sender) >= share, "leave: not enough bGOTH");
if (share == 0)
{
mintReward(msg.sender, balanceOf(msg.sender));
... | 12,656,076 |
./full_match/1/0x1a5474e63519Bf47860856F03f414445382DC3f1/sources/localhost/contracts/settings/StafiNetworkSettings.sol | Submit balances currently enabled (trusted nodes only) | function getSubmitBalancesEnabled() override public view returns (bool) {
return getBoolS("settings.network.submit.balances.enabled");
}
| 17,101,488 |
pragma solidity ^0.5.4;
import "zos-lib/contracts/Initializable.sol";
import "openzeppelin-eth/contracts/token/ERC20/IERC20.sol";
import "@statesauce/merkle-payments/contracts/PaymentPool.sol";
/**
* @title Dividend Payment Pool
* @dev Allows withdrawals of allocated dividends by bonded token holders
* Works with ... | Initialize contract paymentToken Token to recieve and track payments. owner Contract owner. Has exclusive rights to upload new merkle roots. | function initialize(IERC20 paymentToken, address owner) public initializer {
PaymentPool.initialize(paymentToken, owner);
}
| 12,758,162 |
./full_match/1/0x4E5b0cDC255D8DC0B4bB190429b60487C10205B4/sources/DVT.sol | uint256 tMarketing, | function _getRTransferAmount(
uint256 rAmount,
uint256 rFee,
uint256 tLiquidity,
uint256 tCharity,
uint256 currentRate
) private pure returns (uint256) {
uint256 rLiquidity = tLiquidity.mul(currentRate);
uint256 rCharity = tCharity.mul(currentRate);
... | 3,033,490 |
// SPDX-License-Identifier: UNLICENSED
/*
$$$$$$$\ $$\ $$\ $$\ $$\ $$$$$$$$\ $$\
$$ __$$\ $$ | $$ | \__| $$ | $$ _____|\__|
$$ | $$ | $$$$$$\ $$$$$$$\ $$$$$$$\ $$\ $$$$$$\ $$ | $$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$$\ $$$$$$\
$$$$$$... | See `IERC20.transferFrom`. Emits an `Approval` event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of `ERC20`; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `value`. - the caller must have allowance for ... | function transferFrom(address sender, address recipient, uint256 amount) override public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
| 7,242,169 |
./full_match/1/0xbfEC5787799A179a2ec84b255FD288962D135494/sources/contracts/router01/DexTracker.sol | sets disabled flag on a dex id the dex id to disable disabled the boolean denoting whether to disable or enable/ | function disableDex(uint256 id, bool disabled) external payable onlyOwner {
if (dexInfo[id].disabled == disabled) {
return;
}
dexInfo[id].disabled = disabled;
emit UpdateDex(msg.sender, id);
}
| 16,409,922 |
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY831() external view returns (uint256); //i... | inject NONSTANDARD NAMING | function LOG714(uint p0, address p1, bool p2, string memory p3) internal view { | 14,087,784 |
pragma solidity 0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a / b;
... | do the distribution of the token, in token transfertransfer(WALLET_FOUNDATION, ALLOC_FOUNDATION);transfer(WALLET_TEAM, ALLOC_TEAM);transfer(WALLET_PARTNER, ALLOC_PARTNER);transfer(WALLET_SALE, ALLOC_SALE); | function ZZZToken() public {
balances[msg.sender] = TOTAL_SUPPLY;
totalSupply = TOTAL_SUPPLY;
transfer(WALLET_ECOSYSTEM, ALLOC_ECOSYSTEM);
}
| 1,510,259 |
./partial_match/1/0xbc6a1af02c09fc1514B95eC98756ccAa95e8Af2e/sources/GEtherBridge.sol | Adjusts the reserve to match the configured collateralization ratio. It uses the reserve collateral to borrow a proper amount of the growth token reserve asset and deposit it. Or it redeems from the growth token and repays the loan. _roomAmount The amount of underlying token to be liquid after ... | function _adjustReserve(Self storage _self, uint256 _roomAmount) internal returns (bool _success)
{
uint256 _scalingRatio;
{
uint256 _reserveAmount = GC.fetchLendAmount(_self.reserveToken);
_roomAmount = G.min(_roomAmount, _reserveAmount);
uint256 _newReserveAmount = _reserveAmount.sub(_roomAmount);
_... | 2,651,124 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
uint256 constant SECONDS_IN_THE_YEAR = 365 * 24 * 60 * 60; // 365 days * 24 hours * 60 minutes * 60 seconds
uint256 constant MAX_INT = type(uint256).max;
uint256 constant DECIMALS18 = 10**18;
uint256 constant PRECISION = 10**25... | returns anonymous voting duration returns the whole voting duration returns how many time should pass before anyone could calculate a claim result returns true if a user can buy new policy of specified PolicyBook submits new PolicyBook claim for the user returns true if the claim with this index exists returns cl... | interface IContractsRegistry {
function getUniswapRouterContract() external view returns (address);
function getUniswapBMIToETHPairContract() external view returns (address);
function getWETHContract() external view returns (address);
function getUSDTContract() external view returns (address);
f... | 10,275,515 |
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import '../utils/ContractGuard.sol';
// Inheritance
import "../interfaces/ILpMigratorRecipient.sol";
import "../interfaces/IStakingRewa... | reward will be burned when users exit. get redeemable reward before exit. | function exit() public override checkUnlock {
getReward();
uint256 unredeemedReward = rewards[msg.sender].sub(rewardsPaid[msg.sender]);
_burnReward(msg.sender, unredeemedReward);
_withdrawFor(msg.sender, _balances[msg.sender]);
}
| 5,388,182 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "./TestimoniumCore.sol";
import "./RLPReader.sol";
/// @title Testimonium: A contract enabling cross-blockchain verifications (transactions, receipts, states)
/// @author Marten Sigwart, Philipp Frauenthaler, Leonhard Esterbauer, Markus Levonyak
/... | client must have enough stake to be able to submit blocks client has not enough unused stake -> check whether some of the blocks submitted by the client have left the lock period emit the 0x00 hash - what if this hash is really calculated? it is very very unlikely, but it is not safe - should be rather safe as the mapp... | function submitBlock(bytes memory rlpHeader) public {
if (getUnusedStake(msg.sender) < REQUIRED_STAKE_PER_BLOCK) {
cleanSubmitList(msg.sender);
if (getUnusedStake(msg.sender) < REQUIRED_STAKE_PER_BLOCK) {
emit SubmitBlock(0);
return;
}
... | 12,910,914 |
//Address: 0x25e3e38b52f604585a117abb2b408e64e1bdc074
//Contract name: SelfPayPreSale
//Balance: 0 Ether
//Verification Date: 10/4/2017
//Transacion Count: 75
// CODE STARTS HERE
pragma solidity ^0.4.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a ... | event for token purchase logging purchaser who paid for the tokens beneficiary who got the tokens value weis paid for purchase amount amount of tokens purchased/ | function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) public {
require(_startTime >= now);
require(_endTime >= _startTime);
require(_rate > 0);
require(_wallet != 0x0);
token = createTokenContract();
startTime = _startTime;
endTime = _endTime;
rate =... | 5,391,996 |
// SPDX-License-Identifier: MIT
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: YFIRewards.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ======... | Updates the vote lock on the sender _proposalEnd proposal end time/ | function updateVoteLock(uint256 _proposalEnd) private onlyStaker {
voteLocks[msg.sender] = Math.max(
voteLocks[msg.sender],
Math.max(_proposalEnd, voteLockDuration.add(block.timestamp))
);
}
| 2,517,641 |
./partial_match/1313161554/0x265afa847417D913BB240eE2115830f7355AA0B3/sources/StratNearPadV6.sol | it calculates how much 'rewardToken' the strategy is earning. | function pendingRewards() public view returns (uint256) {
uint256 _amount = IMasterChefPad(masterchef).pendingSushi(poolId, address(this));
return _amount;
}
| 16,935,354 |
/**
*Submitted for verification at Etherscan.io on 2022-05-01
*/
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// beca... | Verify SupplyMark ClaimedMint New PieceIncrement Counter | function MintPieceFix(
address to,
uint piece,
uint editions
) public onlyOwner{
require(PC[piece] <= Pmax, "All pieces have already been minted");
_setClaimed(piece);
_safeMint(to, PC[piece] + PC_Shift[piece]);
... | 8,048,106 |
pragma solidity ^0.5.0;
import "./GoAssetBank.sol";
import "./EvmAssetBank.sol";
import "../Oracle.sol";
import "../GoAssetBridge.sol";
/**
* @title BridgeBank
* @dev Bank contract which coordinates asset-related functionality.
* GoAssetBank manages the minting and burning of tokens which
* represent go... | : Exposes an item's current status. _id: The item in question. return: Boolean indicating the lock status./ | function getGoAssetDepositStatus(
bytes32 _id
)
public
view
returns(bool)
{
return isLockedGoAssetDeposit(_id);
}
| 12,900,017 |
// Sources flattened with hardhat v2.8.0 https://hardhat.org
// File contracts/interfaces/IUniswapV3Factory.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
/// @title The interface for the Uniswap V3 Factory
/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and cont... | Interface for WETH | interface IWETH is IERC20 {
function deposit() external payable;
function withdraw(uint256) external;
}
| 11,866,806 |
./full_match/42/0xA19C9b7fF7c8122298a239a223c9a8A8310faEdB/sources/localhost/Boardroom.sol | Create & add new snapshot BoardSnapshot memory newSnapshot = BoardSnapshot({ timestamp: now, rewardReceived: amount, totalShares: totalShare() });boardHistory.push(newSnapshot);cash.safeTransferFrom(msg.sender, address(this), amount);emit RewardAdded(msg.sender, amount); | function allocateSeigniorage(uint256 amount)
external
onlyOneBlock
onlyOperator
{
require(amount > 0, 'Boardroom: Cannot allocate 0');
}
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid... | 9,586,220 |
./full_match/1/0x6A9Eb4A409e6354BcEBb0DfABA1Eb33eB5e4d27B/sources/contracts/DistributionCreator.sol | Internal version of the `sign` function | function _sign(bytes calldata signature) internal {
bytes32 _messageHash = messageHash;
if (ECDSA.recover(_messageHash, signature) != msg.sender) revert InvalidSignature();
userSignatures[msg.sender] = _messageHash;
emit UserSigned(_messageHash, msg.sender);
}
| 8,485,032 |
./full_match/1/0x34b12B0381a2eE37b36e963529E7048504B1c48B/sources/contracts/ENSAvatarMirror.sol | Sets the address to a contract implementing the IENSAvatarMirrorDataReader interface. _dataReader The address of the new data reader contract. | function setDataReader(address _dataReader) external onlyRole(UPGRADER_ROLE) {
dataReader = IENSAvatarMirrorDataReader(_dataReader);
}
| 17,035,467 |
./partial_match/42/0xCD00E1eCcAbE7d01764273241E9972763BEc508c/sources/CreditProfilesRegister.sol | removes 'record' to 'database' index, record number (from 0)/ | function removeCreditProfileAtIndex(uint32 index) internal {
if (index >= creditProfiles.length) return;
if (index == creditProfiles.length -1){
creditProfiles.pop();
for (uint i = index; i < creditProfiles.length-1; i++){
creditProfiles[i] = creditProfil... | 3,379,646 |
/**
Source code of Opium Protocol
Web https://opium.network
Telegram https://t.me/opium_network
Twitter https://twitter.com/opium_network
*/
// File: LICENSE
/**
The software and documentation available in this repository (the "Software") is protected by copyright law and accessible pursuant to the licens... | Calling this function governor could propose new whitelist addresses array. Also it allows to initialize first whitelist if it was not initialized yet. Restrict empty proposals Consider empty whitelist as not initialized, as proposing of empty whitelists is not allowed If whitelist has never been initialized, we set wh... | function proposeWhitelist(address[] memory _whitelist) public onlyGovernor {
require(_whitelist.length != 0, "Can't be empty");
if (whitelist.length == 0) {
whitelist = _whitelist;
emit Committed(_whitelist);
proposalTime = now;
proposedWhitelist = _... | 1,368,127 |
pragma solidity 0.5.16;
import "../../base/sushi-base/MasterChefHodlStrategy.sol";
contract SushiHodlStrategyMainnet_USDT_WETH is MasterChefHodlStrategy {
address public usdt_weth_unused; // just a differentiator for the bytecode
constructor() public {}
function initializeStrategy(
address _storage,
... | A push mechanism for accounts that have not claimed their rewards for a long time. The implementation is semantically analogous to getReward(), but uses a push pattern instead of pull pattern. If it is a normal user and not smart contract, then the requirement will pass If it is a smart contract, then make sure that it... | function pushAllRewards(address recipient) public updateRewards(recipient) onlyGovernance {
bool rewardPayout = (!smartContractStakers[recipient] || !IController(controller()).greyList(recipient));
for(uint256 i = 0 ; i < rewardTokens.length; i++ ){
uint256 reward = earned(rewardTokens[i], recip... | 1,262,851 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be... | onDeposit() is used to control fees and accessibility instead having an implementation in each farm contract Deposit is only allowed, if farm is open and not not paused. _amount tokens the user wants to deposit return fee returns the deposit fee (1e18 factor)/ | function onDeposit(uint256 _amount)
external
view
override
returns (uint256 fee)
{
Farm storage farm = farms[msg.sender];
require(farm.farmStartedAtBlock > 0, 'caller not a farm');
require(farm.farmEndedAtBlock == 0, 'farm closed');
require(!farm.paused, 'farm paused');
_amount;
... | 13,773,690 |
pragma solidity ^0.4.11;
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including w... | Change bet expected end time | function setExpectedEnd(uint _EXPECTED_END) payable public onlyOwnerLevel {
require(_EXPECTED_END > EXPECTED_START);
EXPECTED_END = _EXPECTED_END;
CANCELATION_DATE = EXPECTED_END + 60 * 60 * 24;
RETURN_DATE = EXPECTED_END + 60 * 60 * 24 * 30;
}
| 935 |
/**
*Submitted for verification at Etherscan.io on 2021-10-11
*/
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Part: BalancerMathLib
library BalancerMathLib {
uint public constant BONE = 10 ** 18;
uint public constant MIN_BPOW_BASE = 1 wei;
uint pub... | pull from providers exit entire position If adjustment hits weight boundary, turn off trades. Adjust debt ratio manually until it's not at boundary anymore. | function adjustPosition() public onlyAllowed {
if (providerA.totalDebt() == 0 || providerB.totalDebt() == 0) return;
tokenA.transferFrom(address(providerA), address(this), providerA.balanceOfWant());
tokenB.transferFrom(address(providerB), address(this), providerB.balanceOfWant());
... | 7,900,883 |
//Address: 0x0FcF5C6b20577d48bA209e077975b9F2EaC55798
//Contract name: svb
//Balance: 0 Ether
//Verification Date: 1/6/2018
//Transacion Count: 12
// CODE STARTS HERE
/**
Contract interface:
1. Standars ERC20 methods: balanceOf, totalSupply, transfer, transferFrom, approve, allowance
2. Finction issue, argument amou... | charge recepient with demurring fee | function transfer(address to, uint amount) returns (bool) {
if (amount >= minTransfer
&& balances[msg.sender] >= amount
&& balances[to] + amount > balances[to]
) {
chargeDemurringFee(msg.sender);
if (balances[msg.sender] >= amount) {
... | 15,843,791 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.