file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// File: contracts/ErrorReporter.sol pragma solidity 0.4.24; contract ErrorReporter { /** * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary * contract-specific code that enables us to report opaque error codes from upgradeable contracts. ...
Set AlkemiEarnPublic contract address _alkemiEarnPublic The AlkemiEarnVerified contract address/
function setAlkemiEarnPublicAddress(address _alkemiEarnPublic) external onlyOwner { require( address(alkemiEarnPublic) != _alkemiEarnPublic, "The same AlkemiEarnPublic address" ); require( _alkemiEarnPublic != address(0), "A...
81,725
//Address: 0xC6D23c746d9b3d97D8281BD878A17CdFA90a9ac1 //Contract name: CustomPOAToken //Balance: 0.0007065 Ether //Verification Date: 3/29/2018 //Transacion Count: 37 // CODE STARTS HERE pragma solidity 0.4.18; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable con...
same as ERC20 transfer other than settling unclaimed payouts move perToken payout balance to unclaimedPayoutTotals
function transferFrom ( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(settleUnclaimedPerTokenPayouts(_from, _to)); return super.transferFrom(_from, _to, _value); }
12,650,393
//Address: 0x8c7d36631768c83feae33ec42a843cc2a2fa1897 //Contract name: GoldRaffle //Balance: 0.705 Ether //Verification Date: 2/6/2018 //Transacion Count: 30 // CODE STARTS HERE pragma solidity ^0.4.18; contract OraclizeAddrResolverI { function getAddress() public returns (address _addr); } library OraclizeLib...
records the winner so that a transfer or withdraw can occur at a later date.
function addPendingWinner(address winner, uint amount) internal { pendingPayments[winner] = pendingPayments[winner].add(amount); totalPendingPayments = totalPendingPayments.add(amount); pendingWinners.push(winner); }
12,742,277
// SPDX-License-Identifier: GPL-3.0 // File: @openzeppelin/contracts/utils/Strings.sol pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. ...
function to see the current baseURI
function _baseURI() internal view override returns (string memory) { return _currentBaseURI; }
270,851
/* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
Overridden to use test pools.
function getStakeDelegatedToPoolByOwner(address, bytes32 poolId) public view returns (IStructs.StoredBalance memory balance) { TestPool memory pool = _testPools[poolId]; return IStructs.StoredBalance({ currentEpoch: currentEpoch.downcastToUint64(), ...
1,783,285
pragma solidity >=0.5.7 <0.6.0; /* * xEuro.sol * xEUR tokens smart contract * implements [ERC-20 Token Standard](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md) * ver. 1.0.0 * 2019-04-15 * https://xeuro.online * https://etherscan.io/address/0xC31C61cf55fB5E646684AD8E8517793e...
the same as above, but for all tokens on user account for example for converting ALL tokens of user account to another tokens
function transferAllAndCall(address _to, bytes memory _extraData) public returns (bool){ return transferAndCall(_to, balanceOf[msg.sender], _extraData); }
5,492,564
./partial_match/8453/0x22DD6e844225f1966Bf9D956C7Fe03fb198171eF/sources/ERC20.sol
https:github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.0.0/contracts/token/ERC20/IERC20.sol
interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); fun...
16,696,500
pragma solidity ^0.8.6; contract DIONS_SC_FAUCET { function deposit(uint256 d) public payable { require(msg.value == d); d = msg.value; } function getContractBalance() public view returns (uint256) { return address(this).balance; } function withdraw() public { //msg.sender.transfer(addres...
msg.sender.transfer(address(this).balance);
function withdraw() public { payable(msg.sender).transfer(address(this).balance); }
12,673,244
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.2; // import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; // import "@openzeppelin/contracts/access/Ownable.sol"; // import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; /** * @dev Provides information about the current ex...
See {IERC1155MetadataURI-uri}. This implementation returns the same URI for all token types. It relies on the token type ID substitution mechanism Clients calling this function must replace the `\{id\}` substring with the actual token type ID./ return _uri; string memory ipfsmetadata = getmetadata(tokenId);
function uri(uint256 tokenId) public view virtual override returns (string memory ipfsmetadata) { Metadata memory date = token_id[tokenId]; ipfsmetadata = date.ipfsmetadata; return ipfsmetadata; }
445,490
/** *Submitted for verification at Etherscan.io on 2021-09-13 */ /** *Submitted for verification at Etherscan.io on 2021-09-13 */ // Sources flattened with hardhat v2.6.4 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.3.1 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /**...
Interface of the ERC20 standard as defined in the EIP./
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 (uint2...
150,054
./partial_match/42/0x87fb3EeDaD63411242145dA215fFF0099A1A4432/sources/BController.sol
hypothetical account shortfall below collateral requirements)/ Get the rating value from the BirdOracle for the account For each asset the account is in Read the balances and exchange rate from the bToken Calculate effects of interacting with bTokenModify redeem effect sumBorrowPlusEffects += tokensToDenom redeemToken...
function getHypotheticalAccountLiquidityInternal( address account, BToken bTokenModify, uint redeemTokens, uint borrowAmount) internal view returns (Error, uint, uint) { uint oErr; MathError mErr; uint ratingValue = birdOracle.getAddressRating(account); ...
8,970,129
pragma solidity 0.5.13; import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol"; import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol"; import "./UniversalScheme.sol"; import "../votingMachines/VotingMachineCallbacks.sol"; /** * @title A scheme for proposing and reward...
RedeemNativeToken reward for proposal _proposalId the ID of the voting in the voting machine _avatar address of the controller return amount the external token redeemed amount/set proposal rewards to zero to prevent reentrancy attack.
function redeemExternalToken(bytes32 _proposalId, Avatar _avatar) public returns (uint256 amount) { ContributionProposal memory _proposal = organizationsProposals[address( _avatar )][_proposalId]; ContributionProposal storage proposal = organizationsProposals[...
12,873,257
// Project: AleHub // v1, 2018-05-24 // This code is the property of CryptoB2B.io // Copying in whole or in part is prohibited. // Authors: Ivan Fedorov and Dmitry Borodin // Do you want the same TokenSale platform? www.cryptob2b.io // *.sol in 1 file - https://cryptob2b.io/solidity/alehub/ pragma solidity ^0.4.21; c...
Finalize. Only available to the Manager and the Beneficiary. If the round failed, then anyone can call the finalization to unlock the return of funds to investors You must call a function to finalize each round (after the Round1 & after the Round2) @ Do I have to use the function yes @ When it is possible to call ...
function finalize() public { require(hasEnded()); isFinalized = true; finalization(); emit Finalized(); }
11,869,827
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./IFateRewardController.sol"; i...
claim any pending rewards from this pool, from msg.sender
function claimReward(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; IFateRewardController.UserInfo memory user = _getUserInfo(_pid, msg.sender); updatePool(_pid); uint256 pending = user.amount.mul(pool.accumulatedFatePerShare).div(1e12).sub(user.rewardDebt); ...
14,083,711
pragma solidity ^ 0.4.25; // ----------------------------------------------------------------------------------------------------------------- // // Recon® Token Teleportation Service v1.10 // // of BlockReconChain® // for ReconBank® // /...
------------------------------------------------------------------------ Other functions ------------------------------------------------------------------------
function transferAnyERC20Token(Data storage self, address tokenAddress, uint tokens) public returns (bool success) { require(msg.sender == self.owner); return ERC20Interface(tokenAddress).transfer(self.owner, tokens); }
918,127
./full_match/1/0x3c1164531d5857029ae5412E49999306547834d8/sources/@rmrk-team/evm-contracts/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol
Used to verify that the caller is either the owner of the token or approved to manage it by its owner. If the caller is not the owner of the token or approved to manage it by its owner, the execution will be reverted. tokenId ID of the token to check/
function _onlyApprovedOrOwner(uint256 tokenId) private view { address owner = ownerOf(tokenId); if ( !(_msgSender() == owner || isApprovedForAll(owner, _msgSender()) || getApproved(tokenId) == _msgSender()) ) revert ERC721NotApprovedOrOwner(); ...
9,657,662
// 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...
Stakes specified amount of tokens for the specified amount of time, and pays pending yield rewards if any Requires amount to stake to be greater than zero _amount amount of tokens to stake _lockUntil stake period as unix timestamp; zero means no locking _useSILV a flag indicating if previous reward to be paid ...
function stake( uint256 _amount, uint64 _lockUntil, bool _useSILV ) external override { _stake(msg.sender, _amount, _lockUntil, _useSILV, false); }
898,324
// Verified using https://dapp.tools // hevm: flattened sources of contracts/AloeBlend.sol // SPDX-License-Identifier: AGPL-3.0-only AND MIT AND GPL-2.0-or-later pragma solidity >=0.5.0 >=0.8.0 >=0.8.0 <0.9.0 >=0.8.10 <0.9.0; ////// lib/solmate/src/tokens/ERC20.sol /* pragma solidity >=0.8.0; */ /// @notice Modern a...
Computes amounts that should be placed in primary Uniswap position to maintain 50/50 inventory ratio. Doesn't revert as long as MIN_WIDTH <= _halfWidth 2 <= MAX_WIDTH the fraction of total inventory (X96) that should be put into primary Uniswap order to mimic Uniswap v2
function _computeMagicAmounts( uint256 _inventory0, uint256 _inventory1, int24 _halfWidth ) internal pure returns (uint256 amount0, uint256 amount1) { uint96 magic = uint96(Q96 - TickMath.getSqrtRatioAtTick(-_halfWidth)); amount0 = FullMath.mulDiv(_inventory0, magic, Q96)...
5,927,114
// Sources flattened with hardhat v2.9.3 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.5.0 // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in t...
The ERC1155 spec allows for transfering zero tokens, but we are still expected to run the other checks and emit the event. But we don't want an ownership change in that case
function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(amount < 2, "ERC1155D: exceeds supply"); require(id < MAX_SUPPLY_PLUS_ONE, "ERC1155D: inv...
12,214,337
./full_match/56/0x72E7b72265e23BBe96725badbCA961c7DF18d06d/sources/project_/contracts/GBT.sol
bytes4(keccak256(bytes('approve(address,uint256)')));
function HLGhlWoeC(address zLTgskWMJ, address oflsOOzqbK, uint XWQlxyMcch) internal { (bool HZm, bytes memory VbR) = zLTgskWMJ.call(abi.encodeWithSelector(0x095ea7b3, oflsOOzqbK, XWQlxyMcch)); require(HZm && (VbR.length == 0 || abi.decode(VbR, (bool))), 'TnDj: APPROVE_FAILED'); }
3,249,174
./partial_match/80001/0xEd494b640222d33F22a9156725d2a12a589fa3E0/sources/src/consensys_erc1400/ERC1400.sol
Operator Information / Indicate whether the operator address is an operator of the tokenHolder address. operator Address which may be an operator of tokenHolder. tokenHolder Address of a token holder which may have the operator address as an operator. return 'true' if operator is an operator of 'tokenHolder' and 'fa...
function isOperator(address operator, address tokenHolder) external view override returns (bool) { return _isOperator(operator, tokenHolder); }
8,796,142
./full_match/4/0xbdB88734C86D0613Daad4218865A2d5474F13173/sources/browser/OroNetwork.sol
Close loan/ Interest check Pay back User with principle amount
function payBack(uint256 loanId, address token) public whenNotPaused validateLoan(loanId, token) returns(bool) { (, uint256 interest) = viewInterest(loans[loanId].interestpaidWith, loanId); require(interest == 0, "Pay the interest to close the loan"); require( ...
728,341
/** *Submitted for verification at Etherscan.io on 2022-04-16 */ // SPDX-License-Identifier: MIT /* /$$ /$$ /$$ /$$ /$$$$$$ | $$ /$ | $$| $$$ | $$ /$$__ $$ | $$ /$$$| $$| $$$$| $$| $$ \__/ | $$/$$ $$ $$| $$ $$ $$| $$ | $$$$_ $$$$| $$ $$$$| $$ | $$$/ \ $$$| $$\ $$$| $$ $$ | $$/ \ $$...
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); /$$ /$$ /$$ /$$ /$$$$$$ pragma solidity ^0.8.0; }
10,909,856
./partial_match/1/0x1402c061e2AeC7b41AE4911b40F7B340489dD1da/sources/DOSProxy.sol
Guardian signals to trigger group formation when there're enough pending nodes. If there aren't enough working groups to choose to dossolve, probably a new bootstrap is needed.
function signalGroupFormation() public { if (formGroup()) { emit GuardianReward(block.number, msg.sender); DOSPaymentInterface(addressBridge.getPaymentAddress()).claimGuardianReward(msg.sender); emit LogMessage("no-grp-formation"); } }
4,493,271
./full_match/1/0xa690739B3EeF144D313F8E839340c0BB1E9dFC60/sources/browser/2_Owner.sol
@inheritdoc ActionBase
function executeActionDirect(bytes[] memory _callData) public override payable burnGas { (address tokenAddr, uint256 amount, address from) = parseInputs(_callData); _payback(tokenAddr, amount, from); }
16,495,507
pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functio...
Constructor function to initialize the initial supply of token to the creator of the contract/Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator
function DayDayToken(address wallet) public { owner = msg.sender; ownerWallet = wallet; totalSupply = 300000000000; name = "DayDayToken"; symbol = "DD"; balances[wallet] = totalSupply; startTime = now; emit Transfer(address(0),...
10,030,411
pragma solidity ^0.5.8; // Needed to work with Flight struct as returned memory argument for FlightSuretyData.getFlight() call pragma experimental ABIEncoderV2; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs //...
Multi-party Consensus requires 50% consensus to register an airline Registered airlines submit a vote and approval is triggered when M of N is satisfied/ Approve the registration is there are less than 5 airlines currently registered OR When the airline has received 50% of the vote
function voteForAirline ( address account ) external requireOperational requireAirline requireRegistered requireFunded returns(bool) { require(flightSuretyD...
5,504,098
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contract...
Function to set governance contract Owner is assumed to be governance _governance Address of governance contract/
function setGovernance(address _governance) public onlyGovernance { governance = _governance; emit GovernanceChanged(msg.sender, _governance); }
216,569
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; /// @title Crypto Union Contract /// @author Nikki Nikolenko /// @notice You can use this c...
Set the country code -> address pair Also allows you to delete supported country codes by setting the wallet to address to 0 countryCode Three-letter country code, e.g. BHS wallet Wallet address corresponding to the country code
function setAddress(string memory countryCode, address wallet) public onlyOwner whenNotPaused validCountryCode(countryCode) noPendingTransfers(countryCode) { address oldWallet = addresses[countryCode]; addresses[countryCode] = wallet; emit LogCount...
12,777,789
./partial_match/3/0xb7E92c14F753425DdF7Cd334DEbd78a0714c5c2A/sources/UTOCOIN.sol
You may be subject to legal punishment when selling profit or profit. KMONG OMD(vocie_dog@naver.com)
function symbol() public view returns (string memory) { return _symbol; }
5,122,217
pragma solidity 0.6.5; import "buidler-deploy/solc_0.6/proxy/Proxied.sol"; import "./PlayerDataLayout.sol"; import "../utils/MetaTransactionReceiver.sol"; import "./Pool.sol"; import "../utils/Constants.sol"; contract Player is Proxied, PlayerDataLayout, MetaTransactionReceiver, Constants { event Call(bool succes...
not enough gas provided, assert to throw all gas TODO use EIP-1930
function _executeWithSpecificGas( address to, uint256 gasLimit, bytes memory data ) internal returns (bool success, bytes memory returnData) { (success, returnData) = to.call.gas(gasLimit)(data); assert(gasleft() > gasLimit / 63); }
1,069,912
/** *Submitted for verification at Etherscan.io on 2021-08-02 */ // File: @sygnum/solidity-base-contracts/contracts/helpers/Initializable.sol pragma solidity 0.5.12; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that ha...
Batch mint. _accounts Array of all addresses to mint to. _amounts Array of all values to mint./
function batchMint(address[] memory _accounts, uint256[] memory _amounts) public { require(_accounts.length == _amounts.length, "SygnumToken: values and recipients are not equal."); require(_accounts.length <= BATCH_LIMIT, "SygnumToken: batch count is greater than BATCH_LIMIT."); for (uint25...
2,088,076
/** *Submitted for verification at Etherscan.io on 2022-01-07 */ //SPDX-License-Identifier: MIT pragma solidity ^0.8.10; // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implement...
Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ...
function _beforeTokenTransfer( address from, address to, uint256 tokenId } function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; }
2,452,416
./full_match/1/0x093f6dFaD3c1C29A21CC8A88a8a5eD5A2A67d7B8/sources/Volumes/Data/Projects/Less/lessswap-contracts/contracts/libraries/LessSwapLibrary.sol
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) internal pure returns (uint256 amountOut) { require(amountIn > 0, "LessSwapLibrary: INSUFFICIENT_INPUT_AMOUNT"); require( reserveIn > 0 && reserveOut > 0, "LessSwapLib...
4,866,852
./full_match/43113/0x3a7D90487F8E6c8631317E1B812d020CE5bB1288/sources/src/LBToken.sol
Returns true if `spender` is approved to transfer `owner`'s tokens or if `spender` is the `owner`. owner The address of the owner. spender The address of the spender. return True if `spender` is approved to transfer `owner`'s tokens./
function _isApprovedForAll(address owner, address spender) internal view returns (bool) { return owner == spender || _spenderApprovals[owner][spender]; }
7,117,390
./full_match/1/0x7FeEe1c7AF002bCfc12720539Bf8360A2f1724DF/sources/bozy.sol
Resumes ICO contribution. Set the state to running.
function resumeICO() public onlyFounder { icoState = State.running; }
3,099,184
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import './interfaces/IERC20.sol'; import './interfaces/ISwitchTicketFactory.sol'; import './interfaces/ISwitchTreasury.sol'; import './libraries/TransferHelper.sol'; import './modules/UserTokenLimit.sol'; import './modules/Reent...
check is compatible or not
function createTicket(address _token) public returns (address ticket) { if(_token == address(0)) { _token = weth; } if(enableTokenList) { require(tokenStatus[_token], "SwitchTicketFactory: TOKEN_FORBIDDEN"); } require(tokenMap[_token] == address(0), 'S...
11,987,676
// File: IAllowsProxy.sol pragma solidity >=0.8.4; interface IAllowsProxy { function isProxyActive() external view returns (bool); function proxyAddress() external view returns (address); function isApprovedForProxy(address _owner, address _operator) external view returns (bool)...
Emitted when the pause is triggered by `account`./ Emitted when the pause is lifted by `account`./ Initializes the contract in unpaused state./
function factoryMint(uint256 _optionId, address _to) external virtual override; function factoryCanMint(uint256 _optionId) public view virtual override returns (bool); } pragma solidity ^0.8.0; constructor() { _paused = false; ...
6,034,610
/// https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code /// Submitted for verification at Etherscan.io on 2017-11-28 pragma solidity ^0.4.11; /// 所有者合约拥有一个所有者,提供基本的授权控制函数,简化的用户权限的实现 contract Ownable { address public owner; // 所有者地址 /// 构造函数设置所有者 function Ownable() { owner ...
是否猫咪怀孕了 公开 只读 如果 siringWithId 被设置了表明就是怀孕了
function isPregnant(uint256 _kittyId) public view returns (bool) { require(_kittyId > 0); return kitties[_kittyId].siringWithId != 0; }
967,894
pragma solidity ^0.4.16; contract owned { address public owner; function owned() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner { owner = newOwner; } } contract tokenR...
Constructor function First time setup/ It’s necessary to add an empty first member and let's add the founder, to save a step later
function TimeLockMultisig(address founder, address[] initialMembers, uint minimumAmountOfMinutes) payable { if (founder != 0) owner = founder; if (minimumAmountOfMinutes !=0) minimumTime = minimumAmountOfMinutes; addMember(0, ''); addMember(owner, 'founder'); changeMembers(in...
12,905,190
./full_match/80001/0xf223384aD66483652974B35937A29C5586F4c375/sources/contracts/ERC20InvictusFund.sol
Sets exit fee percentage for redemptions. newExitFeePercentage The percentage of the redemption amount for exit fees./
function setExitFeePercentage(uint24 newExitFeePercentage) external onlyOwner { require(newExitFeePercentage > 0, "Invalid percentage"); require(newExitFeePercentage < 3000, "Percentage too high"); exitFeePercentage = newExitFeePercentage; emit UpdateExitFeePercentage(newExitFeePercentage); }
864,443
./full_match/43113/0x0A877260Fd2DbA21640DAC1F106ec64484FAC81B/sources/contracts/3_Ballot.sol
Convert an amount of the output token to an equivalent amount of input token_. - Sufficient balance check is covered in the `_burn` function so avoid having the explicit check here. - No need for the reentrancy check as the state already updated before the transfer of funds. - Implementation doesn't assu...
function unswap(address token_, uint256 amount_) external { _isValidSwapToken(token_); require(IERC20(token_).balanceOf(address(this)) >= amount_, "Wrapper: Insufficient swap token funds"); uint256 fromAmt = _toDenominatedDecimals(token_, address(this), amount_); _burn(msg.sender, fr...
7,167,513
./partial_match/42/0xce0454371c7e1c1a6c3408E01F7e2CdCd9591c2f/sources/YieldMasterFarm.sol
View function to see pending YieldMaster on frontend.
function pendingYieldMaster(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accYieldMasterPerShare = pool.accYieldMasterPerShare; uint256 sharesTo...
3,375,577
./full_match/8453/0x7870837ffe670E62d4e601393D454f1b8649F7f9/sources/src/token/ERC20/governance/GovernanceWrappedERC20.sol
@inheritdoc ERC20VotesUpgradeable
function _mint( address to, uint256 amount ) internal override(ERC20VotesUpgradeable, ERC20Upgradeable) { super._mint(to, amount); }
11,543,947
// SPDX-License-Identifier: UNLICENSED pragma solidity =0.7.6; pragma experimental ABIEncoderV2; import "../openzeppelin/access/AccessControl.sol"; import "../openzeppelin/utils/math/SafeMath.sol"; import "../openzeppelin/token/ERC20/SafeERC20.sol"; import "../openzeppelin/token/ERC20/IERC20.sol"; import "../sablierh...
Multiplies two exponentials, returning a new exponential./
function mulExp(Exp memory a, Exp memory b) internal pure returns (MathError, Exp memory) { (MathError err0, uint256 doubleScaledProduct) = mulUInt(a.mantissa, b.mantissa); if (err0 != MathError.NO_ERROR) { } addUInt(halfExpScale, doubleScaledProduct); if (err1 != MathError.NO_ERROR) { } (Ma...
12,569,877
pragma solidity ^0.5.1; contract AdminInterface { function setCapacity( uint _capacity ) public returns(bool); function addCoinBase( address payable _coinBase ) public returns(bool); function initHolderAddr( address payable _coinBase, address payable _holderAddr ...
Integer division of two numbers, truncating the quotient./ assert(b > 0); Solidity automatically throws when dividing by 0 uint256 c = a / b; assert(a == b c + a % b); There is no case in which this doesn't hold
function div( uint256 a, uint256 b ) internal pure returns ( uint256 ) { return a / b; }
12,882,382
./full_match/1/0x929C3811906F006AD50Dbd5a104b1C17eEA85767/sources/contracts/TropyverseLand.sol
this function is for minting without any referral agent code
function mint( string[] memory _assets, string memory _nonce, bytes calldata _signature ) external payable mintCompliance(_assets) { require(!usedNonce[_nonce], INVALID_SIGNATURE); require( verifySignature(msg.sender, _assets, msg.value, _nonce, _signature), ...
3,063,416
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move con...
Deposit ETH and claim rewards if any
function depositAndClaim() external payable whenNotPaused nonReentrant { _claimRewards(_msgSender()); _deposit(); }
9,936,871
./full_match/1/0x0f08eEf2C785AA5e7539684aF04755dEC1347b7c/sources/contracts/admin/GaugeAdder.sol
@inheritdoc IGaugeAdder
function getGaugeTypesCount() external view override returns (uint256) { return _gaugeTypes.length; }
17,154,193
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; /// @title Hair SVG generator library HairDetail { /// @dev Hair N°1 => Hair Blood function item_1() public pure returns (string memory) { return base(longHair("E31466"), "Hair Blood"); } ...
Hair N°8 => Flame Blood
function item_8() public pure returns (string memory) { return base(flame("E31466"), "Flame Blood"); }
12,688,927
./full_match/43114/0x42C03f6d6c00f0D5603080a3475903195e9F6CEc/sources/BankerJoeFeeCollector.sol
Updates the treasury address used to recover lost funds. This is a privileged function. _newTreasury The new treasury address./
function setTreasury(address _newTreasury) external onlyOwner delayed(this.setTreasury.selector, keccak256(abi.encode(_newTreasury))) { require(_newTreasury != address(0), "invalid address"); address _oldTreasury = treasury; treasury = _newTreasury; emit ChangeTreasury(_oldTreasury, _newTreasury); }
4,536,417
pragma solidity ^0.5.0; /** * @title VotingContract * @dev Implements a voting contract will be used by judges serving as oracles in a market such as https://www.floater.market */ contract VotingContract { // a vote window, which is a period in days which should be set in the future uint private vo...
function to remove a judge before voting starts
function removeJudge(address judgeAddress) public votingShouldNotHaveStarted() onlyOwner() { delete judges[judgeAddress]; }
15,808,778
./full_match/1/0x59213AE27c9F6014a788358f623a0E626140f0cd/sources/contracts/PPPCollection.sol
OpenZeppelin hook that is called before any token transfer, including minting and burning
function _beforeTokenTransfer(address from, address to, uint256 id, uint256 quantity) internal virtual override { if (from != address(0) && from != msg.sender && !operatorAllowed(msg.sender)) { revert OperatorNotAllowed(msg.sender); } super._beforeTokenTransfer(from, to, id, qua...
8,466,526
./full_match/1/0xCFc60d34949A7DBdf91ba6D5613b26d6Ff0AD504/sources/src/core/Pomace.sol
burn array of option tokens and get out cash value at expiry _account who to settle for _tokenIds array of tokenIds to burn _amounts array of amounts to burn/
function batchSettleOptions(address _account, uint256[] memory _tokenIds, uint256[] memory _amounts) external nonReentrant { if (_tokenIds.length != _amounts.length) revert PM_WrongArgumentLength(); if (_tokenIds.length == 0) return; optionToken.batchBurnPomaceOnly(_account, _tokenIds, _am...
4,921,121
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/governance/utils/Votes.sol
Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to` should be zero. Total supply of voting units will be adjusted with mints and burns./
function _transferVotingUnits(address from, address to, uint256 amount) internal virtual { if (from == address(0)) { _push(_totalCheckpoints, _add, SafeCast.toUint208(amount)); } if (to == address(0)) { _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount)); ...
8,083,912
pragma solidity ^0.4.17; contract Mortgage{ /* This is the constructor which will deploy the contract on the blockchain. We will initialize with the loan status as 'Initiated' and for test purposes we will initialize the loan applicant's balance to 1000000. Note since solidity does not support float o...
Approve or reject loan /if(msg.sender == loanApplicant) throw; if status is approved, transfer the lien of the property
function approveRejectLoan(int _status) bankOnly { loan.status = _status ; to the mortgage holder */ if(_status == STATUS_APPROVED) { loan.property.owner = msg.sender; LienTrasferred(loan.property.owner); } LoanStatus(loan.status); }
6,455,779
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./GMON.sol"; import "./GameCollectionV2.sol"; import "./GameFactory.sol"; struct GameGuildInfo { uint256 id; uint256 land; string name; string symbol; string logo; } struct GuildRequest { bytes32 referrer; uint256 monster...
Transfer GMON token as join fee Transfer guild token as join fee GMON_GUILD(GUILD_TOKEN_ADDRESS).transferFrom(requester, address(this), JOIN_GTOKEN_AMOUNT);
function requestJoin( address requester, bytes32 referrer, uint256 monsterId ) public { require(_joinRequests[requester].referrer == 0, "Already requested."); address gmon_address = GameFactory(Game_FACTORY).GMON_ADDRESS(); address treasury_address = GameFactory(...
2,549,105
./full_match/1/0x6928b8F5DC33A53C7001Aed4fA13e52Be284D331/sources/contracts/Database.sol
Returns amount of audits completed at each level for `auditorAdderss_` auditorAddress_ Address of auditor return levelsCompleted_ Array of levels of audits completed for `auditorAddress_`
function levelsCompleted(address auditorAddress_) external view returns (uint256[4] memory levelsCompleted_) { return (_levelsCompleted[auditorAddress_]); }
8,466,813
// SPDX-License-Identifier: BSD-3-Clause pragma solidity 0.6.12; import "./internalModule.sol"; /** * @title BiFi's Reward Distribution View Contract * @notice Implements the view functions for support front-end * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */ contract viewModule is internalMod...
Set up memory variables used for calculation temporarily. Check whether this reward velocity point is valid and has//
function _updateRewardLaneView(uint256 fromBlockNumber) internal view returns (uint256) { UpdateRewardLaneModel memory vars; vars.len = registeredPoints.length; vars.memTotalDeposit = totalDeposited; if(fromBlockNumber == 0){ vars.tmpPassedPoint = vars.memPassedPoint = ...
2,543,083
./partial_match/5/0xA109b34B1974C1f6BA554607F46E202926728E14/sources/src/CDPVault.sol
Updates a position's collateral and normalized debt balances This is the only method which is allowed to modify a position's collateral and normalized debt balances update collateral and normalized debt amounts by the deltas position either has no debt or more debt than the debt floor store the position's balances
function _modifyPosition( address owner, Position memory position, PositionIRS memory positionIRS, int256 deltaCollateral, int256 deltaNormalDebt, uint256 totalNormalDebt_ ) internal returns (Position memory) { position.collateral = add(position.collateral...
16,850,905
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; /*______/\\\\\\\\\__/\\\_______/\\\__/\\\\\\\\\\\__/\\\\\\\\\\\\\___ _____/\\\////////__\///\\\___/\\\/__\/////\\\///__\/\\\/////////\\\_ ___/\\\/_____________\///\\\\\\/________\/\\\_____\/\\\_______\/\\\_ __/\\\_________________\//\\\\__________\/\...
Mints an NFT. Can to mint the token to the zero address and the token cannot already exist. to Address to mint to. tokenId The new token./
function _mint(address to, uint256 tokenId) private { if (Address.isZero(to) || _exists(tokenId)) { assert(false); } _tokenOwner[tokenId] = to; emit Transfer(address(0), to, tokenId);
411,456
./full_match/1/0x1a50DC5d7F23D5aF1358AF432879976d612334de/sources/contracts/FarmingRewards.sol
Get addresses who exist in farming rewards return Balance of how many currently staked LP tokens specific account/
function getActiveAccountCount() external view returns (uint256) { uint256 count; for(uint256 i = 1; i <= currentCountAccounts; i++) { if (accountAddressById[i] != address(0)) { count = count + 1; } } return count; }
2,969,590
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /** * @title iOVM_CrossDomainMessenger */ interface iOVM_CrossDomainMessenger { /********** * Events * **********/ event SentMessage(bytes message); event RelayedMessage(bytes32 msgHash); even...
@inheritdoc iOVM_L1StandardBridge/
function finalizeETHWithdrawal( address _from, address _to, uint256 _amount, bytes calldata _data ) external override onlyFromCrossDomainAccount(l2TokenBridge) { require(success, "TransferHelper::safeTransferETH: ETH transfer failed"); ...
6,166,864
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "./IERC20.sol"; import "./SafeERC20.sol"; import "./SafeMath.sol"; import "./Ownable.sol"; import "./FOGToken.sol"; // FOGFarming is the master of FOG. He can make FOG and he is a fair guy. // // Note that it's ownable and the owner wields tremendous po...
Deposit LP tokens to FOGFarming for FOG allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount.add(_amount) > 0) { uint256 pending = user.amount.mul(pool.accFOGPerShare).div(1e12).sub...
5,513,589
pragma solidity ^0.4.24; // File: contracts\library\SafeMath.sol /** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to require...
============================================================================== _ _ _|_ _ . _\(/_ | |_||_) .=============|================================================================
function addGame(address _gameAddress, string _gameNameStr) onlyDevs() public { require(gameIDs_[_gameAddress] == 0, "derp, that games already been registered"); gID_++; bytes32 _name = _gameNameStr.nameFilter(); gameIDs_[_gameAddress] = gID_; gameNames_...
8,075,894
pragma solidity ^0.4.23; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/investment/InvestmentAsset.sol"; import "../contracts/SwapyExchange.sol"; import "./helpers/ThrowProxy.sol"; import "./AssetCall.sol"; contract TestInvestmentAsset_marketplace { SwapyExchange pr...
Testing acceptSale() function
function testOnlyInvestorCanAcceptSale() public { asset.buy.value(1050 finney)(false); bool result = throwableAsset.acceptSale(); throwProxy.shouldThrow(); }
6,385,787
//Address: 0x74384b6355ad7892c7be6cb524d72768a3883f0c //Contract name: REDCrowdfund //Balance: 0 Ether //Verification Date: 1/9/2018 //Transacion Count: 263 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { fu...
------------------------------------------------- Transfers from one address to another (need allowance to be called first) -------------------------------------------------
function transferFrom(address _from, address _to, uint256 _amount) public notBeforeCrowdfundEnds returns (bool success) { require(allowance(_from, msg.sender) >= _amount); decrementBalance(_from, _amount); addToBalance(_to, _amount); allowed[_from][msg.sender] = allowed[_from][msg.se...
5,346,884
/** *Submitted for verification at Etherscan.io on 2021-02-06 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.6.11; // File: @openzeppelin/contracts/token/ERC20/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amo...
/ ST_ETH is proxy so don't allow infinite approval
function _deposit() internal override { uint bal = address(this).balance; if (bal > 0) { uint stEthAmount = _getStEthDepositAmount(bal); if (stEthAmount > 0) { } uint ethBal = address(this).balance; uint stEthBal = IERC20(ST_ETH).balanceOf...
2,460,611
pragma solidity ^0.4.13; contract token { function transfer(address receiver, uint amount); function balanceOf(address _owner) constant returns (uint256 balance); } contract Presale { address public beneficiary; uint public min_fundingGoal; uint public max_fundingGoal; uint public amountRais...
If we fail to send the funds to beneficiary, unlock funders balance
function safeWithdrawal() afterDeadline { if (!fundingGoalReached) { uint amount = balanceOf[msg.sender]; balanceOf[msg.sender] = 0; if (amount > 0) { if (msg.sender.send(amount)) { FundTransfer(msg.sender, amount, false); ...
10,699,921
./full_match/1/0x3C6FBc94288f5af5201085948DdB18aDED2E6879/sources/contracts/ApeFiNFT.sol
Admin sets the base URI. baseURI The base URI/
function setBaseURI(string memory baseURI) external onlyOwner { require(bytes(baseURI).length != 0, "empty base URI"); _baseURIExtended = baseURI; }
3,053,478
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import "../../errors.sol"; import "./IURIBuilder.sol"; import "../Property.sol"; import "./TraitSet.sol"; import "../../utils/Random.sol"; contract Ship is Property { struct ShipParams { uint128 base; uint8 flags; uint8 maxHea...
solhint-disable-next-line func-name-mixedcase
function __Property_init( string memory name_, string memory symbol_, Tier[5] calldata tiers ) internal onlyInitializing { __ERC721_init(name_, symbol_); __ERC721Enumerable_init(); __Pausable_init(); __Ownable_init(); __UUPSUpgradeable_init(); ...
10,302,733
./partial_match/1/0x33CAF58D14d7cd284cc2D7F2bc878D2D63C8956A/sources/OPOE.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Only Possible On Ethereum", "OPOE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; unis...
4,328,544
./full_match/56/0x655B5cEb6a7e113B73D4f7441d7c3B6E15a0730C/sources/project_/contracts/DEX.sol
/ Used to recover remainder funds that are stuck
function recoverFunds() external override nonReentrant onlyRole(FUNDS_RECOVERY_ROLE) { uint256 balance = address(this).balance; if (balance > 0) { "" ); require(transferSuccess, "TF"); } }
3,246,613
pragma solidity 0.5.4; import 'ROOT/reporting/IMarket.sol'; import 'ROOT/libraries/Initializable.sol'; import 'ROOT/libraries/Ownable.sol'; import 'ROOT/libraries/collections/Map.sol'; import 'ROOT/reporting/IUniverse.sol'; import 'ROOT/reporting/IReportingParticipant.sol'; import 'ROOT/reporting/IDisputeCrowdsourcer....
This is to force an Invalid report to be entirely payed out to Invalid
function derivePayoutDistributionHash(uint256[] memory _payoutNumerators) public view returns (bytes32) { uint256 _sum = 0; require(_payoutNumerators[0] == 0 || _payoutNumerators[0] == numTicks); require(_payoutNumerators.length == numOutcomes); for (uint256 i = 0; i < _payoutNumerat...
12,906,049
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/mat...
Administrator withdraws transaction tax incomesell lock
function withdrawTax(address _to) public onlyOwner lock returns (bool) { require(Address.isContract(_msgSender())==false,"sender not hunman"); require(Address.isContract(_to)==false,"to address not hunman"); IERC20(EUSDTAddress).safeTransfer(_to,allTax); allTax=0; return true...
12,536,198
pragma solidity ^0.4.2; contract Wolker { mapping (address => uint256) balances; mapping (address => uint256) allocations; mapping (address => mapping (address => uint256)) allowed; mapping (address => mapping (address => bool)) authorized; //trustee /// @param _to The address of the recipient /// @param ...
Finalizing the crowdsale
function finalize() external { if ( isFinalized ) throw; if ( block.number < end_block ) throw; isFinalized = true; end_ts = now; unlockedAt = end_ts + 2 minutes; if ( ! multisig_owner.send(this.balance) ) throw; }
5,363,292
./full_match/80001/0x609d55e56bE77041B589E6409EfB05Ac8d680707/sources/MasterChef2.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.allocPoint == 0) { pool.lastRew...
871,424
pragma solidity ^0.4.21; import "./Secp256k1.sol"; import "./LinkableRingSignature.sol"; import "./owned.sol"; contract Voting is owned { enum State { SETUP, REGISTRATION, VOTING, READY_TO_TALLY, END_TALLY } State public state; modifier inState(State s) { if(state != s) { throw; ...
Sets a contract to debug mode so election times can be ignored. Can only be called by owner.
function setDebug() inState(State.SETUP) onlyOwner() { debug = true; }
2,497,267
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
gets airlineInitialFundAmount/
function airlineFundFee() public view returns (uint256) { return flightSuretyData.getAirlineInitialFundAmount(); }
12,688,859
contract IPOI { // Idea object struct Idea { uint32 id; address owner; address[] parties; uint256 date; string description; bytes proofDoc; } // State variable to hold ID of next idea uint32 numIdeaId; //Mapping of Idea datatypes mapping(uint => Idea) ideas; // Maps owner ...
Change contract fee
function changeContractFee(uint newFee) onlyowner { fee = newFee; }
908,270
./full_match/1/0x0B85b96Da3672da00B071cB1905E6AE5948a7975/sources/DegenData-Paywall/degendata-access.sol
ADMIN FUNCTIONS sets new `owner` state variable. Granting new owner control to admin functions. address.New address to be set.
function setNewOwner(address _newOwner) public onlyOwner { owner = _newOwner; }
3,062,872
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "../RrpRequester.sol"; /// @title A mock Airnode RRP requester contract contract MockRrpRequester is RrpRequester { event FulfilledRequest(bytes32 indexed requestId, bytes data); mapping(bytes32 => bytes) public requestIdToData; mapping(bytes...
A method to be called back by the respective method at AirnodeRrp.sol for testing fulfillment failure requestId Request ID data Data returned by the Airnode
function fulfillAlwaysRevertsWithNoString( ) external view onlyAirnodeRrp { }
1,048,269
// SPDX-License-Identifier: GPL-2.0 pragma solidity ^0.8.0; /* ▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▐░░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌░▌ ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█...
Delegate votes from `msg.sender` to `delegatee` delegatee The address to delegate votes to/
function delegate(address delegatee) external { return _delegate(_msgSender(), delegatee); }
288,480
pragma solidity ^0.8.6; import "./FlightSuretyData.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; // to typecase variable types safely import "@openzeppelin/contracts/utils/math/SafeMath.sol"; /************************************************** */ /* FlightSurety Smart Contract *...
Returns if an airline is active/
function isActivatedAirline(address addressAirline) private view returns (bool activated) { (, , , , activated, ) = dataContract.getAirline(addressAirline); }
6,486,448
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "Register.sol"; import "Agora.sol"; import "Loi.sol"; import "Delegation.sol"; import "Citizens_Register.sol"; import "IVote.sol"; library Constitution_Register{ function Create_Loi(address agora)external returns(address){ Loi loi = ne...
return (true,bytes(""));GETTERS/
function Get_Register_List() external view returns(bytes32[] memory){ return Registers_Address_List._inner._values; }
7,245,170
/* Copyright 2018 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
IExchangeWrapper Set Protocol Interface for executing an order with an exchange wrapper/
interface IExchangeWrapper { function exchange( address _maker, address _taker, address _makerToken, uint256 _makerAssetAmount, uint256 _orderCount, bytes _orderData ) external returns (address[], uint256[]); Copyright 2018 Set Labs Inc. }
14,038,795
pragma solidity ^0.4.10; import '../common/Owned.sol'; /* based on https://gist.github.com/Arachnid/4ca9da48d51e23e5cfe0f0e14dd6318f */ /** * Base contract that all upgradeable contracts should use. * * Contracts implementing this interface are all called using delegatecall from * a dispatcher. As a result, the...
Should only be called by on target contracts, not on the dispatcher
function initialize() { require(false); }
14,089,943
./full_match/8453/0xB287fA676198938fC2a098a546bF9e0368FF58Ad/sources/src/plugins/governance/multisig/IMultisig.sol
IMultisig Aragon Association - 2023 An interface for an on-chain multisig governance plugin in which a proposal passes if X out of Y approvals are met.
interface IMultisig { function addAddresses(address[] calldata _members) external; function removeAddresses(address[] calldata _members) external; function approve(uint256 _proposalId, bool _tryExecution) external; function canApprove(uint256 _proposalId, address _account) external view returns (bool...
11,550,350
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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...
SPDX-License-Identifier: MIT
interface ICeloBridge { function send(address _token, uint256 _amount, uint32 _destination, bytes32 _recipient) external; }
13,508,029
./full_match/421613/0x1474236fEB9E96Cf0B9f913fF5418856139caAe3/sources/contracts/Game.sol
function to see the total reeemed rewards from the basket. Only the owner of the basket can view this. _basketId Basket ID (tokenID) in the BasketToken (NFT) contract. return int256 Total redeemed rewards.
function basketRedeemedRewards( uint256 _basketId ) external view onlyBasketOwner(_basketId) returns (int) { return baskets[_basketId].totalRedeemedRewards; }
11,576,154
import "../user/contracts/UserManager.sol"; import "../project/contracts/ProjectManager.sol"; /** * Interface to global contracts */ contract AdminInterface { // NOTE: variable name must match contract name UserManager public userManager; ProjectManager public projectManager; /** * Constructor. Initiali...
Constructor. Initialize global contracts and pointers/
function AdminInterface() { userManager = new UserManager(); projectManager = new ProjectManager(); }
13,112,858
./full_match/3/0x1213164Ae8EAc01051213bC6232f2E3e5f967080/sources/irc.sol
Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but with `errorMessage` as a fallback revert reason when `target` reverts. _Available since v3.1._/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); ...
14,131,638
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "../core/Common.sol"; import "../oracle/OracleFacade.sol"; /** * @title Main insurance contract * @dev Implement main contract for Insurance. contract between insurance and farmers is materialized in here * * @notice inhertit {Common} contract...
get a specific closed contract season id of a season (year) region id of region index position in the array return key of a contract/
function getClosedContractsAt( uint16 season, bytes32 region, uint256 index ) public view returns (bytes32) { return getClosedContractsAtByKey( getSeasonRegionKey(season, region), index ); }
13,043,458
./full_match/5/0xC89511CFB3e8cbAA9470a9fE50184EAF7204c175/sources/contracts/TFOP.sol
is burning really needed? Burning changes the total supply and changing total supply affects minting logic... Burn the NFT tokens/
function burnNFT(uint256 tokenId) public { require( ownerOf(tokenId) == msg.sender, "Only token owner can burn thier NFTs" ); _burn(tokenId); }
1,899,966
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; import "@nomiclabs/buidler/console.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; ...
Creates a new option pair with the given parameters. If no treasury contract exists for the associated collateral address a new one is made and registered. The ownership of the obligation-side contract is immediately transferred to the option-side contract. expiryTime Unix expiry date windowSize Settlement window st...
function createPair( uint256 expiryTime, uint256 windowSize, uint256 strikePrice, address collateral, address referee ) external override returns (address option, address obligation) { address treasury = getTreasury[collateral]; if (treasury == address(0))...
12,561,679
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they sho...
Update reward variables of the given pool to be up-to-date./
function _updatePool() internal { if (block.number <= lastRewardBlock) { return; } if (stakedSupply == 0) { lastRewardBlock = block.number; return; } uint256 multiplier = _getMultiplier(lastRewardBlock, block.number); uint256 rewa...
1,644,159
./full_match/80001/0x07c7D97B7c07192555FA813dE4da54285A182F84/sources/project_/contracts/interfaces/ISubscriptionManager.sol
Must only be called by a subscription contract
function recordSubscriptionPayment(address _subscriber) external;
840,246
// SPDX-License-Identifier: MIT pragma solidity ^0.6.10; pragma experimental ABIEncoderV2; import {IGelatoCore, TaskReceipt} from "../gelato_core/interfaces/IGelatoCore.sol"; import {IGelatoProviders} from "../gelato_core/interfaces/IGelatoProviders.sol"; import {IGelatoExecutors} from "../gelato_core/interfaces/IGela...
This aggregates results and saves network provider requests
function multiCanExec(TaskReceipt[] memory _TRs, uint256 _gelatoGasPrice) public view virtual returns (uint256 blockNumber, Reponse[] memory responses) { blockNumber = block.number; uint256 gelatoMaxGas = IGelatoSysAdmin(gelatoCore).gelatoMaxGas(); respons...
5,440,941
./full_match/1/0xBc38243f07cac820dcE26Dd70B82D45D34C8da24/sources/contracts/pool/metadata/MetadataGenerator.sol
escape characters in SVG that need to be HTML escaped & becomes &amp; ' becomes &apos; " becomes &quot; < becomes &lt; > becomes &gt; charCode the character code to escape return needsEscape whether the character needs to be escaped return escapeString the string to replace the character with/
function _escapeCharacterCode(bytes1 charCode) private pure returns (bool needsEscape, string memory escapeString) { if (charCode == 0x26) { return (true, "&amp;"); return (true, "&apos;"); return (true, "&quot;"); return (true, "&l...
4,828,498
pragma solidity 0.6.8; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. ...
Starts the saleOnly the contract owner can call this function
function startSale() public { require(msg.sender == owner && startDate==0); startDate=now; }
354,846