file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/97/0x5A43AaBb47a328D54857B91E8F89a6CF4aDcEa86/sources/project_/contracts/contracts/ERC20.sol
Hook that is called after any transfer of tokens. This includes minting and burning. Calling conditions: - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens has been transferred to `to`. - when `from` is zero, `amount` tokens have been minted for `to`. - when `to` is zero, `amount` of ``from``'s tok...
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
5,018,418
./full_match/80001/0x67Fa6DF65cBB1A1687403afd39dc82042892623c/sources/NFTstaking.sol
Make sure the user has at least one token staked before withdrawing Wallet must own the token they are trying to withdraw Update the rewards for this user, as the amount of rewards decreases with less tokens Find the index of this token id in the stakedTokens array
function withdraw(uint256 _tokenId) external nonReentrant { require( stakers[msg.sender].amountStaked > 0, "You have no tokens staked" ); require(stakerAddress[_tokenId] == msg.sender, "You don't own this token!"); uint256 rewards = calculateRewards(msg.send...
9,471,372
./partial_match/1/0x5676f6b5563c157EbF68b2a113c3F0152B5fB91E/sources/HalfAveAccessPasses.sol
Allows owner of the collection to airdrop a token to any address
function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner { _safeMint(_receiver, _mintAmount); }
3,719,246
/** *Submitted for verification at Etherscan.io on 2021-11-20 */ // File: @openzeppelin/contracts/utils/Counters.sol pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the numb...
public Update token sold count
function mint(address _to, uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(!paused, "Contract paused!"); require(_to != address(0), "_to address cannot be dead address!"); require(_mintAmount > 0); require(_mintAmount <= maxMintAmount, "_mintAmou...
6,819,720
pragma solidity ^0.4.21; // Interface to ERC20 functions used in this contract interface ERC20token { function balanceOf(address who) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function allowance(address owner, address spender) external view retur...
empty fallback payable to allow ETH deposits to the contract
function() public payable{ }
12,809,801
./full_match/80001/0x20f4B1793bb81FFa357E1705AD954BdC232Edc00/sources/project_/contracts/WittyPixelsToken.sol
Fractionalize given token by transferring ownership to new instance of ERC-20 ERC721Token Vault. This vault factory is only intended for fractionalizing its own tokens.
function fractionalize(address, uint256, bytes memory) external pure override returns (ITokenVault) { revert("WittyPixelsToken: not implemented"); }
5,590,304
./full_match/80001/0x7A9f65E8989d92ca200CE08839d90F3411088757/sources/contracts/Main.sol
uint dF = (A_dS) + (B/3)( S3 - (S - _dS)3 );
function sellPrice(uint _dS) public view returns(uint) { uint dF = 1000 * (sqrt(S**2+10**6)-sqrt((S-_dS)**2+10**6)); return dF; }
852,210
./full_match/41/0x83A59050218A540C6e7C4380695Dc804F52F56D7/sources/contracts/ZombieVan.sol
Add, edit or remove an NFT collection. To remove a collection, set its multiplier to 0. Add a new NFT collection Edit the NFT collection Remove the NFT collection by swapping it to the last element, then pop it Replace the actual index values with the last ones of the array
function setNftCollection(address nftAddress, uint256 multiplier) external onlyOwner { uint256 index = getNftCollectionIndex(nftAddress); if (index == uint256(-1)) { nftAddresses.push(nftAddress); nftMultipliers.push(multiplier); _nftCollections.push(IERC721(nftAd...
16,370,758
pragma solidity ^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 should not be accessed in such a direct * m...
Set whitelist price to mint a Crypto Copy Cat./
function setDiscountPrice(uint256 _price) external onlyOwner { discountPrice = _price; }
1,102,321
./full_match/1/0xcb52eE1e1ae95A0E2917aD48F5693623F0d2273C/sources/contracts/darkz.sol
Set provenance once it's calculated/
function setProvenanceHash(string memory provenanceHash) public onlyOwner { DARKZ_PROVENANCE = provenanceHash; }
3,022,840
// File: contracts/zeppelin/SafeMath.sol pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a,...
Sets a new supply controller address. _newSupplyController The address allowed to burn/mint tokens to control supply./
function setSupplyController(address _newSupplyController) public { require(msg.sender == supplyController || msg.sender == owner, "only SupplyController or Owner"); require(_newSupplyController != address(0), "cannot set supply controller to address zero"); emit SupplyControllerSet(supplyCo...
173,103
./full_match/1/0x1D0977e86c70EAbb5c8fD98DB1B08C6d60caa0C1/sources/contracts/engine/GenArt721CoreV2_ENGINE_FLEX.sol
Adds external asset dependency for project `_projectId`. _projectId Project to be updated. _cid Asset cid (Content identifier). _dependencyType Asset dependency type. 0 - IPFS 1 - ARWEAVE/
function addProjectExternalAssetDependency( uint256 _projectId, string calldata _cid, ExternalAssetDependencyType _dependencyType ) external onlyUnlockedProjectExternalAssetDependencies(_projectId) onlyArtistOrWhitelisted(_projectId) { uint24 assetCoun...
9,648,743
pragma solidity ^0.4.24; /* ETHEREUM WORLD CUP : 14th June - 15th July 2018 [Russia] - designed and implemented by Norsefire. - thanks to Etherguy and oguzhanox for debugging and front-end respectively. Rules are as follows: * Entry to the game costs 0.2018 Ether. Use the register function when sending t...
What was the last game ID that has had an official score registered for it?
function gameResultsLogged() view public returns (int) { return latestGameFinished; }
7,826,932
./full_match/1/0xF1C7b9A188C071d397ef55440A028321D6D780A0/sources/contracts/BountyV2.sol
Approves the Nth submission for a bounty (0-indexed) bounty The ID of the bounty whose submission to approve submission The ID of the submission to approve Un-assessed submissions get their stakes returned. If we've already approved, refund stake. If this address hashes with the submission ID to produce this payload...
function approveSubmission(uint256 bounty, uint256 submission) external onlyApprover { bool _foundSubmission = false; for (uint32 i = _bounties[bounty].queueIndex; i < submissionsCount(bounty); i++) { if (_foundSubmission) { SafeERC20.safeTransfer(IERC20(_arkm), _submis...
3,024,008
./full_match/3/0x895919AE76eed4E745aEEbcAC69CCf375aE99BC9/sources/Locker.sol
Registering the locker with an owner & Password Set up
function RegisterLocker(string memory _LockerRegistrationID,string memory _password) public { if(GetLength() != 0) revert("The Owner has already a locker registered"); require(bytes(_LockerRegistrationID).length > 0, "Locker Registration ID cannot be null"); owners[msg.sender].ow...
14,135,157
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; contract Fitup { address owner; uint256 public totalBetCount = 0; uint256 public activeBetCount = 0; bool active = false; struct Ngo { string name; address organisation; } struct Bet { uint256 amount; ...
Storing capacity, need to be reviewed!!
function incrementActiveCount() internal { activeBetCount += 1; }
15,827,009
/** *Submitted for verification at Etherscan.io on 2021-09-06 */ pragma solidity ^0.5.12; pragma experimental ABIEncoderV2; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because p...
for emergency case, Deeper Offical have permission to withdraw all fund in the contract
function withdrawAllFund(address token,uint256 amount) external onlyOwner returns(bool){ IERC20(token).safeTransfer(owner,amount); emit WithdrawAllFunds(owner); return true; }
7,979,853
./full_match/40/0x568367728d9588a090a3482c724157C0E05737cc/sources/contracts/IceCreamZombies.sol
Change the json filename of a tokenId (should not be used, just in case)
function setTokenURI(uint256 id, string calldata dotJson) external onlyOwner { _setTokenURI(id, dotJson); emit TokenUriUpdated(id, dotJson); }
9,544,701
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "openzeppelin-contracts/contracts/interfaces/IERC1271.sol"; import "openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "openzeppelin-contracts/contracts/utils/Address.sol"; import "../interfaces/IERC721Perm...
@inheritdoc IERC721Permit
function permit( address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable override { require(block.timestamp <= deadline, 'Permit expired'); bytes32 digest = keccak256( abi.encodePacked( ...
5,376,916
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contra...
Returns true if the key is in the map. O(1)./
function contains(AddressToUintMap storage map, address key) internal view returns (bool) { return _contains(map._inner, bytes32(uint256(key))); }
5,926,031
./full_match/1/0xF75D485E9cd0063947e255a214e60bc247fF40f5/sources/convex-platform/contracts/contracts/RewardFactory.sol
Create a Managed Reward Pool to handle distribution of all crv mined in a pool/operator = booster(deposit) contract so that new crv can be added and distributedreward manager = this factory so that extra incentive tokens(ex. snx) can be linked to the main managed reward pool
function CreateCrvRewards(uint256 _pid, address _depositToken, address _lptoken) external returns (address) { require(msg.sender == operator, "!auth"); BaseRewardPool4626 rewardPool = new BaseRewardPool4626(_pid,_depositToken,crv,operator, address(this), _lptoken); emit RewardPoolCreated(a...
4,880,661
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "./MemberCard.sol"; contract Vendor is Ownable { address immutable public memberCard; constructor(address _memberCard) { memberCard = _memberCard; } event UseMember...
useMemberCard user use their card this method can called by anyone _tokenId of user's card
function useMemberCard(uint256 _tokenId) external { MemberCard(memberCard).useToken(_tokenId, _msgSender()); emit UseMemberCard(_msgSender(), _tokenId); }
13,027,572
./full_match/80001/0xCF65E807111c2CC4FCA69818107E3f8DCD570F70/sources/lib/contracts/contracts/smart-wallet/non-upgradeable/Account.sol
/// Executes a transaction (called directly from an admin, or by entryPoint)
External functions function execute( address _target, uint256 _value, bytes calldata _calldata ) external virtual onlyAdminOrEntrypoint { _call(_target, _value, _calldata); }
847,464
//Address: 0xaced90c414006b622a4b1ce74fa34b1f650ab319 //Contract name: IndividualityToken //Balance: 0 Ether //Verification Date: 1/26/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.0; library TokenEventLib { /* * When underlying solidity issue is fixed this library will not be needed....
Transfers sender token to given address. Returns success. _to Address of new token owner.
function transfer(address _to) public returns (bool success) { return transfer(_to, 1); }
5,545,228
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; interface IUniswap { // To convert DAI to ETH function SWAPEXACTTOKENSFORETH436(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[]...
inject NONSTANDARD NAMING
function _WITHDRAWSOMECOMPOUND259(uint256 _amount) internal {
977,214
./full_match/1/0x8610f734cB2001A3Ab7ed7A8A0da898776D99dA9/sources/contracts/utils/AddressArrayLib.sol
Helper to remove items from an array. Removes all matching occurrences of each item. Does not assert uniqueness of either array.
function removeItems( address[] memory _self, address[] memory _itemsToRemove ) internal pure returns (address[] memory nextArray_) { if (_itemsToRemove.length == 0) { return _self; } bool[] memory indexesToRemove = new bool[](_self.length); uint256 r...
2,981,624
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "./interfaces/IERC20Minimal.sol"; import "./libraries/TransferHelper.sol"; import "./interfaces/IVault.sol"; import "./interfaces/IVaultManager.sol"; import "./interfaces/IERC721Minimal.sol"; import "./interfaces/IV1.sol"; import "./interfaces/IWET...
liquidate check the pair if it exists Distribute collaterals burn vault nft self destruct the contract, send remaining balance if collateral is native currency
function liquidate() external override { require( !IVaultManager(manager).isValidCDP( collateral, debt, IERC20Minimal(collateral).balanceOf(address(this)), IERC20Minimal(debt).balanceOf(address(this)) ), "Vau...
13,069,828
pragma solidity ^0.4.21; /** * @title SafeMath * @dev https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function...
Change the fee owner. _feeOwner The new fee owner./
function changeFeeOwner(address _feeOwner) onlyOwner public { require(_feeOwner != feeOwner && _feeOwner != address(0)); feeOwner = _feeOwner; }
391,064
./full_match/1/0x3Bc988Da91b01d682C37e29f95bC0Ed18F3273Fc/sources/contracts/GraphcastRegistryV2.sol
Function to register GraphcastID address for an indexer Authorize an address to be a Graphcast ID. (unauthorize by setting address 0). Make sure the message sender is the provided indexer, or the message sender is an operator of the provided indexer by calling the Service Registry _indexer Indexer address to authoriz...
function setGraphcastIDFor(address _indexer, address _graphcastID) external virtual { if (!_isAuth(_indexer)) revert UnauthorizedCaller(_indexer); if (_graphcastID == msg.sender) revert InvalidGraphcastID(_graphcastID); if (_graphcastID != address(0) && graphcastIDReg...
16,529,871
./full_match/80001/0x3A907E57Dca4a585b5cFE13Cbb438De03231a814/sources/contracts/ClampGovernance.sol
whitelist address that is allowed to vote based on CLAMP Voting mechanism
function whitelistAddress(uint _proposalId, address _voter) external onlyOwner{ require(_proposalId == proposalCount, "CLAMP: INVALID PROPOSAL ID"); ProposalState proposersLatestProposalState = state(_proposalId); require(proposersLatestProposalState == ProposalState.Active || prop...
9,491,913
pragma solidity ^0.4.20; import "./erc20.sol"; import "./TokenRescue.sol"; interface AccountRegistryInterface { function canVoteOnProposal(address _voter, address _proposal) external view returns (bool); } contract FinneyVote is ERC20, TokenRescue { uint256 supply = 0; AccountRegistryInterface public acco...
vote5 and vote1 are available for future use
function vote5(address _voter, address _votee) external { require(balances[_voter] >= 10); require(accountRegistry.canVoteOnProposal(_voter, msg.sender)); balances[_voter] -= 10; balances[owner] += 5; balances[_votee] += 5; emit Transfer(_voter, owner, 5); emi...
5,540,590
// SPDX-License-Identifier: MIT pragma solidity =0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./../IAuditToken.sol"; import "./MemberHelpers.sol"; /** * @title Nod...
remove Node operator status
function removeNodeOperator() internal { for (uint256 i= 0; i < nodeOperators.length; i++) { if (nodeOperators[i] == msg.sender){ nodeOperators[i] = nodeOperators[nodeOperators.length - 1]; nodeOperators.pop(); i = nodeOperators.length; ...
1,752,846
pragma solidity ^0.5.17; // Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol // Adapted to use pragma ^0.5.17 and satisfy our linter rules /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { string private constan...
Tell the sum of the all the items (leaves) stored in the tree, i.e. value of the root of the tree/
function getTotal(Tree storage self) internal view returns (uint256) { uint256 rootLevel = getHeight(self); return getNode(self, rootLevel, BASE_KEY); }
91,545
//SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./HugoNFTAbstractImpl.sol"; abstract contract HugoNFTMinter is ERC721, HugoNFTAbstractImpl { event Mint(address indexed to, uint256 indexed tokenId, string name, string description); event ...
Changes description of the NFT with provided tokenId. Requirements: - `msg.sender` should have {HugoNFTStorage-NFT_ADMIN} role - `tokenId` should be an Id of existing NFT - `description` shouldn't be empty or larger than 300 bytes/
function changeNFTDescription(uint256 tokenId, string calldata description) external override(AbstractHugoNFT) onlyRole(NFT_ADMIN_ROLE) { require(_tokenExists(tokenId), "HugoNFT::nft with such id doesn't exist"); require( bytes(description).length > 0 && bytes...
7,221,271
pragma solidity 0.5.15; contract IAugur { function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA...
inject NONSTANDARD NAMING
function REMOVEORDER407(bytes32 _orderId) external returns (bool);
2,554,087
/** *Submitted for verification at Etherscan.io on 2021-04-21 */ pragma solidity ^0.7.6; // SPDX-License-Identifier: MIT // Source code: https://github.com/DeCash-Official/smart-contracts interface ERC20 { function balanceOf(address _owner) external view returns (uint256); function allowance(address _owner...
These functions are used to avoid the use of the modifiers that can cause the "stack too deep" error also for code optimization/
function _validateViaSignatureParams( address _delegator, address _from, address _feeRecipient, uint256 _deadline, uint256 _sigId ) internal view { require(!isPaused(), "Contract paused"); require(_isDelegator(_delegator), "Sender is not a delegator"); ...
2,007,188
// SPDX-License-Identifier: -- 💰 -- pragma solidity ^0.7.5; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Generic SafeMath Library, can be removed if the * contract will be rewritten to ^0.8.0 Solidity compiler */ library SafeMath { /** * @dev Returns the...
Determines the ratio of reward per each token stakd so the relative value can be calculated/
function rewardPerToken() public view returns (uint256) { if (totalSupply() == 0) { return rewardPerTokenStored; } return rewardPerTokenStored.add( lastTimeRewardApplicable() .sub(lastUpdateTime) .mul(reward...
1,263,910
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./Ownable.sol"; import "./IERC20.sol"; import "./IUniswapV3Router.sol"; import "./IWETH.sol"; import {Path} from "./Path.sol"; contract matrEXRouterV3 is Ownable, IUniswapV3Router{ using Path for bytes; /** * @dev Event emitted when the charit...
Functions that only the owner can call that change the variables in this contract/
function setCharityFee(uint256 newCharityFee) external onlyOwner { _charityFee = newCharityFee; }
5,778,444
pragma solidity ^0.4.15; contract testAddress { function f() { address x = 0x123; address myAddress = this; if (x.balance < 10 && myAddress.balance >= 10) x.transfer(10); } function g() { address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2; nameReg.call("re...
Creates a new temporary memory struct, initialised with the given values and copies it over to storage. Note that you can also use Funder(msg.sender, msg.value) to initialise.
function contribute(uint campaignID) payable { Campaign storage c = campaigns[campaignID]; c.amount += msg.value; }
6,347,288
./full_match/80001/0xfFdcEB6174805FD7EF82938e7fEE6bf06E22d4F5/sources/contracts/1_Storage.sol
Return value return value of 'number'/
function readNumber() public view returns (uint256){ return number; }
9,534,814
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppe...
Function checking the balance of the contract - available to owner/
function getContractBalance() public onlyOwner view returns (uint){ return address(this).balance; }
1,777,215
pragma solidity ^0.4.20; contract HouseHolding { address owner = msg.sender; // админ uint top = 0; // счетчик ид для добавления домов struct HouseInfo { address owner; // владелец bool inPledge; // в залоге или нет uint area; ...
--->> Просмотр всех предложений о продаже количество всех предложени о продаже
function get_count_of_saling_houses() public constant returns(uint) { return all_houses_in_sale.length; }
15,791,026
// SPDX-License-Identifier: MIT pragma solidity 0.6.8; import "./ERC1155Inventory.sol"; import "./IERC1155InventoryBurnable.sol"; /** * @title ERC1155InventoryBurnable, a burnable ERC1155Inventory */ abstract contract ERC1155InventoryBurnable is IERC1155InventoryBurnable, ERC1155Inventory { //=================...
Burns a batch of tokens. See {IERC1155InventoryBurnable-batchBurnFrom(address,uint256[],uint256[])}./
function batchBurnFrom( address from, uint256[] memory ids, uint256[] memory values ) public virtual override { uint256 length = ids.length; require(length == values.length, "Inventory: inconsistent arrays"); address sender = _msgSender(); require(_isOper...
985,951
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; /// @title An Ownable Contract /// @author Mariona (seaona) /// @notice Do not use this contract on production contract Ownable { address private _owner; /// @dev Get current contract owner /// @return Address of current contract owner function ...
Get current contract owner return Address of current contract owner
function getOwner() public view returns(address) { return _owner; }
1,823,401
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "../ics23/ics23.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract AnconProtocol is ICS23 { struct SubscriptionTier { address token; uint256 amount; uint256 amountStaked; uint256 includedBlocks; ...
verifies ICS23 proofs, multi tenant using dag graph moniker Verify membership
function verifyProof( bytes32 moniker, Ics23Helper.ExistenceProof memory exProof ) internal view returns (bool) { verify( exProof, getIavlSpec(), latestRootHashTable[moniker], exProof.key, exProof.value ); retur...
5,446,931
./full_match/5/0x18C68B3adacE08C934408c343BC50a7EDe3F4aD7/sources/project_/contracts/EchoooERC721.sol
Returns the average of two signed numbers without overflow. The result is rounded towards zero./ Formula from the book "Hacker's Delight"
function average(int256 a, int256 b) internal pure returns (int256) { int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); }
1,859,714
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./common/BaseRelayRecipient.sol"; import "./common/Migratable.sol"; import "./common/...
Called for every user every week. Update user's last week's premium and bonus. Assert if premium or bonus not updated, or user already updated. Update asset balance if no claims. Update bonus. Update premium.
function update(address who_) public override { uint256 week = getCurrentWeek(); require(userInfo[who_].week < week, "Already updated"); uint16 index; for (index = 0; index < IAssetManager(registry.assetManager()).getAssetLength(); ++index) { ...
13,110,667
./full_match/1/0xff368E106EA8782FaB6B2D4AD69739a60C66400E/sources/contracts/Balancer/MarketMaker.sol
Get the ticks from price range return minTick The minimum tick return maxTick The maximum tick/
function getTicks( uint256 minPrice, uint256 maxPrice, uint24 poolFee ) internal view returns (int24 minTick, int24 maxTick) { int24 tickSpacing = liquidityHelper.getTickSpacing( token0, token1, poolFee ); uint8 decimals = sweep...
3,204,989
./full_match/1/0x92E79B2779460acd23548Af27a175467b32561b0/sources/ERC20.sol
Atomically increases the allowance granted to `spender` by the caller. Emits a {Approval} event. @solidity memory-safe-assembly Compute the allowance slot and load its value. Add to the allowance. Revert upon overflow.
function increaseAllowance( address spender, uint256 difference ) public virtual returns (bool) { assembly { mstore(0x20, spender) mstore(0x0c, _ALLOWANCE_SLOT_SEED) mstore(0x00, caller()) let allowanceSlot := keccak256(0x0c, 0x34) ...
3,876,000
// SPDX-License-Identifier: CC-BY-4.0 pragma solidity >=0.4.22 <0.9.0; /** * Migrated from https://github.com/skfarhat/ethbnb */ import "../common/Version.sol"; import "../common/Frozen.sol"; contract BlockchainBNB is Version, Frozen { bytes32 constant private ZERO_BYTES = bytes32(0); address const...
Return index of found id
function find(uint id) public view returns (int) { uint curr = blockchainBNBStorage().nodes[HEAD].next; while (curr != HEAD) { if (blockchainBNBStorage().nodes[curr].bid == id) { return int(curr); } curr = blockchainBNBStorage().nodes[curr].next; ...
14,068,375
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; import {ERC721URIStorage} fro...
unpause the contract
function unpause() public onlyOwner { super._unpause(); emit LandUnpaused(msgSender()); }
5,474,160
pragma solidity ^0.4.18; /** * @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) { if (a == 0) { return...
roll the dice for a player avoid reorgs
function rollDie(address player, uint gameId) private returns (bool) { uint N = 7; uint delay = 0; bytes32 _queryId = oraclize_newRandomDSQuery(delay, N, rngCallbackGas); uint rollId = uint(keccak256(_queryId)); if (failedRolls[rollId] == rollId) { cleanupErrorGa...
2,073,420
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/helpers/PointerLibraries.sol
Reads the uint88 at `rdPtr` in returndata.
function readUint88( ReturndataPointer rdPtr ) internal pure returns (uint88 value) { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) } }
4,300,429
./partial_match/1/0xf4671dc1b35dfd5a1eC5FAC2EAcC73B8E76Bb7D2/sources/MORT.sol
Returns the remainder of dividing two unsigned integers, with a division by zero flag. _Available since v3.4._/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } }
9,189,691
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./IERC900.sol"; import "./RewardStreamer.sol"; import "./StakingLib....
Will parse the stake bytes data to get the stake index [(index 32 bytes), (nft address 20 bytes), (tokenId 32 bytes)] data bytes from the stake action return (uint256) the parsed index/
function getStakeIndexFromCalldata(bytes memory data) public pure returns (uint256) { return parse32BytesToUint256(data, 0); }
497,256
/** *Submitted for verification at Etherscan.io on 2021-12-27 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; /* * @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, t...
View function to see pending Obos on frontend.
function pendingObo(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accOboPerShare = pool.accOboPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if...
2,431,667
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Mo...
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./
function transfer(address recipient, uint256 amount) public onlyWhitelisted(msg.sender) onlyWhitelisted(recipient) virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
518,834
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeMathUInt128.sol"; import "./SafeCast.sol"; import "./Utils.sol"; import "./Storage.sol"; import "./Config.sol"; import "./Events.sol"; impor...
approve to decrease upgrade notice period time to zero NOTE: сan only be called after the start of the upgrade
function cutUpgradeNoticePeriod(bytes32 targetsHash) external { require(upgradeStartTimestamp != 0, "p1"); approveCutUpgradeNoticePeriod(msg.sender); }
952,869
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) 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 functio...
Request ticket for custom drawing with photo url/ TODO: check if uploadImageUrl is valid url
function request(uint256 tokenId, string calldata uploadImageUrl) external { require(_msgSender() == ownerOf(tokenId), "FinalBosu: only token owner can request"); require(tokenStatus[tokenId.toUint16()] == TokenStatus.NEW, "FinalBosu: cannot use this token to request"); require(bytes(uploadI...
546,180
// SPDX-License-Identifier: MIT // // Developed by https://1block.one // // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inherit...
Returns total unrealized pnl
function getTotalUPNL(address _address) public view returns(uint) { uint totalUPNL = 0; uint tokensCount = stakeHolders[_address].stakedTokens.length; for (uint i = 0; i < tokensCount; i++) { totalUPNL += getTokenUPNL(stakeHolders[_address].stakedTokens[i], _address); } ...
5,421,431
./partial_match/1/0xE7184065E396e071Cf55edef5C74A1D2d05B8849/sources/CarMechanics.sol
Setup base URI Setup URI
function setupBaseURI(string memory baseURI) public onlyOwner { _setBaseURI(baseURI); }
4,114,758
pragma solidity ^0.5.0; contract Adoption { address[16] public adopters; uint[16] public portugues; uint[16] public matematica; uint[16] public ciencia; // Adopting a pet function adopt(uint petId, uint petPo, uint petMa, uint petCi) public returns (uint) { require(petId >= 0 && ...
Retrieving the adopters
function getAdopters() public view returns (address[16] memory) { return adopters; }
14,050,081
./partial_match/7700/0xdc0aa5ae2867F5FD41Ba6FDfea072998291Ee742/sources/src/Note.sol
set the New Accountant
function _setAccountantAddress(address accountant_) external { require(msg.sender == admin); accountant = accountant_; if (balanceOf(accountant) != type(uint).max) { _mint_to_Accountant(accountant); } }
3,505,492
./full_match/97/0x8B4032b71C804517D54878d78730c230F768Ad57/sources/tests/BSC ChainLinkTests/PWA.sol
Returns project Data for a given projectAddress
function getProjectData( address _address ) public view returns (PWProject memory) { uint256 id = projectsIds[_address]; return projects[id]; }
5,018,659
./partial_match/1/0x1da8E62726A18d3a563AF8c10fC44416A89E9BAc/sources/PaymentProcessor.sol
recordDealRefundReason creates an event of not paid deal that was cancelled _orderId Identifier of deal's order _clientAddress Address of client's account _clientReputation Updated reputation of the client _merchantReputation Updated reputation of the merchant _dealHash Hashcode of the deal, describing the or...
function recordDealRefundReason( uint _orderId, address _clientAddress, uint32 _clientReputation, uint32 _merchantReputation, uint _dealHash, string _refundReason) external onlyMonetha { emit DealRefundReason( _orderId, _cli...
3,724,627
/* Implement ERC 20 Token standard: https://github.com/ethereum/EIPs/issues/20 */ pragma solidity ^0.4.25; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usuall...
Token that can be minted (created) /
function mint(uint _value) public onlyOwner returns (bool success) { require(_value > 0, "Minted value <= 0"); totalSupply = SafeMath.add(totalSupply, _value); balances[_owner] = SafeMath.add(balances[_owner], _value); emit Transfer(address(0), _owner, _value); return true; ...
12,575,680
pragma solidity 0.7.5; /** * Contract that exposes the needed erc20 token functions */ abstract contract ERC20Interface { // Send _value amount of tokens to address _to function transfer(address _to, uint256 _value) public virtual returns (bool success); // Get the account balance of another acco...
Flush the entire balance of the contract to the parent address./
function flush() public { uint256 value = address(this).balance; if (value == 0) { return; } require(success, "Flush failed"); emit ForwarderDeposited(msg.sender, value, msg.data); }
1,370,759
./full_match/5/0x8Ca03f2f040f8f8BdfCa0Df83E68460FFE78f8DF/sources/contracts/CompanyRegistry.sol
Function to get information about a company
function getCompany( address _company ) public view onlyAdminOrOwner(_company) returns ( bool approved, uint256 approvalDate, address approvedBy, address owner, string memory companyName, string memor...
1,859,983
./partial_match/1/0x2736af1C70B60501EF5a18690C77cC82EA80Da0b/sources/Dividend.sol
generate the uniswap pair path of token -> weth
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, path, ad...
2,627,712
./full_match/1/0x1a4076c26842501da0d6D879dd7A78810f8DA727/sources/contracts/Timeout.sol
privatesalesmint mint on private sale. Requirements: - Only whitelisted address can mint/
function privatesalesmint( DataLibrarry.Coupon memory coupon, DataLibrarry.CouponType couponType, DataLibrarry.CouponTypeCount memory count ) external { if(phase != DataLibrarry.SalePhase.Phase02) revert InvalidPhase(); if(isFreeMinted[msg.sender] == true) revert AlreadyUsePrivateSalesMint...
8,435,889
pragma solidity ^0.4.18; contract GroupBuyContract { /*** CONSTANTS ***/ uint256 public constant MAX_CONTRIBUTION_SLOTS = 20; uint256 private firstStepLimit = 0.053613 ether; uint256 private secondStepLimit = 0.564957 ether; /*** DATATYPES ***/ // @dev A Group is created for all the contributo...
Assigns a new address to act as the CFO. Only available to the current CEO. _newCFO The address of the new CFO
function setCFO(address _newCFO) external onlyCEO { require(_newCFO != address(0)); cfoAddress = _newCFO; }
12,786,752
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ---...
Internal functions -----------------------------------------------------------------------------------------------------------------
function hashString(string memory _string) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_string)); }
1,005,886
./full_match/80001/0xFDA64Bfd52fE2eEe38A4f5008d424A4b2297110d/sources/contracts/contract.sol
for registering a new address to be a shop address
function addShop( string memory _name, string memory _email, string memory _location,string memory _desp ) public returns (uint256) { require(isShop[msg.sender]!=true && isClient[msg.sender]==false && msg.sender!=owner,"new-emp address only"); Shop storage shop = shops[shopAmount]; shop.title = ...
9,441,817
// SPDX-License-Identifier: GPLv3 pragma solidity ^0.6.12; interface ERC20 { function balanceOf(address who) external view returns (uint); function decimals() external view returns (uint); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to...
查询用户指定编号的跨链转账详情 addr 查询的用户地址 index 查询转账的索引编号,不能大于等于query_account返回的总共跨链转账次数
function query_user_tran(address addr, uint index)public view returns(address, string memory, uint, uint, uint, uint){ require(index < users[addr].trans.length, "index out of bounds"); }
575,537
./partial_match/56/0x09cD7a706E6783b6Bea73240CEf9ae6fEFd06F70/sources/BiscuitMasterChef.sol
Deposit LP tokens to BiscuitFarmer.
function deposit(uint256 _pid, uint256 _amount, address _referrer) public { require(_amount > 0, "BiscuitFarmer::deposit: amount must be greater than 0"); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); _harvest(_...
11,262,782
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarvest; uint256 maxDebtPerHarvest; uint256 lastReport; uin...
Part: IBalancerVault enconding formats https:github.com/balancer-labs/balancer-v2-monorepo/blob/master/pkg/balancer-js/src/pool-weighted/encoder.ts
interface IBalancerVault { enum PoolSpecialization {GENERAL, MINIMAL_SWAP_INFO, TWO_TOKEN} enum JoinKind {INIT, EXACT_TOKENS_IN_FOR_BPT_OUT, TOKEN_IN_FOR_EXACT_BPT_OUT, ALL_TOKENS_IN_FOR_EXACT_BPT_OUT} enum ExitKind {EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, EXACT_BPT_IN_FOR_TOKENS_OUT, BPT_IN_FOR_EXACT_TOKENS_OUT...
583,148
/** *Submitted for verification at Etherscan.io on 2022-02-14 */ pragma solidity 0.6.7; abstract contract Setter { function modifyParameters(bytes32, uint256) public virtual; function addManualSetter(address) public virtual; function removeManualSetter(address) public virtual; function updateResult(uint256) ...
GEB_DEBT_AUCTION_INITIAL_PARAM_SETTER - Set update delay to 7 days (604800 seconds) GEB_DEBT_FLOOR_ADJUSTER - Remove 0xfA5e4955a11902f849ECaddEf355Db69C2036de6 from manual setters and add pauseProxy GEB_GAS_PRICE_ORACLE - Increase to 350 gwei GEB_SINGLE_CEILING_SETTER - Remove pauseProxy from manual setters GEB_ESM_THR...
function execute(bool) public { Setter(GEB_DEBT_AUCTION_INITIAL_PARAM_SETTER).modifyParameters("updateDelay", 604800); Setter(GEB_DEBT_FLOOR_ADJUSTER).addManualSetter(GEB_PAUSE_PROXY); Setter(GEB_DEBT_FLOOR_ADJUSTER).removeManualSetter(0xfA5e4955a11902f849ECaddEf355Db69C2036de6); Setter(GEB_GAS_PRIC...
10,676,016
./full_match/77/0x48BeC2C1D4423504ac377107c2c68bEe347B30E1/sources/contracts/Asset.sol
Withdraws funds dst Asset destination address (balance owner) value Asset value
function exit(address dst, uint256 value) external onlyLive { if (value > 2**255) { revert UintOverflow(); } ledger.add(msg.sender, address(asset), -int256(value)); if (!asset.transfer(dst, value)) { revert TransferFiled(address(this), dst, address(asset), value); } emit Exit(dst, ...
5,046,826
./full_match/1/0x5577Cf81459b742Dbfe757f98cB3eD4eD8e7Df30/sources/contracts/RWAHubOffChainRedemptions.sol
To enable and disable off chain redemptions Minimum off chain redemption amount
{ bool public offChainRedemptionPaused; uint256 public minimumOffChainRedemptionAmount; constructor( address _collateral, address _rwa, address managerAdmin, address pauser, address _assetSender, address _feeRecipient, uint256 _minimumDepositAmount, uint256 _minimumRedemptionAmou...
17,169,679
./partial_match/5/0xEe9A9cD1ce3eAfd06cb8ae3f76aA3222921391b6/sources/MyToken.sol
virtual means function can be overridden in the future.
function transfer(address _to, uint256 _value) public virtual returns (bool success) { require(_value > 0 && _balances[msg.sender] >= _value); _balances[_to] += _value; _balances[msg.sender] -= _value; emit Transfer(msg.sender, _to, _value); return true; }
16,861,715
//Address: 0x8C95e60A62b8d71CC557F1fd0f9Ce011b83F8d68 //Contract name: Marijuaneum //Balance: 0 Ether //Verification Date: 3/14/2017 //Transacion Count: 6 // CODE STARTS HERE pragma solidity 0.4.8; contract tokenSpender { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } ...
Public variables of the token / This creates an array with all balances / This generates a public event on the blockchain that will notify clients / Initializes contract with initial supply tokens to the creator of the contract /
function Marijuaneum() { initialSupply = 420000000000000; burnAddress = 0x1b32000000000000000000000000000000000000; }
5,409,729
./full_match/137/0xC76d699Dac2c750DA123A997aF721a76e4534E82/sources/contracts/Stake.sol
View function to see pending Reward on frontend.
function pendingReward(address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo; UserInfo storage user = userInfo[_user]; uint256 accPerShare = pool.accPerShare; if (block.number > pool.lastRewardBlock && totalStaked != 0) { uint256 multiplier =...
4,777,971
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contract...
Extend a stake for an account index uint256 account address amount uint256/ If selected stake is fully vested create a new stake Calculate a new timestamp proportional to the new amount New timestamp limited to current timestamp (amount / newInitial approaches 1)
function extendFor( uint256 index, address account, uint256 amount ) public { require(amount > 0, "AMOUNT_INVALID"); Stake storage selected = allStakes[account][index]; if (vested(account, index) == selected.initial) { stakeFor(account, amount); uint256 newInitial = selected.in...
2,549,072
/** *Submitted for verification at Etherscan.io on 2021-03-11 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens ...
Change the price oracle contract used, in case of upgrades --------------------
function startChangePriceOracle(address _address) external onlyGovernance { _timelockStart = now; _timelockType = 5; _timelock_address = _address; }
2,108,608
/* FOOToken */ /* Released on 11.11.2018 v.1.0 */ /* To celebrate 100 years of Polish */ /* INDEPENDENCE */ /* ==================================== */ /* National Independence Day is a */ /* national day in Poland celebrated on */ /* 11 No...
Transfer the specified amount of tokens to the specified address. This function works the same with the previous one but doesn't contain `_data` param. Added due to backwards compatibility reasons. _to Receiver address. _value Amount of tokens that will be transferred./ Retrieve the size of the code...
function transfer(address _to, uint _value) whenNotPaused validDestination(_to) public { uint codeLength; bytes memory empty; assembly { codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_t...
12,655,366
./full_match/1/0x9d52DdE1B84264fE42fAffa58741842E4d6AF02E/sources/BuildaInu.sol
SPDX-License-Identifier: Unlicensed
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint...
5,011,462
/** *Submitted for verification at Etherscan.io on 2020-11-05 */ /* website: bns.finance This project is freshly written to change the way ICO is done. BBBBBBBBBBBBBBBBB NNNNNNNN NNNNNNNN SSSSSSSSSSSSSSS DDDDDDDDDDDDD EEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFIIIIIIIIII B:::::::::...
Add supported currencies and their rate w.r.t token on sale rateToken = price of one satoshi of the token in terms of token to be raised 1e18 1 BNSD = 0.00021 ETH => 1e18 BNSD Satoshi = 0.00021 1e18 ETH satoshi => 1 BNSD Satoshi = 0.00021 ETH satoshi => rateToken = 0.00021 1e18 = 21 1e13 rateToken for BNSD/ETH pai...
function addSupportedCurrencies(uint256 _pid, address _tokenRaise, uint256 rateToken) external { _checkUpdateAllowed(_pid); listSupportedCurrencies[_pid].push(_tokenRaise); } saleRateInfo[_pid][_tokenRaise] = rateToken; poolInfo[_pid].paymentMethodAdded = true;
1,045,274
./partial_match/1/0x41C1F38A4BbFA4f14Ef235ed8901b3a0e51a2933/sources/NABC.sol
Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender] + addedValue ); return true; }
2,617,104
pragma solidity ^0.4.24; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ 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; ...
-------------------------------------------------------------------------- BOOSTER--------------------------------------------------------------------------
function buyBooster(uint256 idx) public isNotOver isCurrentRound payable { require(idx < numberOfBoosts); BoostData storage b = boostData[idx]; if(msg.value < getBoosterPrice(idx) || msg.sender == b.owner){ revert(); } address beneficiary = b.owner; uint256...
7,869,590
./full_match/5/0x4a10c90C0A6616e98336BBc5C521c628FA1Ed663/sources/contracts/contracts-v10/contracts/CheckerMaster.sol
Tasks --------------------
function requireWorkerOnTask( uint256 _taskID, address _address ) public view { require( isWorkerOnTask(_taskID, _address), "Address is not worker on task" ); }
11,586,439
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @notice Simple multi-sig Wallet. */ contract Wallet { bool isInit; uint256 public threshold; uint256 private transactionIndex; uint256 private updatethresholdIndex; uint256 private removeOwnerIndex; ...
adds an owner after reaching the threshold. _index the transaction index./
function addOwnerApproval(uint256 _index) external onlyOwners { require( addOwnerSigners[msg.sender][_index] == false, "You already signed this transaction" ); AddOwner storage _addOwner = addOwner[_index]; address toAdd = _addOwner.add; require(!_addO...
1,795,452
./full_match/1/0xa48c616144FD4429b216A86388CAb0Eed990cE87/sources/contracts/Strategy.sol
onlyStrategist or multisig:
function _cancelPendingTrades(uint256[] calldata _pendingTrades) internal { for (uint256 i; i < _pendingTrades.length; i++) { _cancelPendingTrade(_pendingTrades[i]); } }
8,293,414
./partial_match/1/0x67c5F13c56aEb40fd9a937214E5429dAf8A0CfC9/sources/contracts/FCNProduct.sol
Calculates the fees that should be collected from a given vault vaultAddress is the address of the vault/
function calculateFees( address vaultAddress ) public view validVault(vaultAddress) returns (uint256 totalFee, uint256 managementFee, uint256 yieldFee) { FCNVaultMetadata storage vaultMetadata = vaults[vaultAddress]; return vaultMetadata.calculateFees(managementFeeBps, yieldFeeBps); ...
15,753,074
/** * @title Math * @dev Assorted math operations */ library Math { function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) intern...
Query if a contract implements an interface _interfaceID interfaceID being checked return bool if the current contract supports the queried interface/
function supportsInterface(bytes4 _interfaceID) external view returns (bool) { }
11,939,706
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarvest; uint256 maxDebtPerHarvest; uint256 lastReport; uin...
safe to enter more than we havelet's take the amount we need if virtual price is real. Let's add the
function withdrawSome(uint256 _amount) internal returns (uint256 _liquidatedAmount, uint256 _loss) { uint256 wantBalanceBefore = want.balanceOf(address(this)); uint256 virtualPrice = virtualPriceToWant(); uint256 amountWeNeedFromVirtualPrice = _amount.mul(1e18).div(virtualPrice); ...
13,946,398
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...
Whether `a` is less than or equal to `b`. a a FixedPoint.Signed. b an int256. return True if `a <= b`, or False./
function isLessThanOrEqual(Signed memory a, int256 b) internal pure returns (bool) { return a.rawValue <= fromUnscaledInt(b).rawValue; }
98,898
./full_match/1/0x423f4e6138E475D85CF7Ea071AC92097Ed631eea/sources/contracts/Pondclaims.sol
Verify that all lengths match
function canClaim( address[] calldata addresses, uint256[] calldata amounts, uint32[] calldata offsets, bytes32[][] calldata merkleProofs ) external view returns (bool[] memory) { uint length = addresses.length; require(amounts.length == length && offsets.length =...
17,144,789
/* ⚠⚠⚠ WARNING WARNING WARNING ⚠⚠⚠ This is a TARGET contract - DO NOT CONNECT TO IT DIRECTLY IN YOUR CONTRACTS or DAPPS! This contract has an associated PROXY that MUST be used for all integrations - this TARGET will be REPLACED in an upcoming Synthetix release! The proxy can be found by looking up the PROXY propert...
Views Restricted functions https:docs.synthetix.io/contracts/source/interfaces/ifeepool Views solhint-disable-next-line func-name-mixedcase Mutative Functions Restricted: used internally to Synthetix
interface IFeePool { function FEE_ADDRESS() external view returns (address); function feesAvailable(address account) external view returns (uint, uint); function feePeriodDuration() external view returns (uint); function isFeesClaimable(address account) external view returns (bool); function ta...
84,651
pragma solidity >=0.5.4 <0.6.0; import './AOLibrary.sol'; import './TheAO.sol'; import './IAOSetting.sol'; import './INameFactory.sol'; import './IAOSettingAttribute.sol'; import './IAOSettingValue.sol'; import './INameTAOPosition.sol'; import './INameAccountRecovery.sol'; /** * @title AOSetting * * This contract ...
Advocate of _creatorTAOId adds a bool setting _settingName The human-readable name of the setting _value The bool value of the setting _creatorTAOId The taoId that created the setting _associatedTAOId The taoId that the setting affects _extraData Catch-all string value to be stored if exist/ Update global variable...
function addBoolSetting( string memory _settingName, bool _value, address _creatorTAOId, address _associatedTAOId, string memory _extraData) public isTAO(_creatorTAOId) isTAO(_associatedTAOId) settingNameNotTaken(_settingName, _associatedTAOId) onlyAdvocate(_creatorTAOId) senderNameNotCompromised...
2,518,417
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol"; /* Basically this is supposed to be a smart contract that self-regulates masterchef Inflation is pre-determined with this contract... It can also be mo...
shit doesn't really matter cuz after big fibonnaci daz we go down to 25-golden ratio, so need not to remember until then
function rapidAdoptionBoost() public { rapidAdoptionBoost = true; if(rapidAdoptionBoost) { reject "already been activated"; } if(block.timestamp < 22.september) { reject "rapidAdoptionBoost can only be activated after this period" } }
1,047,209