file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// hevm: flattened sources of ./contracts/oracle/BondingCurveOracle.sol pragma solidity >=0.6.0 <0.7.0 >=0.6.0 <0.8.0 >=0.6.2 <0.7.0 >=0.6.2 <0.8.0; pragma experimental ABIEncoderV2; ////// ./contracts/external/SafeMathCopy.sol // SPDX-License-Identifier: MIT /* pragma solidity ^0.6.0; */ /** * @dev Wrappers over S...
read the oracle price return oracle price return true if price is valid price is to be denominated in USD per X where X can be ETH, etc. Can be innacurate if outdated, need to call `isOutdated()` to check
function read() external view override returns (Decimal.D256 memory, bool) { if (paused()) { return (Decimal.zero(), false); } (Decimal.D256 memory peg, bool valid) = _getOracleValue(); return (_thaw(peg), valid); }
13,474,420
./full_match/1/0x2d68676c40Bf820Eb84e3B7d8d77a1C473b08B61/sources/contracts/crossChainSwaps/CrossChainSwapsStorage.sol
admin's address who will sign the gas signatures
function gasSignatureAdmin() public view returns (address) { return _state.gasSignatureAdmin; }
17,067,035
// SPDX-License-Identifier: AGPL-3.0-only /* ValidatorService.sol - SKALE Manager Copyright (C) 2019-Present SKALE Labs @author Dmytro Stebaiev @author Artem Payvin @author Vadim Yavorsky SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Af...
Checks whether validator ID exists./
function validatorExists(uint validatorId) public view override returns (bool) { return validatorId <= numberOfValidators && validatorId != 0; }
10,226,677
./full_match/1/0x1624199B1027f5A758E11d899BDD6E6898C491D7/sources/browser/tests/4_Ballot_test.sol
------------------------------------------------------------------------ Get the number of tokens staked by a staker _staker the address of the staker ------------------------------------------------------------------------
function yourStakedYFICG(address staker) external view returns(uint256 stakedYFICG){ return stakers[staker].stakedTokens; }
3,022,565
./full_match/5/0xf8500311223b1B9b979139cf94693dd9DBf59C8f/sources/contracts/Contract.sol
Modifies the contract configuration parameters. _is_Max_Holding_Limited Defines whether the maximum holding limit is enabled or disabled. default: false _Max_Holding_Percent Defines the maximum allowed holding percentage. default: 5%/MAX_HOLDING_PERCENT = _Max_Holding_Percent;
function setConfig(bool _is_Max_Holding_Limited, uint256 _Max_Holding_Percent) external onlyOwner { IS_MAX_HOLDING_LIMITED = _is_Max_Holding_Limited; maxHoldingAmount = _Max_Holding_Percent * 10**15 * 10**18; }
1,901,714
./full_match/1/0x4838099e16FC56bFdD8a76B7Fb9f338513Dd1575/sources/contracts/CrashTrading.sol
Triggers stopped state. Requirements: - The contract must not be paused./
function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); }
3,103,513
./full_match/4/0xA513B3b0E4430Dd466860E3e7C58E5Cad22594a4/sources/contracts/ERC4907.sol
set the user and expires of a NFT The zero address indicates there is no user Throws if `tokenId` is not valid NFT user The new user of the NFT expires UNIX timestamp, The new user could use the NFT before expires
function setUser( uint256 tokenId, address user, uint64 expires ) public virtual { require( isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not owner nor approved" ); UserInfo storage info = _users[tokenId]; info...
809,751
./full_match/1/0x121D1001E456e74950D2730F1B395A677AcF4F39/sources/contracts/vaults/erc20/strategies/DAOStrategyConvex.sol
Allows the admin to deposit all want tokens held by this contract on convex
function deposit() public override onlyRole(DEFAULT_ADMIN_ROLE) { ConvexConfig memory convex = convexConfig; convex.booster.depositAll(convex.pid, true); }
16,537,183
./partial_match/1/0x0415023846Ff1C6016c4d9621de12b24B2402979/sources/contracts/BoosterEarmark.sol
Call addPool on booster/
function addPool(address _lptoken, address _gauge) external onlyOwner returns (uint256) { uint256 pid = booster.addPool(_lptoken, _gauge); approvePoolDistributionTokens(pid); return pid; }
2,618,873
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; // File: @openzeppelin/contracts/utils/Context.sol /* * @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 shou...
Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is forwarded in {IERC721Receiver-onERC721Received} to contract recipients./
function _safeMint( address to, uint256 tokenId, string memory uri, bytes memory _data ) internal virtual { _mint(to, tokenId, uri); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver im...
117,300
./full_match/11155111/0x8a93f5277Ad156Ce40dBDCA31cE5a2EaA8814925/sources/contracts/Artify.sol
Function to register as a buyer
function registerBuyer() external { require(buyers[msg.sender] == false, "Already registered as a buyer"); buyers[msg.sender] = true; }
3,812,557
./full_match/80001/0xfa452eA12B51B85152CB9646FfD710aF675D5724/sources/contracts/StakingToken.sol
total staking token total reward token
function stake(address stakingToken_, uint256 amount_) public nonReentrant { require(amount_ > uint256(0), "Stake: invalid value"); require( stakingToken_ != address(0), "Stake: Zero address stakingToken" ); require( configTokens[stakingToken_].can...
9,473,011
// Mainnet Live //SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./lib/ERC20.sol"; import "./lib/SafeMath.sol"; import "./lib/IERC20.sol"; import "./lib/Ownable.sol"; interface ISorbettiere { function pendingIce(uint256 _pid, address _user) external view returns (uint256); function deposit(uin...
Calculate Compounding Ice🍧 reciept tokens for a given amount of ICE If contract is empty, use 1:1 ratio Could return zero shares for very low amounts of ICE amount of ICE return amount of Compounding Ice🍧 reciept tokens/
function getSharesPerDepositTokens(uint amount) public view returns (uint) { if (totalSupply().mul(totalDeposits) == 0) { return amount; } return amount.mul(totalSupply()).div(totalDeposits); }
5,371,117
./partial_match/1/0xC2D019b901f8D4fdb2B9a65b5d226Ad88c66EE8D/sources/Shell.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom(ShellStorage.Shell storage shell, address sender, address recipient, uint256 amount) external returns (bool) { _transfer(shell, sender, recipient, amount); _approve(shell, sender, msg.sender, sub(shell.allowances[sender][msg.sender], amount, "Shell/insufficient-allowance")); ...
3,991,425
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "./OracleGetter.sol"; import "./ERC20.sol"; import "./Inflation.sol"; import "hardhat/console.sol"; /** @author Tellor Inc. @title Chorus @dev Chorus is a structure for issuing semi-stablecoins as community currencies **/ // slither-disable-next-line m...
A view funciton to look at the collateralization of the system return uint256 collateral token balance of this address / totalSupply/ slither-disable-next-line incorrect-equality
function collateralRatio() public view returns (uint256) { uint256 _collateralBalance = collateralToken.balanceOf(address(this)); if(totalSupply() == 0 || _collateralBalance == 0) { return 0; } uint256 _collateralValue = wmul(collateralPrice(), _collateralBalance); ...
6,418,376
pragma solidity ^0.4.24; // 22.07.18 //*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/ // // Ethertote token contract // // (parts of the token contract // are based on the 'MiniMeToken' - Jordi Baylina) // // Fully ERC20 Compliant token // // Name: Ethert...
_spender is the address of the contract able to transfer the tokens _amount is the amount of tokens to be approved for transfer return 'true' if the function call was successful ----------------------------------------------------------------------------
function approveAndCall(address _spender, uint256 _amount, bytes _extraData ) public returns (bool success) { require(approve(_spender, _amount)); ApproveAndCallFallBack(_spender).receiveApproval( msg.sender, _amount, this, _extraData ); ...
7,216,099
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; ...
inject NONSTANDARD NAMING
function CLAIM_REWARDS536() external;
12,569,029
./full_match/97/0x0c92B98Ecf4405b98f32B582C5288b3949F1276F/sources/project_/contracts/PiemeStaking.sol
Admin adds those that have swapped pieAmount amount they swapped to Owner address/
function addSwappers(uint256 pieAmount, address to) external onlyOwner returns (bytes32) { bool pay = false; return _openPosition(to, pieAmount, block.timestamp, pay); }
3,287,296
// SPDX-License-Identifier: AGPL-3.0-only /** * ERC1155Example.sol - SKALE Interchain Messaging Agent Test tokens * Copyright (C) 2021-Present SKALE Labs * @author Christine Perry * @author Artem Payvin * * SKALE IMA is free software: you can redistribute it and/or modify * it under the terms of the...
allow minter set a global limit of tokens/
function setGlobalLimit(uint256 _newLimit) public onlyMinter { globalLimit = _newLimit; }
2,557,944
// SPDX-License-Identifier: MIT pragma solidity ^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 the one...
Claim the reward for the caller./
function claimReward() external nonReentrant { claimRewardInternal(); }
1,532,386
/* Copyright 2020 Set Labs Inc. 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...
Redeems a rebalancing SetToken into the base components of the base SetToken. If a supported cToken, then base components are redeemed for the underlying and sent back to user. If wrapEth is true, unwraps wrapped ether and sends eth to the user. _rebalancingSetAddress Address of the rebalancing Set to redeem _re...
function redeemRebalancingSetInternal( address _rebalancingSetAddress, uint256 _rebalancingSetQuantity, address _baseSetAddress, bool _keepChangeInVault, bool _unwrapEth ) private { validateRebalancingSetIssuance(_rebalancingSetAddress, _rebalancingSet...
12,600,718
./full_match/5/0xb930019Fe0a8F0C74635Fe2DC6A45E8D20B6f497/sources/MasterChef_flat.sol
validations It is an array consisting of below data points : contract address on which event is fired Array : unique id for event fired --- hash of event signature from to value - transferred value Here we get all the events fired in the receipt. TODO: Discuss and add ...
function deposit( uint256 _pid, bytes32 _trustedBlockhash, bytes memory _rlpEncodedBlockHeader, bytes memory _rlpEncodedReceipt, bytes memory _receiptPath, bytes memory _receiptWitness, uint8 _transferEventIndex, bytes32 _receiptsRoot ) pub...
1,884,127
./partial_match/1/0x8744D3722dF942C8541956B716E231e70C47E054/sources/contracts/interfaces/INFTOracleGetter.sol
function getNFTPriceFromLink( address asset) external view returns (uint256);
interface INFTOracleGetter { @dev returns the asset price in ETH function getAssetPrice(address asset) external view returns (uint256); pragma solidity 0.8.4; @title INFTOracleGetter interface }
3,931,652
// SPDX-License-Identifier: MIT pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; import "https://github.com/vigilance91/solidarity/contracts/accessControl/iAccessControl.sol"; import "https://github.com/vigilance91/solidarity/contracts/accessControl/AccessControlABC.sol"; /// /// @title Access Contro...
return {uint256} the number of accounts that have `role`, can be used together with {getRoleMember} to enumerate all bearers of a role
function getRoleMemberCount( bytes32 role )public view override returns( uint256 ){ return _roleAt(role).members.length(); }
2,478,987
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/introspection/IERC165.sol /** * @title IERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface IERC165 { /** * @notice Query if a contract implements an interface * @param interfaceId The interfa...
Internal function to clear current approval of a given token ID Reverts if the given address is not indeed the owner of the token _owner owner of the token _tokenId uint256 ID of the token to be transferred/
function _clearApproval(ERC721Data storage self, address _owner, uint256 _tokenId) internal { require(ownerOf(self, _tokenId) == _owner); if (self.tokenApprovals[_tokenId] != address(0)) { self.tokenApprovals[_tokenId] = address(0); } }
7,283,996
./full_match/1/0xaa282C8aB681fbD501A2B8fA0Ea558cbF5785F73/sources/contracts/AvocadoMultisig/AvocadoMultisigCore.sol
executes `actions_` with respective target, calldata, operation etc. IMPORTANT: Validation of `id_` and `_transientAllowHash` is expected to happen in `executeOperation()` and `_callTargets()`. catches out of gas errors (as well as possible), reverting with `AVO__OUT_OF_GAS`. reverts with action index + error code in c...
function _executeActions(Action[] memory actions_, uint256 id_, bool isFlashloanCallback_) internal { _resetTransientStorage(); bool isDelegateCallId_ = id_ == 1 || id_ == 21; if (isDelegateCallId_) { assembly { } } uint256 actionsLength_ = actions_....
3,129,020
./full_match/5/0xEE2FC4056a27621a31C90cBa0cC4673C3c813A85/sources/_faktura-art/acs-erc721a-upgradeable/contracts/ERC721AUpgradeable.sol
Mints `quantity` tokens and transfers them to `to`. Requirements: - `to` cannot be the zero address. - `quantity` must be greater than 0. Emits a {Transfer} event for each mint./ Overflows are incredibly unrealistic. `balance` and `numberMinted` have a maximum limit of 264. `tokenId` has a maximum limit of 2256. Update...
function _mint(address to, uint256 quantity, uint256 sales, uint256 category) internal virtual { uint256 startTokenId = ERC721AStorage.layout()._currentIndex; uint256 startSalesId = ERC721AStorage.layout()._currentSalesIndex[sales]; uint256 startCategoriesId = ERC721AStorage.layout()._curren...
11,613,261
pragma solidity 0.5.11; // optimization runs: 200, evm version: petersburg interface DTokenInterface { event Mint(address minter, uint256 mintAmount, uint256 mintTokens); event Redeem(address redeemer, uint256 redeemAmount, uint256 redeemTokens); function mint(uint256 underlyingToSupply) external returns (uint...
Transfer `amount` Dai from `msg.sender` to this contract, use them to mint cDAI, and mint dTokens with `msg.sender` as the beneficiary. Ensure that this contract has been approved to transfer the Dai on behalf of the caller. daiToSupply uint256 The amount of dai to provide as part of minting. return The amount of dDai...
function mint( uint256 daiToSupply ) external accrues returns (uint256 dDaiMinted) { dDaiMinted = daiToSupply.mul(_SCALING_FACTOR).div(_dDaiExchangeRate); require( _DAI.transferFrom(msg.sender, address(this), daiToSupply), "Dai transfer failed." ); require(_CDAI.mint(daiToSupply) =...
12,607,688
./partial_match/1/0x42F1e313E544857047673872e2B4dc4822F6caF7/sources/VMRDepo.sol
0 - balance ether 1 - balance VMR 2 - balance investor 3 - rewards started (0 if still depo period) 4 - effective user tokens 5 - current epoch (first epoch started after delayBeforeRewardWithdrawn period) - we not need it 6 - current user reward 7 - pending user reward in next epoch - we not need it 8 - max total VMR ...
function getInfo(address investor, uint256 _state) view external returns (uint256[14] memory ret) { if (_state == 0) _state = currentState; GlobalState storage dataState = states[_state - 1]; ret[0] = address(this).balance; ret[1] = TokenVMR.balanceOf(address(this)); ...
2,811,455
./full_match/1/0x13Bdb00E3Ad547aD392E9B4f1f91EDE8ACDb77CF/sources/contracts/CIV-Vault.sol
Continues the process of distributing shares for a specific strategy, if possible. This function is only callable by the contract owner. _id The _id of the strategy for which to continue distributing shares./ Check if there's anything to distribute
function continueDistributingShares( uint _id ) external nonReentrant onlyOwner checkStrategyExistence(_id) { EpochInfo memory epoch = _epochInfo[_id][ _strategyInfo[_id].lastProcessedEpoch ]; require(epoch.VPS > 0, "ERR_V.27"); require(epoch.lastDepositorProc...
9,693,365
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import { FlashLoanReceiverBase } from "@aave/contracts/flashloan/base/FlashLoanReceiverBase.sol"; import { ILendingPoolAddressesProvider } from "@aave/contracts/interfaces/ILendingPoolAdd...
buy low on paraswap, sell high on curve trnasfer profit out and set storage variables to 0
function arbitrageParaswap( uint256 _i, uint256 _j, uint256 _dx, uint256 _min_dy, uint256 _deadline, bytes memory _paraswap_calldata ) public { (bool success, bytes memory returnData) = PARASWAP_ADDR.call(_paraswap_calldata); CRYPTO_SW...
13,093,148
pragma solidity ^0.5.0; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; /// @title A contract to store proof of documents and verify their existence /// @author John H. Yu /// @notice This is an assignment from ConsenSys Academy Blockchain Developer Bootcamp Spring 2019 course /// @dev Proof can be c...
calculate and store the proof for a document Notarize data of a document This function burns a lot of gas. Consider calculate the hash offline then submit it using [addProof] name the name of the document tags the tags of the document size the size of the document contentType the content type of the document doc...
function notarize(string calldata name, bytes32 tags, uint size, bytes32 contentType, string calldata document) external whenNotPaused returns (bool) { bytes32 proof = proofFor(document); if (hasProof(proof)){ revert("This document has been Notarized before!"); } proofDocInfo[proof]...
13,021,565
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "./interfaces/IQuantumArt.sol"; import "./interfaces/IQuantumMintPass.sol"; import "./interfaces/IQuantumUnlocked.sol"; import "./interfaces/IQuantumKeyRing.sol"; import "./ContinuousDutchAuction.sol"; import "@rari-capital/solmate/src/auth/Auth.sol"; imp...
using this interface because has balanceOf
function _isPrivileged(address user) internal view returns (bool) { uint256 length = privilegedContracts.length; unchecked { for(uint i; i < length; i++) { if (IQuantumArt(privilegedContracts[i]).balanceOf(user) > 0) { return true; } ...
330,852
./partial_match/1/0x11D635bbba3f9B8f7C9b91cA9f315a2207cb5AD5/sources/dHealthToken.sol
Method called by anyone to withdraw funds to exchanges wallet after locking period/ check if time has reached ensure that tokens are not already transferred transfer tokens to wallet and change status to prevent double transfer
function withdrawExchangesToken() public { require(exchangesLockEndingAt <= getBlockTime()); require(exchangesStatus == false); bytes memory empty; token.transfer(exchangesWallet, exchangesTokens, empty); exchangesStatus = true; }
9,236,448
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@solidstate/contracts/token/ERC721/ERC721.sol"; import "@solidstate/contracts/token/ERC721/metadata/ERC721Metadata.sol"; import "../../BaseCharacterStorage.sol"; import "../../CharacterSkillsStorage.sol"; // import "../../AccessControlStorage.sol"; im...
TODO send eth directly to developer fund multisig TODO randomize stats TODO increment tokenId internally
function mintGenesisCharacterWithEmpathy( address player, uint256 tokenId, uint256 ethDonationAmount ) public payable { dlc = DLC(0x69bdE563680f580A2da5b5d4E202ecA4FDF35664); require(dlc.balanceOf(player) >= 10 * 10**18, "mintGenesisCharacter: Love balance is not enough"); require(totalSuppl...
14,017,375
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import {Modifiers, ItemType, WearableSet, NUMERIC_TRAITS_NUM, EQUIPPED_WEARABLE_SLOTS, AavegotchiCollateralTypeInfo} from "../libraries/LibAppStorage.sol"; import {AavegotchiCollateralTypeIO} from "../libraries/LibAavegotchi.sol"; import {LibERC1155} from "../../s...
Allow the Diamond owner or DAO to create a new Haunt Will throw if the previous haunt is not full yet _hauntMaxSize The maximum number of portals in the new haunt _portalPrice The base price of portals in the new haunt(in $GHST) _bodyColor The universal body color applied to NFTs in the new haunt
function createHaunt( uint24 _hauntMaxSize, uint96 _portalPrice, bytes3 _bodyColor ) external onlyDaoOrOwner returns (uint256 hauntId_) { uint256 currentHauntId = s.currentHauntId; require( s.haunts[currentHauntId].totalCount == s.haunts[currentHauntId].hauntM...
15,819,578
pragma solidity 0.5.16; contract MinimalInitializableProxyFactory { event ProxyCreated(address indexed implementation, address proxy); function create(address target) external { address clone = createClone(target); emit ProxyCreated(target, clone); } function createAndCall(address target, string call...
taken from: https:github.com/optionality/clone-factory/blob/ffa4dedcec53b68b11450b07685b4df80c33edcc/contracts/CloneFactory.solL43
function isClone(address target, address query) internal view returns (bool result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000) mstore(add(clone, 0xa), targetBytes) mstore...
1,762,335
./partial_match/1/0xaf20F01d515BD95FeF560b8DD49b493af180bDA6/sources/ERC20.sol
Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
function _mint(address account, uint256 amount) internal virtual { _totalSupply += amount; unchecked { _balances[account] += amount; } emit Transfer(address(0), account, amount); }
9,290,329
./full_match/5/0xFbA773E62662FD861AD9Aa7667D9C03b3C5A11a6/sources/contracts/Wrapper.sol
Unwrap to get the original back
function unwrap(uint256[] calldata tokenIds_) external { uint256 _balance; for (uint256 i = 0; i < tokenIds_.length; i++) { _safeTransfer(msg.sender, address(this), tokenIds_[i], ""); } if (_balance == 0) { }
1,859,001
/** *Submitted for verification at Etherscan.io on 2021-10-20 */ // File: contracts/utils/SafeMath.sol // SPDX-License-Identifier: MIT 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. /**...
If goal is Reached then change to change to ICO Stage etc.) _beneficiary Address receiving the tokens _weiAmount Value in wei involved in the purchase/
function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal virtual override { super._updatePurchasingState(_beneficiary, _weiAmount); }
6,503,112
//SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns th...
Add unique whitelisted addresses
function addUniqueWL (address[] calldata _addresses, uint[] calldata ids) external onlyOwner{ for (uint i ; i<_addresses.length ; i++) uniqueWL[_addresses[i]] = ids[i]; }
14,412,509
./full_match/3/0xE313169BE04aB3807c0Bd6B4AcaaEd5133387A47/sources/contracts/1_Storage.sol
IERC20(token1address).balanceOf(address(this)),
function getBalance() public view returns(uint256, uint256) { return ( address(this).balance, IERC20(token1address).balanceOf(address(this)) ); }
8,171,657
./partial_match/1/0x5d3AC83258dC3d609e9a5740ECCF8F03812022Cf/sources/Shethereum.sol
Write OnlyOwners functions
function AddSharedOwner(address account) public onlySharedOwners { setSharedOwner(account); _isExcludedFromFees[address(account)] = true; _isExcludedFromMaxTx[address(account)] = true; _isWhitelisted[address(account)] = true; }
16,030,704
./full_match/1/0x0E6641E62BAA87d77E01aB1C7e9d2F323f26942B/sources/contracts/ASETc.sol
Sets the unstaking cooldown period in days. _cooldownInDays The cooldown period in days./
function setUnstakingCooldown(uint256 _cooldownInDays) external onlyOwner { require(_cooldownInDays >= 0, "Cooldown should be non-negative"); unstakingCooldown = _cooldownInDays * 1 days; emit UnstakingCooldownUpdated(unstakingCooldown); }
8,421,225
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, addr...
When creator made product, must need to use this fuction for register his product first /
function registerNewProduct(uint256 product_idx,string new_guid,string product_descriptions,string hash) public returns(bool success) { uint256 amount = 1 * 10 ** uint256(decimals); Product_genuine storage mine = MyProducts[msg.sender][product_idx]; req...
7,315,243
./full_match/5/0xBFeF7Df8118a39A1BE06Ba7f02739B4E904A37B2/sources/contracts/GodFundArt.sol
fetch all campaigns: we create a new var containing a array of compaign structures. So in this case, we're not getting the campaigns but rather we create an array with as many as they are actual campaigns.now we loop into storage to look after campaign and populate that var
function getCampaigns() public view returns (Campaign[] memory) { Campaign[] memory allCampaigns = new Campaign[](numberOfCampaigns); for(uint i = 0; i < numberOfCampaigns; i++) { Campaign storage item = campaigns[i]; allCampaigns[i] = item; } return allC...
1,928,111
//Address: 0x1fc52f1abade452dd4674477d4711951700b3d27 //Contract name: NokuMasterToken //Balance: 0 Ether //Verification Date: 4/9/2018 //Transacion Count: 627 // CODE STARTS HERE pragma solidity 0.4.13; contract Burnable { event LogBurned(address indexed burner, uint256 indexed amount); function burn(uint...
Mint vested tokens. _to The address that will receieve the minted vested tokens. _amount The amount of tokens to mint. _startTime When the vesting starts as timestamp in seconds from Unix epoch. _duration The duration in seconds of the period in which the tokens will vest. return A boolean that indicates if the ope...
function mintVested(address _to, uint256 _amount, uint256 _startTime, uint256 _duration) public onlyOwner canMint returns (TokenVesting tokenVesting) { TokenVesting vesting = new TokenVesting(_to, _startTime, 0, _duration, true); mint(vesting, _amount); return vesting; }
5,449,515
/** *Submitted for verification at Etherscan.io on 2022-02-17 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. ...
this will set the beneficiary with vesting parameters provided account address of the beneficiary for vesting amount totalToken to be vested cliff In seconds of one period in vesting duration In seconds of total vesting startAt UNIX timestamp in seconds from where vesting will start/
function setVesting(address account, uint256 amount, uint256 cliff, uint256 duration, uint256 startAt ) external returns(bool){ VestedToken storage vested = vestedUser[account]; if(vested.start > 0){ require(vested.revoked); uint unclaimedTokens = _vestedAmount(account)....
10,883,084
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4 <0.9.0; import '../../interfaces/IKeep3rHelper.sol'; import '../../interfaces/peripherals/IKeep3rParameters.sol'; import './Keep3rAccountance.sol'; import './Keep3rRoles.sol'; abstract contract Keep3rParameters is IKeep3rParameters, Keep3rAccountance, Keep3rRole...
@inheritdoc IKeep3rParameters
function setBondTime(uint256 _bondTime) external override onlyGovernance { bondTime = _bondTime; emit BondTimeChange(_bondTime); }
1,770,112
./full_match/4/0x04Fc73b6806b85Ff50fdb84918DD367FE8Db24d8/sources/browser/revshare25.sol
Remove item in store bytes memory paymentPointerName;
function remove(uint key) public onlyOwner returns (uint size) { string memory name; (, uint revShareValue, bytes memory paymentPointerName) = data.iterate_get(key); data.remove(key); name = string(paymentPointerName); emit Paymen...
767,309
./full_match/1/0x558055ae71ee1BC926905469301a232066eD4673/sources/contracts/ProtocolGovernance.sol
@inheritdoc IProtocolGovernance
function hasPermission(address target, uint8 permissionId) external view returns (bool) { return ((permissionMasks[target] | _params.forceAllowMask) & (1 << (permissionId))) != 0; }
4,904,548
pragma solidity ^0.5.0; import "./SafeMath.sol"; import "./Pausable.sol"; contract SalePlace is Pausable{ using SafeMath for uint; struct Item { string name; string image; string description; uint price; uint numberOfItems; uint timestamp; address payable seller; } /* Staus Enum...
Function called by seller to set item status to shipped Emits LogShipped Needs to be seller of the itemto access the function _invoiceId id of the invoice id of item sold return true if items is udpated to shipped status
function shipItem(string memory _invoiceId) public returns(bool){ require(itemsSold[_invoiceId].status == Status.Processing, 'Item already shipped'); require(items[itemsSold[_invoiceId].itemId].seller == msg.sender, 'Action restricted to seller only'); itemsSold[_invoiceId].status = Status.Shipped; ...
15,787,821
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Context.sol pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they shou...
Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the total shares and their previous withdrawals./
function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = address(this).balance.add(_totalReleased); uint256 payment = totalReceived.mul(_shares[account]).div(_totalShares).sub( _released[accou...
1,451,367
./full_match/1/0xABF3e9F15a4529bf1769EAB968250c9243A8E7C1/sources/contracts/CapsuleToken.sol
Mints a Capsule to sender, saving gas by not setting text. to Color of Capsule. color Color of Capsule. font Font of Capsule. return capsuleId ID of minted Capsule.
function mintAsOwner( address to, bytes3 color, Font calldata font, bytes32[8] calldata text ) external payable onlyOwner onlyImpureColor(color) nonReentrant returns (uint256) { return _mintCapsule(to, color, font, text)...
3,144,984
./full_match/44787/0x0f68d51fE634d2dCF3C958B46A69b6Ca8086234B/sources/project_/contracts/CASRegistryManager.sol
create claim for a project (give FCRU to it) projectOutput ( projectAddress: bytes(address), bundleId: bytes(string), bundleVolume: bytes(int), unitType: bytes(string), metadataUrl: bytes(string) projectAddress: bytes(address) ) bufferOutput ( bufferAddress: bytes(address), outputBundl...
function processClaim(bytes[] calldata projectOutput, bytes[] calldata bufferOutput) external checkAccess checkTokenType(projectOutput, "FCRU") checkTokenType(bufferOutput, "FCRU") { IProject(projectContractAddress).addBundleVolume(projectOutput); IBundle(bufferContractAddress).addBundleVolu...
13,288,876
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import { FirstPrice } from "./Auction.sol"; /// @title Marketplace for selling items /// @author Aakash Jain, Ishaan Shah, Zeeshan Ahmed /// @notice View, sell, and buy items /// @dev It is assumed that the seller will deliver ...
Function to reveal a bid made for a listing Triggers the event for logging itemId The item the buyer wants to buy value The value of bid made by the bidder
function revealListing(uint itemId, uint value) external returns(bool) { require(listings[itemId].auction.fetchBidFromAddress(msg.sender).blindedBid != 0, "Not bidded"); bool successful = listings[itemId].auction.reveal(value, msg.sender); emit ListingReveal( listin...
937,432
./full_match/84531/0x6F17d3aB4c1c2620E6851baE0D8E3393c4b4d799/sources/SushiDigg.sol
Remove the vault from your index
function remove(string memory version, address vault) public { bool removed = vaults[msg.sender][version].remove(vault); if (removed) { emit RemoveVault(msg.sender, version, vault); } }
14,302,982
/*******Start*********/ pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract AltCurrency { // Public variables of the token string public name = "AltCurrency"; string public symbol = "ALTC"; uint8 public decima...
Internal transfer, only can be called by this contract/ Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Save this for an assertion in the future Subtract from the sender Add the same to the recipient Asserts are used to use static analysis to find bugs in your code...
function _transfer(address _from, address _to, uint _value) internal { require(_to != 0x0); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; balanceOf[_from] -= _value; balanceOf[_to] += _value; Transfer(_from, _to, _value...
1,687,105
/* Copyright 2018 bZeroX, LLC Inspired by TokenRegistry.sol, Copyright 2017 ZeroEx Intl. 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 ...
Returns an array of oracle addresses, an array with the length of each oracle name, and a concatenated string of oracle names return Array of oracle names, array of name lengths, concatenated string of all names
function getOracleList() public view returns (address[], uint[], string) { if (oracleAddresses.length == 0) return; address[] memory addresses = oracleAddresses; uint[] memory nameLengths = new uint[](oracleAddresses.length); string memory all...
1,063,332
./partial_match/1/0xeeCA1837ee81cced9c9Be9243Be8727e3363CA73/sources/Coin.sol
See {IERC20-totalSupply}./
function totalSupply() public view virtual returns (uint256) { return _MYtotalSupply; }
2,699,456
// SPDX-License-Identifier: MIT // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally ava...
Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`./totalFee = amount / 40;
function _transfer( address sender, address recipient, uint256 amount ) internal virtual override { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); ...
518,779
./full_match/1/0x977D360c3FbE1533eFEde3619dC74Ad0950FFc4f/sources/contracts/BondSwap/Exchange/BondsMarketplace.sol
Match ask with a taker bid order using ETH takerBid taker bid order makerAsk maker ask order/ If not enough ETH to cover the price, use WETH
function matchAskWithTakerBidUsingETHAndWETH( OrderTypes.TakerOrder calldata takerBid, OrderTypes.MakerOrder calldata makerAsk ) external payable override nonReentrant { require((makerAsk.isOrderAsk) && (!takerBid.isOrderAsk), "Order: Wrong sides"); require(makerAsk.currency == WETH, "Order: Currency must be ...
16,426,663
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event ...
Returns the confirmation status of a transaction. transactionId Transaction ID. return Confirmation status.
function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } }
10,044,339
// Copyright (C) 2021 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // T...
Implementation of EIP 1271. Should return whether the signature provided is valid for the provided data. _msgHash Hash of a message signed on the behalf of address(this) _signature Signature byte array associated with _msgHash/
function isValidSignature(bytes32 _msgHash, bytes memory _signature) external view returns (bytes4) { require(_signature.length == 65, "TM: invalid signature length"); address signer = Utils.recoverSigner(_msgHash, _signature, 0); require(_isOwner(msg.sender, signer), "TM: Invalid signer"); ...
2,524,222
pragma solidity ^0.4.15; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ 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 ...
Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. _spender The address which will spend the funds. _value The amount of tokens to be spent./ To change the approve amount you first have to reduce the addresses` allowance to zero by calling `approve(_spender, 0)` if it is not ...
function approve(address _spender, uint256 _value) returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
15,106,453
pragma solidity ^0.4.11; /* * Ownable * * Base contract with an owner. * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner. */ contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier on...
Transfer residual B coupons to entities which integrates FedCoup. It's investment on entities to integrate FedCoup on their sales lifecycle./
function transferResidualScoupons(address _to, uint _numberOfScoupons) external onlyOwner { residualScoupons = residualScoupons.sub( _numberOfScoupons ); balance_S_coupons[ _to ] = balance_S_coupons[ _to ].add( _numberOfScoupons ); TransferResidual_B_coupons(msg.sender, _to, _numberOfScou...
7,226,484
./full_match/5/0xbd2b42146E75dDc07c29888DAec04Fb176889685/sources/contracts/ArtStation_v0.2.sol
Buy offered NFT. _tokenId ID of NFT./
function buy(uint256 _tokenId) public { require(tokensForSale[_tokenId] == true, "ArtStation: Token not for sale."); _transfer(_ownerOf(_tokenId), msg.sender, _tokenId); }
1,940,044
pragma solidity ^0.4.23; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256)...
Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. _beneficiary Address receiving the tokens _tokenAmount Number of tokens to be purchased/
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { _deliverTokens(_beneficiary, _tokenAmount); }
170,771
./full_match/4/0x81378b13F4cB99297d4D6e327fD8DEca61c05f81/sources/localhost/contracts/libraries/SafeMath.sol
Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend)./
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
709,465
/* Copyright 2019,2020 StarkWare Industries Ltd. 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 https://www.starkware.co/open-source-license/ Unless required by applicable law or agre...
Copy input from calldata to memory. Initialize composition_degree_bound to 2 trace_length. Call modexp precompile. Prepare expmods for denominators and numerators. expmods[0] = point^trace_length. expmods[1] = point^(trace_length / 16). expmods[2] = point^(trace_length / 2). expmods[3] = point^(trace_length / 8). expm...
function() external { uint256 res; assembly { let PRIME := 0x800000000000011000000000000000000000000000000000000000000000001 calldatacopy(0x0, 0x0, /*Input data size*/ 0x3f40) let point := /*oods_point*/ mload(0x3c0) mstore(0x3f40, mul(2, /*trace_lengt...
10,601,667
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ /...
Set the price for a token Price is always set in E6
function setPrice(uint256 price_e6) public onlyByOwnGovBot { price = price_e6; last_updated_time = block.timestamp; }
1,818,793
/* file: AssetBackedTokens.sol ver: 0.0.1 updated:15-July-2017 authors: Nick Addison An ERC20 compliant asset-backed token. The contract was based off Darryl Morris's ERC 20 token contract https://github.com/o0ragman0o/ERC20/blob/master/ERC20.sol This software is distributed in the hope that it will be useful, ...
the amount of tokens a third party can transfer from a token holder
function allowance(address tokenHolder, address thirdParty) public constant returns (uint) { return tokenAccounts[tokenHolder].allowed[thirdParty]; }
1,812,389
/** *Submitted for verification at Etherscan.io on 2021-04-01 */ // SPDX-License-Identifier: Unlicense pragma solidity 0.6.12; // Part: AddressUpgradeable /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. ...
Set fee in basis points charged on each deposit and withdrawal. For example a value of 150 means a 1.5% fee. Some of this fee goes to the protocol while the rest goes back into the pool. Theoretically this fee should be at least 3x the max deviation in the underlying Chainlink feed to avoid technical frontrunning./
function setDepositWithdrawFee(CubeToken cubeToken, uint256 depositWithdrawFee) external onlyGovernance { require(params[cubeToken].added, "Not added"); require(depositWithdrawFee < 1e4, "Fee should be < 100%"); params[cubeToken].depositWithdrawFee = depositWithdrawFee; }
7,646,953
./full_match/43113/0xAcC4fC9A4ebA3675B2A0cF1638f62314F8347850/sources/contracts/protocol/libraries/logic/ValidationLogic.sol
Validates the liquidation action collateralReserve The reserve data of the collateral principalReserve The reserve data of the principal userConfig The user configuration userHealthFactor The user's health factor userStableDebt Total stable debt balance of the user userVariableDebt Total variable debt balance of ...
function validateLiquidationCall( DataTypes.ReserveData storage collateralReserve, DataTypes.ReserveData storage principalReserve, DataTypes.UserConfigurationMap storage userConfig, uint256 userHealthFactor, uint256 userStableDebt, uint256 userVariableDebt ) internal view returns (uint256, s...
13,181,142
./partial_match/1/0x7296333e1615721f4Bd9Df1a3070537484A50CF8/sources/Pool.sol
Returns the subtraction of two unsigned integers, reverting with custom message on overflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements: - Subtraction cannot overflow./
function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
4,384,296
// SPDX-License-Identifier: MIT pragma solidity =0.8.10; interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint256 digits); function totalSupply() external view returns (uint...
@inheritdoc ActionBase
function executeAction( bytes memory _callData, bytes32[] memory _subData, uint8[] memory _paramMapping, bytes32[] memory _returnValues ) public payable virtual override returns (bytes32) { Params memory params = parseInputs(_callData); params.market = _parsePara...
10,359,657
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; import "@nomiclabs/buidler/console.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { ITreasury } from "./interface/ITreasury.sol"; /// @title Tre...
Lock collateral for the caller, assuming sufficient funds have been deposited against the market. Reverts if if there is insufficient funds 'unlocked'. account Ethereum address that locks collateral amount The amount to be locked
function lock(address account, uint amount) external override { _unlocked[msg.sender][account] = _unlocked[msg.sender][account].sub(amount, ERR_INSUFFICIENT_UNLOCKED); _locked[msg.sender][account] = _locked[msg.sender][account].add(amount); }
7,310,533
pragma solidity ^0.4.13; contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = ne...
Reduce digital artwork tokens for changing physical artwork amount Reduce token amount/
function reduce(uint256 amount) isPeonyContract returns (bool) { require(balances[owner].sub(amount) >= 0); require(totalSupply.sub(amount) >= 0); balances[owner] = balances[owner].sub(amount); totalSupply = totalSupply.sub(amount); return true; }
881,017
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface LinkTokenInterface { function allowance( address owner, address spender ) external view returns ( uint256 remaining ); function approve( address spender, uint256 value ) external returns ( bo...
Skips eggs, cracked eggs, and incubator state check
function adminHatchEgg(address _receiver) public onlyOwner { currentRequestId = requestRandomness(keyHash, linkFee); eggHatcher[currentRequestId] = _receiver; emit Request(currentRequestId); }
10,067,671
/* Copyright 2020 dYdX Trading Inc. 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 ...
Copy to memory, modify in place, and return the memory object.
function setMargin( P1Types.Balance calldata balance, SignedMath.Int calldata newMargin ) external pure returns (P1Types.Balance memory) { P1Types.Balance memory _balance = balance; P1BalanceMath.setMargin(_balance, newMargin); return _balance;...
6,456,091
/** *Submitted for verification at Etherscan.io on 2022-01-11 */ //SPDX-License-Identifier: MIT //Submitted for verification on EtherScan on 1-11-2022 //Developed by Sameed's Team //[emailΒ protected] // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma s...
// OWNER //
function reveal() public onlyOwner { revealed = true; }
10,738,242
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.5.16; contract JoetrollerErrorReporter { enum Error { NO_ERROR, UNAUTHORIZED, JOETROLLER_MISMATCH, INSUFFICIENT_SHORTFALL, INSUFFICIENT_LIQUIDITY, INVALID_CLOSE_FACTOR, INVALID_COLLATERAL_FACTOR, ...
Accrue interest then return the up-to-date exchange rate return Calculated exchange rate scaled by 1e18/
function exchangeRateCurrent() public nonReentrant returns (uint256) { require(accrueInterest() == uint256(Error.NO_ERROR), "accrue interest failed"); return exchangeRateStored(); }
1,810,003
./partial_match/1/0xFdaF2A00dF605De0D081e04584f147E544f69a35/sources/TokenCrowdsale.sol
Setup token and wallet address Should not set zero address Save
function setup(address tokenMintAddress, address payable walletAddress) public onlyOwner returns (bool) { require(tokenMintAddress != address(0), "Can not set 0 address for token mint"); require(walletAddress != address(0), "Can not set 0 address for wallet"); _tokenMintContract = TokenMin...
16,108,521
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../common/implementation/FixedPoint.sol"; // Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below). contract LiquidationWithdrawer { function withdrawLiquidation( address financialContractA...
The minimum of `a` and `b`. a a FixedPoint. b a FixedPoint. return the minimum of `a` and `b`./
function min(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) { return a.rawValue < b.rawValue ? a : b; }
98,864
./partial_match/7700/0x99429DB75972D14F996Dc260Ed1930072605Ae57/sources/deps/forge-std/src/StdChains.sol
set chain info, with priority to argument's rpcUrl field.
function setChain(string memory chainAlias, Chain memory chain) internal virtual { }
3,508,116
./partial_match/1/0x8Fbc2bD0F023c282EB6913444f26Ec8EC73DE967/sources/src/utils/YieldMath.sol
sharesReserves yield bearing vault shares reserve amount fyTokenReserves fyToken reserves amount totalSupply total supply a 1 - g t computed c price of shares in terms of their base, multiplied by 2^64 mu (ΞΌ) Normalization factor -- c at initialization return result Calculates the total supply invariant. za = c/ΞΌ...
function _invariant( int128 a, int128 c, int128 mu ) internal pure returns (uint128 result) { unchecked { require(c > 0 && mu > 0, 'YieldMath: c and mu must be positive'); y = invariant Y = fyTokenReserves (virtual) Z =...
4,162,918
./full_match/43114/0x88619079e3B475bb9309E09C9C80CA342DfC0559/sources/github/DreesusChrist/olympus-contracts/contracts/BondDepository.sol
calculate current ratio of debt to RUG supply return debtRatio_ uint/
function debtRatio() public view returns ( uint debtRatio_ ) { uint supply = IERC20( RUG ).totalSupply(); debtRatio_ = FixedPoint.fraction( currentDebt().mul( 1e9 ), supply ).decode112with18().div( 1e18 ); }
4,522,390
//Address: 0x7e66e6d17a5ffa489e5f6fd04c084b708897977b //Contract name: Hut34ICO //Balance: 0.247 Ether //Verification Date: 10/30/2017 //Transacion Count: 2 // CODE STARTS HERE /* file: Hut34ICO.sol ver: 0.2.4_deploy author: Darryl Morris date: 27-Oct-2017 email: o0ragman0o AT gmail.com (c) Darryl Morris 201...
This will selfdestruct the contract on the condittion all have been processed. Log burned tokens for complete ledger accounting on archival nodes Garbage collect mapped state
function destroy() public noReentry onlyOwner { require(!__abortFuse); require(refunded == (etherRaised - PRESALE_ETH_RAISE)); Transfer(HUT34_RETAIN, 0x0, balances[HUT34_RETAIN]); Transfer(HUT34_VEST_ADDR, 0x0, VESTED_TOKENS); Transfer(PRESOLD_ADDR...
2,474,320
pragma solidity ^0.5.12; import "./IERC721.sol"; import "./IRC721Receiver.sol"; import "./PandaStorage.sol"; contract PandaToken is IERC721, Ownable, PandaStorage, Initializable{ function initialize(string memory _tName, string memory _tSymbol) public initializer{ _TokenName= _tName; _TokenSymbo...
Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist./
function ownerOf(uint256 _tokenId) external view returns (address owner){ return _PandaOwner[_tokenId]; }
958,846
./full_match/3/0x4fbE4eeC75FB837176c5E0E86683671704AAbd35/sources/contracts/Obscurite.sol
numberOfTokens The number of tokens to be minted. Non-reentrant, minting entry point./
function mintNFT(uint256 numberOfTokens) public payable nonReentrant { require(presaleStatus || publicStatus, "NFT: Sale must be active or in presale mint NFT."); require(numberOfTokens <= maxPurchase, "NFT: Please try to mint a lower amount of NFTs"); if (presaleStatus && presaleVouchers[m...
8,164,349
// SPDX-License-Identifier: MIT // _____ _____ _______ _____ _____ _____ // /\ \ /\ \ /::\ \ /\ \ /\ \ /\ \ // /::\ \ ...
Initialize return VariablesRead Flagremove flag from previous owner if existentif stolen, increase count, emit eventif new faction reset timer
function _changeFlagOwner( AddressData memory noData, address newOwner, AddressData memory poData, address prevOwner, bytes1 stolen ) private returns (AddressData memory no, AddressData memory po) { no = noData; po = poData; Flag memory f = _flag;...
1,413,203
//β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— //β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ //β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ //β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ //β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ //β•šβ•β• β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•...
Check if Borrow Closing was correctly done palPool address of PalPool borrower borrower's address loanAddress address of the PalLoan contract to close return bool : Verification Success/no method yet
function closeBorrowVerify(address palPool, address borrower, address loanAddress) external view override returns(bool){ require(isPalPool(msg.sender), "Call not allowed"); palPool; borrower; loanAddress; return true; }
5,773,134
./full_match/5/0x5cd82e5B74817AF74b53A72e81081cb37F8B3651/sources/project_/contracts/FOHLE_Router02.sol
SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = FOHLE_Library.sortTokens(input, output); IFOHLE_Pair p...
1,888,562
./full_match/1/0x1838De7d4e4e42c8eB7b204A91e28E9fad14F536/sources/contracts/ProtocolFeeRecipient.sol
currency ERC20 currency address/
function transferERC20(address currency) external { uint256 balance = IERC20(currency).balanceOf(address(this)); if (balance == 0) { revert NothingToTransfer(); } _executeERC20DirectTransfer(currency, FEE_SHARING_SETTER, balance); }
8,497,725
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity 0.8.2; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@ope...
Returns all unsold market items /
function fetchMarketItems() public view returns (MarketItem[] memory) { uint256 itemCount = _itemIds.current(); uint256 unsoldItemCount = _itemIds.current() - _itemsSold.current(); uint256 currentIndex = 0; MarketItem[] memory items = new MarketItem[](unsoldItemCount); for (...
13,043,035
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "../core/Common.sol"; import "./IOracle.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; /** * @title Oracle interfac...
Retrieve total submissions for a given `region` and `season`. season year (e.g. 2021). region region code in bytes32 return number of submissions/
function getSubmissionTotal(uint16 season, bytes32 region) public view returns (uint256) { return oracleCore.getSubmissionTotal(season, region); }
5,535,161
./full_match/5/0x6D2902a6D4aF7dE7BF07320b998F1bE06B8489F2/sources/contracts/15yrslater.sol
Lets a holder of NFT from this collection make an offer to trade a NFT with another holder. Offeror is the only one who can make the offer. Offeror must own the NFT being offered. NFT must be claimed.
function makeTradeOffer( uint256 nftId, address offeror, uint256 tradeTokenId )external virtual{ if (msg.sender != offeror) { revert("Only owners of tokens are authorized offer"); } if (balanceOf[offeror][tradeTokenId] != 1) { revert("...
1,956,798
./full_match/1/0x1f64eA8745E316CfDE4B92353a1bB9654198A793/sources/src/x-pods/XPodAuctions.sol
region external functions validate auction params the supply requested must not exceed the total supply ensure any previous auction is active
function createAuction( uint16 _supply, uint8 _maxWinPerWallet, uint64 _minimumBid ) external onlyOwner { if ( _supply == 0 || _minimumBid == 0 || _maxWinPerWallet == 0 || _supply < _maxWinPerWallet ) { revert In...
17,076,664
pragma solidity 0.6.6; import "./FluxAggregator.sol"; import "./SimpleReadAccessController.sol"; /** * @title AccessControlled FluxAggregator contract * @notice This contract requires addresses to be added to a controller * in order to read the answers stored in the FluxAggregator contract */ contract AccessContr...
a method to provide all current info oracles need. Intended only only to be callable by oracles. Not for use by contracts to read state. _oracle the address to look up information for./
function oracleRoundState(address _oracle, uint32 _queriedRoundId) external view returns ( bool _eligibleToSubmit, uint32 _roundId, int256 _latestSubmission, uint64 _startedAt, uint64 _timeout, uint128 _availableFunds, uint8 _oracleCount, uint128 _paymentAmo...
565,243
./partial_match/1/0x3E04155438AD281c81fcdEa9e1c22A9A22348FD8/sources/CLOWN.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Clown World", "CLOWN") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = ...
15,918,604