file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/62320/0x5F234B6b82F5fF67Eeb4aB5D676c50ac9A07D009/sources/contracts/common/linkedlists/LinkedList.sol
Inserts an element into a doubly linked list. list A storage pointer to the underlying list. key The key of the element to insert. previousKey The key of the element that comes before the element to insert. nextKey The key of the element that comes after the element to insert./
function insert( List storage list, bytes32 key, bytes32 previousKey, bytes32 nextKey ) internal { require(key != bytes32(0), "Key must be defined"); require(!contains(list, key), "Can't insert an existing element"); require(previousKey != key && nextKey != key, "Key cannot be the same a...
11,034,518
./full_match/5/0x28f083f2115fbE136F2c664E90DBc27429C55c9F/sources/src/Exchanger.sol
@inheritdoc IExchanger
function getVerifierProxyAddress() external view override returns (IVerifierProxy verifierProxyAddress) { return s_verifierProxyAddress; }
7,079,584
./full_match/137/0x8FdB00417Ce5763ad8B8a78202cD19142abC7ef8/sources/contracts/evolvingnft2.sol
Collects and distributes the primary sale value of NFTs being claimed.
function _collectPriceOnClaim( address _primarySaleRecipient, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken ) internal virtual override { if (_pricePerToken == 0) { return; } uint256 totalPrice = _quantityToClaim * _price...
3,755,899
pragma solidity ^0.5.0; import "../interfaces/IPMETokenRolesStorage.sol"; import "../interfaces/IPMRolesManagerStorage.sol"; import "../../../common/libraries/SafeMath8.sol"; import "../../../registry-layer/components-registry/getters/PermissionModuleAddress.sol"; /** * @title Permission module extended token roles s...
Returns list of all roles of the wallet/
function getWalletRolesForTokenWithSubId( address wallet, address token, bytes32 subId ) public view returns (bytes32[20] memory) { return listOfTheTokenDependentRoles[wallet][token][subId]; }
12,669,938
./full_match/80001/0xC5175391470dA0CD3BfD2EAC79123C331Ff7a541/sources/_xaya/eth-account-registry/contracts/HexEscapes.sol
Converts a binary string into all-hex characters./
function hexlify (string memory str) internal pure returns (string memory) { bytes memory data = bytes (str); StringBuilder.Type memory builder = StringBuilder.create (2 * data.length); for (uint i = 0; i < data.length; ++i) { bytes memory cur = bytes ("xx"); uint8 val = uint8 (d...
5,564,547
./full_match/1/0xccA4CD578eAc8677cb50A323289E3314278b9479/sources/contracts/Burner_contract.sol
slippage value: 1 means 0.1%, 10 means 1%, 100 means 10%, 1000 means 100%
function BurnSale( uint256 ethToSell, uint256 _slippage) public payable onlyOwner{
3,140,889
./full_match/5/0x6b7262835B325A9808236460BfD7E293b5E0ccA0/sources/contracts/Contract.sol
shirtNumbersProposed has to be in ascending order check que length == TOTAL_UNIQUE_STICKERS Check that pool balance > 0 32 countrys + 3 types Generate the correspondent stickerId with the proposed shirtnumber Check ownership & Burn token Id
function claimPrizeV2(uint256[] calldata shirtNumbersProposed) external nonReentrant { require(winnersRemaining() > 0, "No more winners"); uint256 shirtNumberIndex; for (uint256 i = 0; i < TOTAL_COUNTRIES; i++) { uint256 countryId = i + 1; for (ui...
7,059,598
pragma solidity ^0.4.11; //------------------------------------------------------------------------------------------------ // LICENSE // // This file is part of BattleDrome. // // BattleDrome is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as pu...
Function to check if crowdsale is complete (have we eigher hit our max, or passed the crowdsale completion block?)
function isComplete() constant returns(bool) { return (savedBalance >= fundingMax) || (block.number > (startBlock + duration)); }
6,451,915
pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high ...
allows one time setting of admin for deployment purposes
function setPendingAdmin(address pendingAdmin_) public { if (admin_initialized) { require(msg.sender == address(this), "Bentolock::setPendingAdmin: Call must come from Bentolock."); require(msg.sender == admin, "Bentolock::setPendingAdmin: First call must come from admin."); ...
10,045,128
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import "lib/forge-std/src/Test.sol"; import {Whitelist} from "../contracts/Whitelist.sol"; import {DummyDAI} from "../contracts/DummyDAI.sol"; import {pVoid} from "../contracts/pVoid.sol"; import {DummyTreasury} from "../contracts/DummyTreasury.sol"...
whitelist the test wallet Transfer dummy dai to the wallet and pvoid to the contract Test the invest function Approve the spend limit Approve the spend limit Transfer tokens to treasury
function test_invest() public { wlist.addWhitelist(testWallet); wlist.addWhitelist(testWallet2); require(wlist.isUserWhitelisted(testWallet) == true); require(wlist.isUserWhitelisted(testWallet2) == true); wlist.toggleSale(); require(wlist.isSaleOn() == false); ...
6,442,391
// SPDX-License-Identifier: No License pragma solidity ^0.8.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a673994de5eba4305cefb8ae98ea9ad37a43efaa/contracts/token/ERC20/IERC20.sol"; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a673994de5eba4305cefb8ae98ea9ad37a43efaa/co...
Updates presale stop time (Unix Timestamp Seconds)/
function updatePreSaleStopTime(uint256 _preSaleStopTime) external onlyOwner { require(_preSaleStopTime > preSaleStartTime, "Stop time should be greater than start time"); preSaleStopTime = _preSaleStopTime; }
12,725,941
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; pragma abicoder v2; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; /// @title Accessory SVG generator library Lines3 { /// @dev Accessory NΒ°1 => Classic function fortune_41() public pure r...
Accessory NΒ°1 => Classic
function fortune_49() public pure returns (string[2] memory) { return ["Take nothing", "personally."] ; }
5,390,161
./full_match/8453/0x69298fFe05627268D32dd32762e364bfeb42206b/sources/src/JoeV21LegacyDexLens.sol
Batch add Native data feed for each (token, data feed) Can only be called by the owner _tokens The addresses of the tokens _dataFeeds The list of Native data feeds informations
function addNativeDataFeeds(address[] calldata _tokens, DataFeed[] calldata _dataFeeds) external override onlyOwner { _addDataFeeds(_WNATIVE, _tokens, _dataFeeds); }
11,556,660
// SPDX-License-Identifier: MIT /// @author Doge0420 and inspired by HashlipsLowerGasFee contract - MIT licence // Do not use this contract even i don't know if it's safe lol pragma solidity >=0.8.0 < 0.9.0; // cool stuff import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC...
ONLY OWNER add address to the blacklist
function blacklistAddAddress(address _address) public onlyOwner { require(!blacklist[_address], "This address has already been blacklisted."); blacklist[_address] = true; }
5,470,085
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @title Blacklistable Token * @dev Allows accounts to be blacklisted by a "blacklister" role */ abstract contract BlacklistableUpgradeable is...
Adds _msgSender() to blacklist (self-blacklist)/
function selfBlacklist() external { _blacklisted[_msgSender()] = true; emit SelfBlacklisted(_msgSender()); emit Blacklisted(_msgSender()); }
7,266,536
./partial_match/11155111/0x35f2DAaCE3E1A0B3fDC02a6d18371087009e2212/sources/contracts/PolliwogsHelper.sol
generates a random rarity/uint r5 = 20;
function _randomRarity(uint _salt) private returns (uint) { uint rand = _randomBetweenIncluded(_salt, 0, 100000); uint rarity = 1; uint r1 = 73980; uint r2 = 18000; uint r3 = 6000; uint r4 = 2000; if (rand >= 0 && rand < r1) { rarity = 1; ...
3,535,668
// SPDX-License-Identifier: WISE pragma solidity =0.8.12; import "./LiquidHelper.sol"; import "./LiquidTransfer.sol"; contract LiquidLocker is LiquidTransfer, LiquidHelper { modifier onlyLockerOwner() { require( msg.sender == globals.lockerOwner, "LiquidLocker: INVALID_OWNER" ...
This is a call made by the constructor to set up variables on a new locker. This is essentially equivalent to a constructor, but for our gas saving cloning operation instead./
function initialize( uint256[] calldata _tokenId, address _tokenAddress, address _tokenOwner, uint256 _floorAsked, uint256 _totalAsked, uint256 _paymentTime, uint256 _paymentRate ) external onlyFromFactory { globals = Globals({ ...
576,663
/** *Submitted for verification at Etherscan.io on 2021-09-06 */ // SPDX-License-Identifier: MIT pragma solidity =0.8.7; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view return...
See {IERC20-balanceOf}./
function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; }
2,187,086
// File: contracts/TokenErc20Ifc.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface TokenErc20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply(...
move whole balance to the owner
function withdraw() public restrict { owner.transfer(address(this).balance); }
12,853,211
pragma solidity >=0.5.4 <0.6.0; import './AOLibrary.sol'; import './TheAO.sol'; import './IAOSettingValue.sol'; /** * @title AOSettingValue * */ contract AOSettingValue is TheAO, IAOSettingValue { struct PendingValue { address addressValue; bool boolValue; bytes32 bytesValue; string stringValue; uint256...
Get pending value given a setting ID return The address pending value return The bool pending value return The bytes32 pending value return The string pending value return The uint256 pending value/
function pendingValue(uint256 _settingId) public view returns (address, bool, bytes32, string memory, uint256) { PendingValue memory _pendingValue = pendingValues[_settingId]; return ( _pendingValue.addressValue, _pendingValue.boolValue, _pendingValue.bytesValue, _pendingValue.stringValue, _pendingV...
14,066,694
./partial_match/1313161554/0xca9511B610bA5fc7E311FDeF9cE16050eE4449E9/sources/AuETH.sol
Accepts transfer of admin rights. msg.sender must be pendingAdmin Admin function for pending admin to accept role and update admin/ Check caller is pendingAdmin
function _acceptAdmin() external override{ if (msg.sender != pendingAdmin) { revert Unauthorized(); } address oldPendingAdmin = pendingAdmin; emit NewAdmin(oldAdmin, admin); emit NewPendingAdmin(oldPendingAdmin, pendingAdmin); }
16,916,229
//SPDX-License-Identifier: MIT pragma solidity 0.8.10; /* Testing utilities */ import { Test } from "forge-std/Test.sol"; import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; import { L2ToL1MessagePasser } from "../L2/L2ToL1MessagePasser.sol"; import { L1StandardBridge } from "../L1/L1StandardBridge.sol"; import...
Deploy the L1 bridge and initialize it with the address of the L1CrossDomainMessenger Deploy the L2StandardBridge, move it to the correct predeploy address and then initialize it Set up the L2 mintable token factory Deploy the L2 ERC20 now
function setUp() public virtual override { super.setUp(); vm.label( Lib_PredeployAddresses.L2_STANDARD_BRIDGE, "L2StandardBridge" ); vm.label( Lib_PredeployAddresses.L2_STANDARD_TOKEN_FACTORY, "L2StandardTokenFactory" ); ...
6,462,725
// SPDX-License-Identifier: MIT /* ________ __ _____ \______ \ _____ _______| | __ / _ \ ____ ____ | | \\__ \\_ __ \ |/ / / /_\ \ / ___\_/ __ \ | ` \/ __ \| | \/ < / | \/ /_/ > ___/ /_______ (____ /__| |__|_ \ \____|__ /\___ / \___ > \/ \...
Set the referral reward rate in basis points Requirements Can only be called by the owner./
function setReferralReward(uint16 newReward) public onlyOwner returns (bool) { referralReward = newReward; return true; }
12,849,146
/** *Submitted for verification at Etherscan.io on 2021-11-10 */ // Sources flattened with hardhat v2.6.4 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/[emailΒ protected] // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in th...
Sets our wallets to their initial values
function setWallets(address payable _urWallet) external onlyOwner { urWallet = _urWallet; }
6,688,621
pragma solidity ^0.4.24; /** * @title ERC20 interface * */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spe...
accept ether/
function() public payable { }
13,055,927
/** *Submitted for verification at Etherscan.io on 2021-03-30 */ /** β–„β–„β–„β–„β–„ β–ˆβ–ˆ β–ˆβ–„β–„β–„β–„ β–„β–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆ β–„β–„ β–„ β–ˆ β–ˆβ–ˆ β–„β–€ β–„ β–„β–„β–„β–„β–„ β–ˆ β–€β–„ β–ˆ β–ˆ β–ˆ β–„β–€ β–ˆβ–€ β–€β–„ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–„β–€ β–ˆ β–ˆ β–€β–„ β–„ β–€β–€β–€β–€β–„ β–ˆβ–„β–„β–ˆ β–ˆβ–€β–€β–Œ β–ˆ β–€ β–ˆ β–ˆ β–ˆβ–€β–€β–€ β–ˆβ–ˆβ–€β–€β–ˆ β–ˆβ–„β–„β–ˆ β–ˆ β–€β–„ β–ˆ β–ˆ β–„ β–€β–€β–€β–€β–„ β–€β–„β–„β–„β–„β–€ β–ˆ β–ˆ β–ˆ β–ˆ...
Returns the count of successful sarcophagi completed by the archaeologist archaeologist The address of the given archaeologist return the number of sarcophagi which have been successfully completed by the archaeologist/
function archaeologistSuccessesCount(address archaeologist) public view virtual returns (uint256) { return _data.archaeologistSuccesses[archaeologist].length; }
2,451,214
pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract BicycleToken { // Public variables of the token string public name = "Bicycle Token"; string public symbol = "BIC"; uint8 public decimals = 0...
Constrctor function Initializes contract with initial supply tokens to the creator of the contract/
function BicycleToken() public { creator = msg.sender; }
6,685,278
// File: @openzeppelin/contracts/utils/EnumerableSet.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and c...
Checks whether the token is already active (crowdsale finsihed and cooldown date reached)/ admin can always send
function tokenActive() public view returns(bool) { return false; }
13,717,131
./partial_match/1/0x475D148484CD934d0c74C6d00fd6e942d9165EC5/sources/XRAID.sol
Change the address of the tax wallets _taxWallets The new address of the tax wallets
function setTaxWallets(address payable[2] memory _taxWallets) external onlyOwner { emit TaxWalletsChanged(taxWallets, _taxWallets); taxWallets = _taxWallets; }
2,592,253
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Decode the parameters of a takeOrder call _actionData Encoded parameters passed from client side return encodedZeroExOrderArgs_ Encoded args of the 0x order return takerAssetFillAmount_ Amount of taker asset to fill
function __decodeTakeOrderCallArgs(bytes memory _actionData) private pure returns (bytes memory encodedZeroExOrderArgs_, uint256 takerAssetFillAmount_) { return abi.decode(_actionData, (bytes, uint256)); }
149,982
./full_match/137/0xe80592BfCfb515a93e101bdCB9baEbe2D4d54b0B/sources/MaticSwapMasterChef.sol
Referral Bonus in basis points. Initially set to 2%, this this the ability to increase or decrease the Bonus percentage based on community voting and feedback.
function updateReferralBonusBp(uint256 _newRefBonusBp) public onlyOwner { require(_newRefBonusBp <= MAXIMUM_REFERRAL_BP, "updateRefBonusPercent: invalid referral bonus basis points"); require(_newRefBonusBp != refBonusBP, "updateRefBonusPercent: same bonus bp set"); uint256 previousRefBonusB...
3,746,524
./full_match/4/0xC2d0Ee71f7bd1406ef07B10C77c0A35FdB4B3Ee1/sources/localhost/CleverProtocol.sol
cycle bbonus set different since need for 4 decimal places of precision,rather than 2, lowest is 0.0025%divide by 1e4 to get %0.01% as 10, 0.1% as 1e2, 1% as 1e3 ,10% as 1e4, 100% as 1e5
function setCycleBonus() private { cycleBonus[1] = 1e3; cycleBonus[2] = 1e3; cycleBonus[3] = 1e3; cycleBonus[4] = 1e3; cycleBonus[5] = 1e3; cycleBonus[6] = 1e3; cycleBonus[7] = 1e3; cycleBonus[8] = 1e3; cycleBonus[9] = 0; cycleBonus[10]...
12,488,339
pragma solidity ^0.4.18; /** * SpaceWar * ETH Idle Game * spacewar.etherfun.net */ library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { req...
------------------------------------------------------------------------- SpaceWars game handler functions -------------------------------------------------------------------------
function StartNewMiner() external { require(miners[msg.sender].lastUpdateTime == 0); miners[msg.sender].lastUpdateTime = block.timestamp; miners[msg.sender].money = 0; miners[msg.sender].spaces[0] = 1; miners[msg.sender].unclaimedPot = 0; miners[msg.sender].lastP...
13,695,324
pragma solidity ^0.4.23; import "../math/SafeMath.sol"; import "../ownership/Ownable.sol"; import "./ERC721.sol"; import "./ERC721Metadata.sol"; import "./ERC165implementation.sol"; import "./ERC721TokenReceiver.sol"; import "../utils/AddressUtils.sol"; /* * @title None-fungable token. * @dev Xcert is an implementa...
Transfers the ownership of an NFT from one address to another address Throws unless `msg.sender` is the current owner, an authorized operator, or the approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero address. Throws if `_tokenId` is not a valid NFT. When transfer is...
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external { _safeTransferFrom(_from, _to, _tokenId, data); }
12,687,824
./full_match/1/0xc258fF338322b6852C281936D4EdEff8AdfF23eE/sources/src/EuclideanFarm.sol
Total reward tokens emitted in the given period
function getRewardForDuration() external view returns (uint256[] memory rewards_per_duration_arr) { rewards_per_duration_arr = new uint256[](rewardRates.length); for (uint256 i = 0; i < rewardRates.length; i++){ rewards_per_duration_arr[i] = rewardRates[i].mul(rewardsDuration); ...
4,833,099
pragma solidity ^0.4.21; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint a, uint b) internal p...
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./
function transfer(address _to, uint _value) public returns (bool) { bytes memory empty; return transfer(_to, _value, empty); }
369,050
./partial_match/1/0x235b25f9f56B39eFD8293C0d2A9Ee70719E25B85/sources/src/ButtonswapERC20.sol
Sets `value` as the allowance of `spender` over the caller's tokens. Emits a {IButtonswapERC20Events-Approval} event. owner The account whose tokens are being approved spender The account that is granted permission to spend the tokens value The amount of tokens that can be spent/
function _approve(address owner, address spender, uint256 value) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); }
4,108,261
./full_match/77/0x24A8EB688BF52dE873E8d42144b1F84F0D9aC225/sources/contracts/libraries/AffiliateHelper.sol
Get non-negative difference of `minuend` and `subtractend`. return `minuend - subtractend`if it is non-negative or 0/
function diffOrZero(uint256 minuend, uint256 subtractend) public pure returns (uint256) { return minuend > subtractend ? minuend - subtractend : 0; }
5,046,907
./full_match/5/0x65afA308A04ce593F6F1A8BD7A1458Db3266c72c/sources/contracts/libraries/StargateFeeLibraryV07.sol
--------------------- VIEW FUNCTIONS --------------------- get the fees for a swap. typically called from the router via the pool calculate the equilibrium reward calculate the equilibrium fee calculate protocol and lp fee cap the reward at the sum of protocol fee and lp fee by increasing the protocol fee
function getFees( uint256 _srcPoolId, uint256 _dstPoolId, uint16 _dstChainId, address _from, uint256 _amountSD ) external view override returns (Pool.SwapObj memory s) { bool whitelisted = whitelist[_from]; bool hasEqReward = s.eqReward > 0; uint2...
7,061,218
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. ...
Make the proposal fail if the dilutionBound is exceeded PROPOSAL PASSED if the applicant is already a member, add to their existing shares the applicant is a new member, create a new record for them if the applicant address is already taken by a member's delegateKey, reset it to their member address
function processProposal(uint256 proposalIndex) public { require(proposalIndex < proposalQueue.length, "Moloch::processProposal - proposal does not exist"); Proposal storage proposal = proposalQueue[proposalIndex]; require(proposal.processed == false, "Moloch::processProposal - proposal has...
14,105,325
./full_match/5/0x7cd5a260DB59b6AD0437D9a8Af02aC2Ac3891EcF/sources/project_/contracts/TokenFrontend.sol
Polygon Bridge Mechanism. Called when token is withdrawn from child chain. Should be callable only by Matic's Predicate contract. Should handle deposit by minting the required amount for user. to Address to credit the tokens. amount Number of tokens to mint./
function mint(address to, uint amount) external override returns (bool ok) { require(hasRole(PREDICATE_ROLE, msg.sender), "caller is not PREDICATE"); ok = this.mintTo(to, amount); }
1,901,902
pragma solidity >=0.5.2 <0.7; /** * @title Simple Storage with events * @dev Read and write values to the chain */ contract SimpleEvents { int64 public storedI; string public storedS; event Changed ( address indexed from, int64 indexed i, string indexed s, bytes32 h, string m ); /...
Get the value/
function get() public view returns (int64 i, string memory s) { return (storedI, storedS); }
12,803,023
./full_match/5/0x12aC0FC2633FB9661A05228C33529778f8d273d8/sources/contracts/versions/StakingV1.sol
_rewards=0; Check if timestamp meet at least 3 months
function rewardCalculator(uint256 _stakeToken) internal view returns (uint256){ StakedAsset memory stakedToken = stakedAssets[_stakeToken]; bool check = false; bool getQuater = false; uint256 currentTs = block.timestamp; uint256 month = BokkyPooBahsDa...
1,849,848
// Wow Internet Labz Pvt. Ltd. (connect@wowlabz.com) pragma solidity ^0.4.15; import './lifecycle/Pausable.sol'; import './math/SafeMath.sol'; import './BloodlineBLCToken.sol'; /** * The BloodlineBLCSale smart contract is used for selling BloodlineBLCToken * tokens (BLC). It does so by converting ETH received into...
Returns the current time. Useful to abstract calls to "now" for tests./
function currentTime() constant returns (uint _currentTime) { return now; }
973,875
./partial_match/3/0x32E64B02d1E0806Fa400Aa2116BCaE19bFB20B1A/sources/SigToken.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) external { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name())), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegat...
5,254,768
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/interfaces/IERC721.sol"; import "./interfaces/IMintableERC721.sol"; /** * @title Mintable Dutch Sale * * @notice Mint...
Buys single token to an address specified. Accepts ETH as payment and mints a token _to address to mint token to/ calculate item price verify the inputs and transaction value verify mint limit if ETH amount supplied exceeds the price send excess amount back to sender
function buySingleTo(address _to) public payable { uint64 itemPrice = itemPrice(); require(_to != address(0), "recipient not set"); require(msg.value >= itemPrice, "not enough funds"); if(mintLimit != 0) { require(mints[msg.sender] + 1 <= mintLimit, "mint limit reached"); } if(msg....
14,638,260
/** *Submitted for verification at Etherscan.io on 2021-04-04 */ // File: contracts/interfaces/ISaffronBase.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.1; interface ISaffronBase { enum Tranche {S, AA, A} enum LPTokenType {dsec, principal} // Store values (balances, dsec, vdsec) with TrancheUint...
Update state for removal via dsec token Get info about the v1 dsec token from its address and check that it exists Token epoch must be a past epoch Dsec gives user claim over a tranche's earned SFI and interest Update state for removal via principal token Get info about the v1 dsec token from its address and check that...
function remove_liquidity(address dsec_token_address, uint256 dsec_amount, address principal_token_address, uint256 principal_amount) external override { require(dsec_amount > 0 || principal_amount > 0, "can't remove 0"); ISaffronAdapter best_adapter = ISaffronAdapter(best_adapter_address); uint256 intere...
15,061,237
./partial_match/1/0x57FeA15015C8f0Fd35B3A25f57A75a94656B1769/sources/TrueRatingAgency.sol
Set loss factor. Loss factor decides what percentage of TRU is lost for incorrect votes newLossFactor New loss factor/
function setLossFactor(uint256 newLossFactor) external onlyOwner { require(newLossFactor <= 10000, "TrueRatingAgency: Loss factor cannot be greater than 100%"); lossFactor = newLossFactor; emit LossFactorChanged(newLossFactor); }
4,100,199
// Copyright 2019 Cartesi Pte. Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 ...
Virtual Address Translation proccess is defined, step by step on the following Reference: Reference: riscv-priv-spec-1.10.pdf - Section 4.3.2, page 62.TO-DO: check shift + maskTO-DO: use bitmanipulation right shift Through arrays we force variables that were being put on stack to be stored in memory. It is more expensi...
function translateVirtualAddress( MemoryInteractor mi, uint64 vaddr, int xwrShift ) public returns(bool, uint64) { uint64[6] memory uint64vars; int[6] memory intvars; intvars[PRIV] = mi.readIflagsPrv(); uint64vars[MSTATUS] = mi.memoryRead(Shadow...
5,415,989
/** *Submitted for verification at Etherscan.io on 2021-08-23 */ // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount o...
Calculate management fee Outstanding management fee is calculated from the time the last fee is collected.
function calcManagementFee() public view returns (uint256){ SmartPoolStorage.Fee memory fee = getFee(SmartPoolStorage.FeeType.MANAGEMENT_FEE); uint256 denominator = fee.denominator == 0 ? 1000 : fee.denominator; if (fee.lastTimestamp == 0) return 0; uint256 diff = block.timestamp.sub...
6,627,269
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@airswap/staking/contracts/interfaces/IStaking.sol"; import "./interfaces/IPoo...
Withdraw tokens from the pool using a signed claim minimumAmount uint256 token address participant address nonce uint256 expiry uint256 score uint256 v uint8 "v" value of the ECDSA signature r bytes32 "r" value of the ECDSA signature s bytes32 "s" value of the ECDSA signature/
function withdrawProtected( uint256 minimumAmount, address recipient, address token, uint256 nonce, uint256 expiry, address participant, uint256 score, uint8 v, bytes32 r, bytes32 s ) public override returns (uint256) { _checkValidClaim(nonce, expiry, participant, score, ...
209,560
// SPDX-License-Identifier: MIT // File contracts/stake/StakedTokenV3.sol /** * @title StakedToken * @notice Contract to stake Aave token, tokenize the position and get rewards, inheriting from a distribution manager contract * @author Aave **/ pragma solidity 0.7.5; pragma experimental ABIEncoderV2; import "./hel...
Redeems staked tokens, and stop earning rewards to Address to redeem to amount Amount to redeem/solium-disable-next-line
function redeem(address to, uint256 amount) external override nonReentrant { require(amount != 0, 'INVALID_ZERO_AMOUNT'); uint256 cooldownStartTimestamp = stakersCooldowns[_msgSender()]; require( block.timestamp > cooldownStartTimestamp.add(COOLDOWN_SECONDS), 'INSUFFICIENT_COOLDOWN' ); ...
1,673,472
./full_match/4/0x87a4F79a4F856736070795f888f94C71C39B1cE1/sources/contracts/BondDepository.sol
calculate current bond price and remove floor if above return price_ uint/
function _bondPrice() internal returns (uint256 price_) { price_ = terms.controlVariable.mul(debtRatio()).add(1000000000).div( 1e7 ); if (price_ < terms.minimumPrice) { price_ = terms.minimumPrice; terms.minimumPrice = 0; } }
724,338
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @artist: Anna Ridler /// @author: manifold.xyz import "@prb/math/contracts/PRBMathSD59x18.sol"; import "./libraries/Trigonometry.sol"; import "./libraries/BokkyPooBahsDateTimeLibrary.sol"; import "./dynamic/DynamicArweaveHash.sol"; import "./extensions/ERC...
Divides two signed 59.18-decimal fixed-point numbers, returning a new signed 59.18-decimal fixed-point number. Variant of "mulDiv" that works with signed numbers. Works by computing the signs and the absolute values separately. Requirements: - All from "PRBMath.mulDiv". - None of the inputs can be MIN_SD59x18. - The d...
function div(int256 x, int256 y) internal pure returns (int256 result) { if (x == MIN_SD59x18 || y == MIN_SD59x18) { revert PRBMathSD59x18__DivInputTooSmall(); } uint256 ay; unchecked { ax = x < 0 ? uint256(-x) : uint256(x); ay = y < 0 ? uint256(-...
10,297,500
pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than...
- Verify whether a superblock's data is consistent Only should be called when all blocks header were submitted
function doVerifySuperblock(BattleSession storage session, bytes32 sessionId) internal returns (uint) { if (session.challengeState == ChallengeState.PendingVerification) { uint err; err = validateLastBlocks(session); if (err != 0) { emit ErrorBattle(sessio...
6,390,700
./full_match/43113/0xb6178AB3c185282F418cEf55e52166bE0a2a6575/sources/contracts/PartyV1.sol
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } constructor() { _setOwner(_msgSender()); }
7,127,406
pragma solidity ^0.4.24; import "./RightsDigitalAssetSpec.sol"; import "./interfaces/IRightsDigitalAssetObject.sol"; import "./utils/RDDNControl.sol"; import "openzeppelin-solidity/math/SafeMath.sol"; import "openzeppelin-solidity/token/ERC721/ERC721Full.sol"; /// @title RightsDigitalAssetObject /// @dev ERC721 base...
Set MediaId _objectId object identifer _mediaId mediaId set mediaId
function setMediaId(uint256 _objectId, string _mediaId) public whenNotPaused { require(_exists(_objectId)); DigitalAssetObject storage digitalAsset = digitalAssetObjects[_objectId]; require(spec.ownerOf(digitalAsset.specId) == msg.sender); require(keccak256(abi.encodePacked(digitalA...
12,628,869
./full_match/42/0x99743a2dF45bE75832c083e0d0644BF2E9F0a0C1/sources/contracts/mimic/SocialTraderToken.sol
Allows the social trader to remove an UNSAFE module Remove an unsafe module from the token _module address of the unsafe module (that's added)
function removeUnsafeModule(address _module) external override unsafeModuleCheck onlyAdmin { if(_module == address(0)) revert ZeroAddress(); approvedUnsafeModules[_module] = false; }
9,595,173
/** *Submitted for verification at Etherscan.io on 2021-09-25 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, ...
Strings Library (author James Lockhart: james at n3tw0rk.co.uk) Modified String Split: String splitByComaAndSpace Splits a string into an array of strings based off the delimiter value, in this case ",". _base When being used for a data type this is the extended object otherwise this is the string value ...
function _splitByComaAndSpace(string memory _base) internal pure returns (string[] memory splitArr) { bytes memory _baseBytes = bytes(_base); string memory _value = ","; uint _offset = 0; uint _splitsCount = 1; while (_offset < _baseBytes.length -...
15,062,693
pragma solidity ^0.5.0; contract Charity { enum CharityStatus {UNVERIFIED, VERIFIED, REJECTED} enum CampaignStatus {ONGOING, ENDED} struct charity { address charityOwner; string charityName; string charityAddress; string contactNumber; string description; s...
This will be the function that updates the campaign's noOfDonors Parameters of this function will include uint campaignId/
function addCampaignDonor( uint256 campaignId ) public { require(campaignId < noOfCampaigns, "Invalid campaign id"); uint256 newNumber = campaigns[campaignId].noOfDonors + 1; campaigns[campaignId].noOfDonors = newNumber; }
6,449,599
pragma solidity ^0.5.0; /** * @title Queue * @dev Data structure contract used in `Crowdsale.sol` * Allows buyers to line up on a first-in-first-out basis * See this example: http://interactivepython.org/courselib/static/pythonds/BasicDS/ImplementingaQueueinPython.html */ import './utils/SafeMath.sol'; contract...
Removes the first person in line; either when their time is up or when they are done with their purchase/
function dequeue() public { require(first <= last); delete queue[first]; first += 1; }
13,010,436
./full_match/80001/0xB3E9C108804571C13E085745be146e87Ee1ed5dc/sources/contracts/CryptoHomiesGenesis.sol
total eth to mint 0.101 Calculate the platform fee Calculate the total amount to be paid by the user Transfer the platform fee to the specified address Refund any excess amount sent by the user
function _mint(address _buyer, uint quantity) internal override { uint balance = balanceOf( msg.sender ); uint16 _tokenId = tokenIdCount + 1; require( quantity <= MAX_ORDER); require(balance + quantity <= MAX_WALLET); require(saleActive, "Sale not active"); require(_t...
5,692,104
pragma solidity ^0.4.13; /** * @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 div(uint256 a, uint256 ...
Returns the number of transferable company&39;s tokens/
function numOfTransferableCompanysTokens() constant public returns (uint256) { uint256 unlockedTokens = 0; for (uint8 i; i < publicOfferingPlans.length; i++) { PublicOfferingPlan memory plan = publicOfferingPlans[i]; if (plan.unlockCompanysTokensAt <= now) { u...
15,286,440
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts...
mint up to `sloth` tokens
function mint(uint256 sloths) public payable { _enforceNotPaused(); require(_isRegularPeriod(), "NotInRegularSalePeriod"); require(sloths > 0, "ZeroSlothsRequested"); require(sloths * PRICE == msg.value, "InvalidETHAmount"); _mints[msg.sender] += sloths; require(_mint...
13,913,399
./partial_match/1/0xD69098d4c8C0f6761b540BC3c1421587bee2B347/sources/SHARK.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEthToMarket(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupport...
2,701,900
pragma solidity ^0.5.0; /** * @title Tellor Transfer * @dev Contais the methods related to transfers and ERC20. Tellor.sol and TellorGetters.sol * reference this library for function's logic. */ library TellorTransfer { using SafeMath for uint256; event Approval(address indexed _owner, address indexed _spende...
Get the name of the token return string of the token name/
function getName(TellorStorage.TellorStorageStruct storage self) internal pure returns (string memory) { return "Tellor Tributes"; }
12,861,464
pragma solidity ^0.4.23; import '../openzeppelin-solidity-112/contracts/math/SafeMath.sol'; import "../openzeppelin-solidity-112/contracts/ownership/DelayedClaimable.sol"; import "../openzeppelin-solidity-112/contracts/access/rbac/RBAC.sol"; import "../utils/StringUtils.sol"; /** * @title Whitelist * @dev The Whi...
remove an address from the whitelist _addr address return true if the address was removed from the multiOwner list, false if the address wasn't in the multiOwner list/ first remove the owner for every event type, if this owner has voted the event, then need to remove if this side only have this 1 voter, the au...
function removeAddressFromOwners(address _addr) onlyMultiOwners public { require(hasAuth(AUTH_REMOVEOWNER)); removeRole(_addr, ROLE_MULTIOWNER); uint j = 0; for (; j < owners.length; j = j.add(1)) { if (owners[j] == _addr) { delete owners[j]; break; } } ...
1,834,768
pragma solidity ^0.4.21; // File: contracts/ISimpleCrowdsale.sol interface ISimpleCrowdsale { function getSoftCap() external view returns(uint256); function isContributorInLists(address contributorAddress) external view returns(bool); function processReservationFundContribution( address contributo...
Finalize crowdsale if we reached hard cap or current time > SALE_END_TIME/ BNB transfer Referral Foundation Reserve Advisors Company Bounty Enable fund`s crowdsale refund if soft cap is not reached
function finalizeCrowdsale() public onlyOwner { if( (totalEtherContributed >= safeSub(hardCap, 20 ether) && totalBNBContributed >= safeSub(BNB_HARD_CAP, 10000 ether)) || (now >= SALE_END_TIME && totalEtherContributed >= softCap) ) { fund.onCrowdsaleEnd(); ...
6,310,853
/** *Submitted for verification at Etherscan.io on 2021-11-19 */ // SPDX-License-Identifier: AGPL-3.0-or-later // hevm: flattened sources of contracts/MplRewards.sol pragma solidity =0.6.11 >=0.6.0 <0.8.0 >=0.6.2 <0.8.0; ////// contracts/interfaces/IERC2258.sol /* pragma solidity 0.6.11; */ interface IERC2258 { ...
Increase the custody limit of a custodian either directly or via signed authorization Query individual custody limit and total custody limit across all custodians Allows a custodian to exercise their right to transfer custodied tokens Custody Events
interface IERC2258 { function increaseCustodyAllowance(address custodian, uint256 amount) external; function custodyAllowance(address account, address custodian) external view returns (uint256); function totalCustodyAllowance(address account) external view returns (uint256); function transferByCustod...
2,177,634
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0; import "../interfaces/IControllable.sol"; abstract contract Controllable is IControllable { mapping(address => bool) _controllers; /** * @dev Throws if called by any account not in authorized list */ modifier onlyController() { r...
max claims that can be made on this NFT/
function maxClaims() external view override returns (uint256) { return _maxClaims; }
11,794,157
./partial_match/1/0x43eA73168B8f192dBDEC088DA29F2C5E517f6fcB/sources/contracts-verify/KUMASwap.sol
Cancel the initialization of the deprecation mode Can only be called by the KUMA_MANAGER_ROLE Can only be called if deprecation mode is not enabled/
function uninitializeDeprecationMode() external onlyRole(Roles.KUMA_MANAGER_ROLE) whenNotDeprecated { if (_deprecationInitializedAt == 0) { revert Errors.DEPRECATION_MODE_NOT_INITIALIZED(); } _deprecationInitializedAt = 0; emit DeprecationModeUninitialized(); }
15,921,103
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "../core/DaoRegistry.sol"; import "../adapters/interfaces/IVoting.sol"; import "../adapters/voting/Voting.sol"; import "../adapters/voting/OffchainVotingHash.sol"; import "../adapters/voting/SnapshotProposalContract.sol"; import "./GovernanceHelper.s...
check that the step is indeed part of the resultinvalid proposal hashhas voted outside of the voting time
function getBadNodeError( DaoRegistry dao, bytes32 proposalId, bool submitNewVote, bytes32 resultRoot, uint256 blockNumber, uint256 gracePeriodStartingTime, uint256 nbMembers, OffchainVotingHashContract.VoteResultNode memory node ) public view retu...
12,952,805
./partial_match/4/0x8521A8Da7178Cc070Fd3b8Ee5AB005BD0B3F5D6b/sources/MasterChef.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number;...
8,705,672
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./Signature.sol"; contract TGE is Ownable, Signature { using SafeERC20 for ...
Claims ETH for user. eth The amount of ETH to claim./
function claimEthSurplus(uint256 eth) private { if (claimedEth[msg.sender]) return; claimedEth[msg.sender] = true; if (eth > 0) safeSendEth(msg.sender, eth); }
9,961,076
pragma solidity ^0.4.18; contract SimpleWallet { // Address is the owner address owner; struct WithdrawlStruct { address to; uint amount; } // Create an object for Senders struct Senders { bool allowed; uint amount_sends; mapping(uint => WithdrawlStruct) withdrawls; } // Mapping to determine if the Sender is allowed to...
Check to make sure the msg.sender is the owner And it will suicide the contract and return funds to the owner
function killWallet() public isOwner { selfdestruct(owner); }
13,126,409
pragma solidity ^0.4.18; // Test contract with timelock support is deployed at https://kovan.etherscan.io/address/0x40a94e42d9d64aa6542f10ecb53345075faad546 // Future date to unlock transfer of tokens for this test contract is June 1st. 2018 2018 00:00AM GMT // unix epoch time == 1527811200 /** * @title ERC20Basic ...
initializes to 0 the total token supply
function LAFINAL3() { totalSupply = 0 ; }
11,726,642
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgrad...
Public endpoint to update the underlying timelock instance. Restricted to the timelock itself, so updates must be proposed, scheduled and executed using the {Governor} workflow./
function setTimelock(TimelockController timelock_) external virtual onlyGovernance { require( address(timelock_) != address(0) && _timelock != timelock_, "Governance: invalid timelock" ); _timelock = timelock_; emit TimelockChange(a...
13,080,282
pragma solidity ^0.6.0; import { BlockLib as Block } from "../lib/BlockLib.sol"; import { StateLib as State } from "../lib/StateLib.sol"; import { TransactionsLib as Tx } from "../lib/TransactionsLib.sol"; import { FraudUtilsLib as utils } from "./FraudUtilsLib.sol"; library BlockErrorLib { using Block for bytes; ...
Ensure that each transaction has an index higher than the last
function checkTypeForTransactionsOrderError( uint256 offset, uint256 len, uint256 size ) internal pure returns (uint256 newOffset, bool fraudulent) { uint256 txIndex; uint256 lastIndex = 0; newOffset = offset; for (uint256 i = 0; i < len; i++) { if (i != 0 && txIndex <= lastIndex) { ...
7,219,260
./partial_match/1/0x4B98507687042FDC82aaA1822508Fd9b7E25Ad7E/sources/StrategyCmpdDaiV1.sol
Leverages until we're supplying <x> amount 1. Redeem <x> DAI 2. Repay <x> DAI 1. Borrow out <X> DAI 2. Supply <X> DAI Since we're only leveraging one asset Supplied = borrowed
function leverageUntil(uint256 _supplyAmount) public onlyKeepers { uint256 leverage = getMaxLeverage(); uint256 unleveragedSupply = getSuppliedUnleveraged(); require( _supplyAmount >= unleveragedSupply && _supplyAmount <= unleveragedSupply.mul(leverage).div(1e18)...
2,870,109
./partial_match/1/0xCAe4210e6676727EA4e0fD9BA5dFb95831356a16/sources/RariMerkleRedeemer.sol
User provides the cTokens & the amounts they should get, and it is verified against the merkle root for that cToken (for each cToken provided) Should set the user's claim amount in the claims mapping for each cToken provided
function _multiClaim( address[] calldata _cTokens, uint256[] calldata _amounts, bytes32[][] calldata _merkleProofs ) internal virtual { require(_cTokens.length == _amounts.length, "Number of cTokens and amounts must match"); require(_cTokens.length == _merkleProofs.length...
11,006,374
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; contract Company { // Company contract. // owners of the contract are the share holders of the company. address public master; // List to keep track of all owner's address address[] public owners; // Mapping to keep track o...
Transfers owner's or master's stake(share) to an address in the owner list or master. Note: the recipient can only be one of the owners receiver Address of the receipient _share Uint256 amount of the stake(share) to transfer
function addShare(address receiver, uint256 _share) public onlyAdmins { require(share[msg.sender] >= _share, "Stake exceeds the sender allowance"); require(isOwner[receiver], "The receipient should only be one of the owners"); share[msg.sender] -= _share; share[re...
12,859,870
// This software is a subject to Ambisafe License Agreement. // No use or distribution is allowed without written permission from Ambisafe. // https://ambisafe.com/terms.pdf contract Ambi { function getNodeAddress(bytes32 _nodeName) constant returns(address); function hasRelation(bytes32 _nodeName, bytes...
Should start with XE. Should have 12 zero bytes at the end.
function parse(bytes32 _icap) constant returns(address, bytes32, bool) { if (_icap[0] != 88 || _icap[1] != 69) { return (0, 0, false); } for (uint8 j = 20; j < 32; j++) { if (_icap[j] != 0) { return (0, 0, false); } } bytes ...
1,088,750
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). 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 ...
default function does nothing.
function () payable public {}
1,064,312
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.6.0; import '../../../../../@openzeppelin/contracts/access/Ownable.sol'; import './Lockable.sol'; contract AddressWhitelist is Ownable, Lockable { enum Status {None, In, Out} mapping(address => Status) public whitelist; address[] public whitelistIndi...
Overloaded method to enable short term backwards compatibility. Will be deprecated in the next DVM version.
function batchCommit(Commitment[] memory commits) public override { CommitmentAncillary[] memory commitsAncillary = new CommitmentAncillary[](commits.length); for (uint256 i = 0; i < commits.length; i++) { commitsAncillary[i].identifier = commits[i].identifier; commitsAncillary[i].time = co...
5,868,907
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "../interfaces/ERC1363Spec.sol"; import "../interfaces/EIP2612.sol"; import "../interfaces/EIP3009.sol"; import "../utils/AccessControl.sol"; import "../lib/AddressUtils.sol"; import "../lib/ECDSA.sol"; /** * @title Artificial Liquid Intelligence ERC20 T...
@inheritdoc ERC165/ reconstruct from current interface(s) and super interface(s) (if any)
function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { return interfaceId == type(ERC165).interfaceId || interfaceId == type(ERC20).interfaceId || interfaceId == type(ERC1363).interfaceId || interfaceId == type(EIP2612).interfaceId || interfaceId == type(EIP3009)...
1,075,644
pragma solidity ^0.5.2; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { /...
this function makes it possible for deployer to withdraw unallocated ES
function withdrawFunds(bool _withdrawEverything, uint256 _withdrawlAmount) public onlyDeployer { if(_withdrawEverything) { _withdrawlAmount = token.balanceOf(address(this)); } token.transfer(msg.sender, _withdrawlAmount); emit FundsWithdrawn(msg.sender, _withdrawlAmount); }
12,883,674
pragma solidity >=0.4.21 <0.7.0; pragma experimental ABIEncoderV2; contract Main { address initialCreator; constructor() payable public { initialCreator = msg.sender; } //Ipfs thing string storedData = "QmbJWAESqCsf4RFCqEY7jecCashj8usXiyDNfKtZCwwzGb"; function set(string memory ...
This function for endpoint finds all the submissions for any given address and returns an array of it including their accuracy and the name of the bounty
function retrieveTempSubmissionArray(address _submitter) public { for (uint256 p = 0; p < bountyAddresses.length; p++) { for (uint256 u = 0; u < bountyHashTable[bountyAddresses[p]].submissions.length; u++) { if (bountyHashTable[bountyAddresses[p]].submissions[u].submitter == _sub...
12,678,530
//! A Multi-signature, daily-limited account proxy/wallet library. //! //! Inheritable "property" contract that enables methods to be protected by //! requiring the acquiescence of either a single, or, crucially, each of a //! number of, designated owners. //! //! Usage: use modifiers onlyowner (just own owned) or only...
gets called when no other function matches just being sent some cash?
function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); }
1,737,716
./full_match/5/0x13970A970f999Ed920B12aBf4F4aF53b046a9B2d/sources/external/integrations/nouns/VRF.sol
Check that product==scalarmultiplicand Based on Vitalik Buterin's idea in ethresear.ch post cited below. multiplicand: secp256k1 point scalar: non-zero GF(GROUP_ORDER) scalar product: secp256k1 expected to be multiplier multiplicand return verifies true iff product==scalarmultiplicand, with cryptographically high ...
function ecmulVerify(uint256[2] memory multiplicand, uint256 scalar, uint256[2] memory product) internal pure returns (bool verifies) { bytes32 scalarTimesX = bytes32(mulmod(scalar, x, GROUP_ORDER)); address actual = ecrecover(bytes32(0), v, bytes32(x), scalarTimesX); ...
11,589,996
pragma solidity ^0.4.24; interface ConflictResolutionInterface { function minHouseStake(uint activeGames) external pure returns(uint); function maxBalance() external pure returns(int); function conflictEndFine() external pure returns(int); function isValidBet(uint8 _gameType, uint _betNum, uint _bet...
Conflict handling implementation. Stores game data and timestamp if game is active. If user has already marked conflict for game session the conflict resolution contract is used (compare conflictRes). _roundId Round id of bet. _gameType Game type of bet. _num Number of bet. _value Value of bet. _balance Balance be...
function serverEndGameConflictImpl( uint32 _roundId, uint8 _gameType, uint _num, uint _value, int _balance, bytes32 _serverHash, bytes32 _userHash, bytes32 _serverSeed, bytes32 _userSeed, uint _gameId, address _userAddress )...
10,632,789
/** *Submitted for verification at Etherscan.io on 2021-03-02 */ pragma solidity 0.6.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // sil...
Enable recovery of any ERC20 compatible token sent by mistake to this contract's address.
function drainStrayTokens(IERC20 _token, uint _amount) external onlyOwner returns (bool) { return _token.transfer(owner(), _amount); }
6,639,446
./full_match/4/0x5194c644920E1822aa0ad0a30F17b87b24bEf2dA/sources/contracts/OpenSeaMigration.sol
migration of multiple tokens
function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override returns (bytes4) { require(msg.sender == address(OPENSEA_STORE), 'OSMigration: Only accepting OpenSea assets...
12,518,170
pragma solidity 0.4.19; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed prev...
transfer to owner any tokens send by mistake on this contracts token The address of the token to transfer. amount The amount to be transfered./
function emergencyERC20Drain(ERC20 token, uint amount ) public onlyOwner { token.transfer(owner, amount); }
927,207
./partial_match/1/0x990E42F5348fb139d11657A6621BA9A5b2E03824/sources/GalacticTigerz.sol
============================================================================= =============================================================================
function withdraw() public onlyOwner { require(os); }
4,016,623
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "../openzeppelin/Safemath.sol"; import "./User.sol"; import {PriceConsumerV3} from "../chainlink/AggregatorV3Interface.sol"; import "./DealStorage.sol"; import "../openzeppelin/IERC20.sol"; import "hardhat/console.sol"; import "../opengsn/BaseRela...
This is called by job creator when he accepts the work submitted dealId The unique identity of the job/uint256 conversionRate = uint256(maticPriceFeeds.getThePrice());
function accept(bytes32 dealId) external onlyCreator(dealId) { dealIdToDeal[dealId].accepted = true; address contributor = dealIdToDeal[dealId].freelancer; userMetadata.addToSuccessfulJobCompletion(contributor, true); userMetadata.addToSuccessfulJobCompletion(msg.sender, false); ...
12,726,317
//Address: 0xe495bcacaf29a0eb00fb67b86e9cd2a994dd55d8 //Contract name: EtherToken //Balance: 0 Ether //Verification Date: 12/13/2017 //Transacion Count: 13 // CODE STARTS HERE /* Copyright 2017 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in co...
Sells tokens in exchange for Ether, exchanging them 1:1. _value Number of tokens to sell.
function withdraw(uint _value) public { balances[msg.sender] = safeSub(balances[msg.sender], _value); totalSupply = safeSub(totalSupply, _value); require(msg.sender.send(_value)); Transfer(msg.sender, address(0), _value); }
1,823,077
./full_match/1/0xe0057f1c03347E97e416810755376f4BE26600b6/sources/browser/GalaxyNFT.sol
View function to see pending MILK2s on frontend.
function pendingMilk(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accMilkPerShare = pool.accMilkPerShare; uint256 NFTSupply = NFTToken.balanceOf(address(this), po...
3,209,453
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "./IlluviumPoolBase.sol"; /** * @title Illuvium Core Pool * * @notice Core pools represent permanent pools like ILV or ILV/ETH Pair pool, * core pools allow staking for arbitrary periods of time up to 1 year * * @dev See IlluviumPoolBase for m...
Decreases the allowance granted to `spender` by the caller. Resolution for the Multiple Withdrawal Attack on ERC20 Tokens (ISBN:978-1-7281-3027-9) Throws if value to decrease by is zero or is bigger than currently allowed value _spender an address approved by the caller (token owner) to spend some tokens on its...
function decreaseAllowance(address _spender, uint256 _value) public virtual returns (bool) { uint256 currentVal = transferAllowances[msg.sender][_spender]; require(_value > 0, "zero value approval decrease"); require(currentVal >= _value, "ERC20: decreased allowance below zero"); return approve(_sp...
898,527
pragma solidity >=0.4.22 <0.8.0; import "./SafeMath.sol"; import "./Storage.sol"; //// TO-DO //// // -improve comments // -create more unit tests // -createQuery() must check "call.value" instead of msg.value // -think if oracleadaptor bytes32 queryId is safe? contract BettingMarket is Storage{ //finalize all...
finalize taker case if unfinalized
function finalizeTakerUnsettled(Struct storage player) private { Struct storage makerOffer = _STRUCT["PLAYERS"].id[player._address["unsettledOfferAddress"]]._struct["offers"].entry[player._uint256["unsettledOfferNumber"]]; closeOffer(makerOffer); }
12,976,573
//SPDX-License-Identifier: Unlicensed pragma solidity >=0.6.0 <0.8.0; import "./ECAuction.sol"; contract LameloBallAuction is ECAuction { constructor() ECAuction( 1623981600, // Fri Jun 18 2021 02:00:00 GMT+0000, _sale_start, 1624068000, ...
/ Blackhole prevention methods
function drain() external onlyOwner isProcessed { payable(owner()).transfer(address(this).balance); }
13,444,254