file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: GPL-3.0 pragma solidity =0.6.12; import './interfaces/IUniswapV2Factory.sol'; import './UniswapV2Pair.sol'; import './libraries/Math.sol'; import './interfaces/IUniswapV2Pair.sol'; import "@openzeppelin/contracts/access/Ownable.sol"; import './interfaces/IReferences.sol'; import "@openzepp...
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(address pair,uint amountIn, uint reserveIn, uint reserveOut) public view override returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); IFeeC...
1,831,556
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the on...
gets a token creator address tokenId the token id return the creator's address
function tokenCreator(uint256 tokenId) public view returns (address) { require(_exists(tokenId), 'Unknown token.'); return _tokenIdToCreator[tokenId]; }
1,306,413
./full_match/11155111/0x039794dAe419d28AEF3d115F257eccF5125962be/sources/project_/contracts/World1.sol
return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, AccessControlUpgradeable) returns (bool) { return super.supportsInterface(interfaceId); }
3,813,780
./full_match/3/0x967328588D821b4306fe8F0592faFE94eC930429/sources/contracts/Token5.sol
Returns the subtraction of two unsigned integers, reverting with custom message on overflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements: - Subtraction cannot overflow./
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
8,243,750
./full_match/1/0x31a91336414d3B955E494E7d485a6B06b55FC8fB/sources/contracts/vault/VaultAdmin.sol
Set the deposit paused flag to false to enable capital movement./
function unpauseCapital() external onlyGovernorOrStrategist { capitalPaused = false; emit CapitalUnpaused(); }
4,932,158
./full_match/84531/0x7c226aF12DC97a1280C786263d969dB2B70b7A8D/sources/GetBasedContract.sol
See {IERC721-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, _data), "ERC721A: transfer to non ERC721Receiver implementer" ); }
11,506,949
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementat...
Only fall back when the sender is not the admin./
function _willFallback() internal virtual override { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); }
636,734
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; // File: contracts/lib/AddressUtil.sol // Copyright 2017 Loopring Technology Limited. /// @title Utility Functions for addresses /// @author Daniel Wang - <daniel@loopring.org> /// @author Brecht Devos - <brecht@loopring...
Check that this is a conditional transfer Extract the transfer data We don't use abi.decode for this because of the large amount of zero-padding bytes the circuit would also have to hash.
function readTx( bytes memory data, uint offset, Transfer memory transfer ) internal pure { uint _offset = offset; require(data.toUint8Unsafe(_offset) == uint8(ExchangeData.TransactionType.TRANSFER), "INVALID_TX_TYPE"); _offset += ...
334,321
// SPDX-License-Identifier: MIT pragma solidity >=0.8.5 <0.9.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./CharlieToken.sol"; contract Wrapper is Ownable { CharlieToken private outputToken; constructor(address outputTokenAddress) { ...
Convert an amount of the output token to an equivalent amount of input token_ token_ address of token to receive amount amount of token to swap/receive/ Transfer C token from sender to wrapper Burn the given amount of C token Transfer A || B token to sender
function unswap(address token_, uint256 amount) external { IERC20 inputToken = IERC20(token_); address currentAddress = address(this); require(outputToken.allowance(msg.sender, currentAddress) >= amount, "Wrapper: Insufficient Allowance."); require(inputToken.balanceOf(currentAddress) >= amount, "Wrap...
2,495,145
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "./TellorStaking.sol"; import "./interfaces/IController.sol"; import "./Transition.sol"; import "./Getters.sol"; /** @author Tellor Inc. @title Controller @dev This is the Controller contract which defines the functionality for * changing contract addr...
Burns an amount of tokens _amount is the amount of tokens to burn/
function burn(uint256 _amount) external { _doBurn(msg.sender, _amount); }
1,509,954
./full_match/3/0xF6B351f2179e0eb5c32ECC1754C9c0B16cdC480D/sources/browser/customToken.sol
a function via which a user purchases `amount` number of tokens by paying the equivalent price in wei; if the purchase is successful, the function returns a boolean value (true) and emits an event Purchase with the buyer's address and the purchased amount amount The number of tokens to purchase/ uint256 value = amount...
function buyToken(uint256 amount) public payable returns(bool) { uint256 value = calcPrice(amount); require( msg.value == value, "Incorrect ETH / token amount" ); tokenBalance[msg.sender] = ExternalSafeMath.add(tokenBalance[msg.sender], amount); ...
8,254,459
pragma solidity ^0.4.11; /** * @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 ...
low level token purchase function if(weiAmount < 1016) throw; if(weiAmount > 501018) throw; calculate token amount to be sent uint256 tokens = (weiAmount/10(18-decimals)) price;weiamount price update state if(contributions[msg.sender].add(weiAmount)>101018) throw; contributions[msg.sender] = contributions[msg.sender]...
function buyTokens(address beneficiary, bytes32 promoCode) payable { require(beneficiary != 0x0); require(validPurchase()); uint256 weiAmount = msg.value; if (promoCode == "ILOVEICOBUFFER") tokens = weiAmount * 2015; weiRaised = weiRaised.add(weiAmount); tokenReward.tran...
10,594,353
./full_match/4/0x58d27111E52629Cda5E6631611ECf55fa564846b/sources/e.sol
See {IERC165-supportsInterface}./super.supportsInterface(interfaceId);
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId; }
12,488,499
/** *Submitted for verification at Etherscan.io on 2020-11-15 */ pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(...
Function to decrement count by 1
function dec() public { count -= 1; }
311,232
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Mo...
this method is responsible for taking all fee, if takeFee is true
function _tokenTransfer(address sender, address recipient, uint256 amount) private { if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]){ removeAllFee(); } else{ require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); } ...
161,333
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "./SafeMath.sol"; import "./IBEP20.sol"; import "./Context.sol"; contract BEP20 is IBEP20, Context { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) inte...
Destroys `_amount` tokens from `_from`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `_from` cannot be the zero address. - `_from` must have at least `_amount` tokens./
function _burn(address _from, uint256 _amount) internal { require(_from != address(0), "burn from 0"); _balances[_from] = _balances[_from].sub(_amount); _totalSupply = _totalSupply.sub(_amount); emit Transfer(_from, address(0), _amount); }
976,252
pragma solidity 0.5.11; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; requ...
allow any address to transfer tokens Available only to the owner and admin./
function release() external onlyAdmin { if (address(_crowdsale) != address(0)) { require(_crowdsale.isEnded()); _crowdsale = ICrowdsale(address(0)); } _released = true; }
5,469,722
./partial_match/4/0xA9db4aDEC65723826f56524AE5520ba11b47482D/sources/contracts/utils/libraries/EnumerableSet.sol
Returns the value stored at position `index` in the set. O(1). Note that there are no guarantees on the ordering of values inside the array, and it may change when more values are added or removed. Requirements: - `index` must be strictly less than {length}./
function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); }
8,535,753
// File: contracts/utils/math/Math.sol pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint...
Returns the remainder of dividing two unsigned integers, with a division by zero flag. _Available since v3.4._/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); }
12,593,409
pragma solidity ^0.5.8; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address...
Adds a locked NFT to the end of the array _nftId The id of the NFT that will be locked into the contract.
function _pushNft(uint256 _nftId) internal { depositedNftsArray.push(_nftId); nftIsDepositedInContract[_nftId] = true; }
12,809,078
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /// @title Interface to interact with Bubbles contract. interface IBubbles { ...
Function to change address of reward token
function setTokenAddress(address _tokenAddress) external onlyOwner { TOKEN = _tokenAddress; }
1,545,608
/** * Copyright 2017–2018, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ ...
Function to add minter address. return True if the operation was successful./
function addMinter( address _minter) public onlyOwner canMint { minters[_minter] = true; }
5,772,162
./full_match/1/0xc8f818729Bf05D6239a407bAa8370DeC8e0c01e9/sources/contracts/traits/traitregistry/ECRegistryV3c.sol
This will only emit event if there was actually a state change! Returns: wasSet - was there any state change Reason: this is being called many times from the various random trait dropper contracts
function _setTrait(uint16 traitID, uint16 tokenId, bool _value) internal returns(bool wasSet) { bool emitvalue = _value; (uint16 byteNum, uint8 bitPos) = getByteAndBit(tokenId); if(traits[traitID].traitType == 1 || traits[traitID].traitType == 2) { _value = !_value; } ...
2,999,487
./full_match/5/0x136B8Bf430867E50A311ece548b3b0c40eB05b23/sources/contracts/Gateway.sol
Function to retrieve all items
function getItems() public view returns (Item[] memory) { return items; }
1,884,885
./full_match/5/0x19E242DE333fB9091Bb88A1EA5e51f832016e1eb/sources/_thirdweb-dev/contracts/base/ERC721Drop.sol
Generative NFT logic Create a hash value using id, block number, address save hash in mappings
function _mintGenerative(address _to, uint256 _startTokenId, uint256 _qty) internal virtual { for(uint256 i = 0; i < _qty; i += 1) { uint256 _id = _startTokenId + i; bytes32 mintHash = keccak256(abi.encodePacked(_id, blockhash(block.number - 1), _to)); tokenToHash[_i...
1,933,559
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./ERC721Min.sol"; co...
- NFT Types -
function addNftType(uint16 _maxMint, uint16 _maxPerMint, uint256 _price, uint16 _maxPerAddress, bool _saleActive, string calldata _uri) external onlyOwner { nftTypeCount++; NftTypes[nftTypeCount].maxMint = _maxMint+1; NftTypes[nftTypeCount].maxMintForOne = _maxMint; NftT...
10,457,578
./partial_match/4/0x1911Ac2254097E3904064Bd34b5E99519cd30188/sources/InstantSwap.sol
Swap Out function Deposit Asset backed tokens and claim back external tokens Prices are calculated from API services/ 'msg.sender' should have balance of 'address(this)' 'asset' 'address(this)' should have balance of 'token' 'value'
function swapOut(uint256 assetId, uint256 asset) external validateAsset(assetId) { _swapOut(assetId, asset); }
16,960,392
//SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns th...
Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d...
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (to.isContract()) try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.on...
14,412,500
./partial_match/3/0x178b33308d98D4FF91a4d06972E616335CB2895A/sources/Nexon.sol
Function to withdraw referral amount add withdraw referral with respect to the referral address/
function withdrawReferral(address add) external returns(bool){ require(_ReferalList[add] != msg.sender && _ReferalStatus[msg.sender] != true && add != msg.sender,"Either already withdrawn or not valid"); _transfer(_referralAddress, msg.sender, _referralAmount); _transfer(_referralAddress, add, _refer...
5,082,041
// SPDX-License-Identifier: MIT pragma solidity 0.6.8; // /** * @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, whi...
Collect fees from the ACoconut Swap. This contract must be an admin of ACoconut Swap in order to proceed./
function collectFees() public { require(msg.sender == strategist || msg.sender == governance, "not authorized"); ACoconutSwap(acSwap).collectFee(); allocateFees(); }
6,266,081
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library TokensHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes("approve(address,uint256)"))); (bool success, bytes memory data) = token.call(abi.encodeWi...
bytes4(keccak256(bytes("burnFrom(address,uint256)")));
function safeBurnFrom( address token, address from, uint256 amount ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x79cc6790, from, amount)); require(success && (data.length == 0 || abi.decode(data, (bool))), "safeBurnFrom: burn failed"...
5,370,058
//Address: 0xa8df33a40fe2e3278e4d94a974f70778043fbd20 //Contract name: I2Presale //Balance: 5.845 Ether //Verification Date: 2/21/2018 //Transacion Count: 30 // CODE STARTS HERE pragma solidity ^0.4.18; interface token { function transfer(address receiver, uint amount) external; } /** * @title Ownable * @dev...
Change Crowdsale bonus rate/
function changeBonus (uint _bonus) public onlyOwner { bonus = _bonus; }
1,811,490
./full_match/1/0x567c09B55294998d7a6F2A3A948e8fD331531B88/sources/contracts/UMA/financial-templates/expiring-multiparty/Liquidatable.sol
Must be disputed or the liquidation has passed expiry.
function _withdrawable(uint256 liquidationId, address sponsor) internal view { LiquidationData storage liquidation = _getLiquidationData( sponsor, liquidationId ); Status state = liquidation.state; require( (state > Status.NotD...
9,748,997
./partial_match/97/0x5D23B0f31C0aE19d8Bfb09D0377fa968D3cA3790/sources/A.sol
Deposit tokens for chance to win percentage of pool.
function roll(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; require( _amount.div(pool.lpToken.balanceOf(address(this)).mul(10000)) < pool.maxDepositAmount, 'roll: Deposit amount too high.' ); require(_amount > 0, 'Deposit amou...
11,474,095
pragma solidity ^0.5.15; pragma experimental ABIEncoderV2; import { Types } from "./Types.sol"; library RollupUtils { // ---------- Account Related Utils ------------------- function PDALeafToHash(Types.PDALeaf memory _PDA_Leaf) public pure returns (bytes32) { return keccak...
---------- Tx Related Utils -------------------
function CompressTx(Types.Transaction memory _tx) public pure returns (bytes memory) { return abi.encode(_tx.fromIndex, _tx.toIndex, _tx.amount, _tx.signature); }
12,681,322
pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; import "./MixinResolver.sol"; import "./interfaces/ISynthetixBridgeToOptimism.sol"; // Internal references import "./interfaces/ISynthetix.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IIssuer.sol"; // solhint-disable indent import "@eth-op...
create message payload for L2 relay the message to this contract on L2 via L1 Messenger
function _rewardDeposit(uint amount) internal { bytes memory messageData = abi.encodeWithSignature("mintSecondaryFromDepositForRewards(uint256)", amount); messenger().sendMessage(synthetixBridgeToBase(), messageData, CROSS_DOMAIN_MESSAGE_GAS_LIMIT); emit RewardDeposit(msg.sender, amount); ...
15,798,463
./full_match/80001/0xfd8D4Ea357039126997D4Cb3C3ddeeDfb76CF090/sources/contracts/MyERC721DropConditional.sol
Checks whether platform fee info can be set in the given execution context.
function _canSetClaimConditions() internal view virtual override returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _msgSender()); }
854,504
./partial_match/42/0xacFc2E7c0957911d34E8382d8070F01b3B7909A2/sources/Master.sol
View function to see pending MARs on frontend.
function returnMarReward(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accMarPerShare = pool.accMarPerShare; uint256 marReward = 0; uint256 lpSupply = pool.lpToken....
9,054,153
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ // File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proof...
Generate the leaf node (just the hash of tokenID concatenated with the account address)
function _leaf(uint256 _nftId, uint256 _bonus ) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_nftId,_bonus)); }
6,788,770
// Ethereum Name Service contracts by Nick Johnson <nick@ethereum.org> // // To the extent possible under law, the person who associated CC0 with // ENS contracts has waived all copyright and related or neighboring rights // to ENS. // // You should have received a copy of the CC0 legalcode along with this // work. ...
Sets the address associated with an ENS node. May only be called by the owner of that node in the ENS registry. node The node to update. addr The address to set./
function setAddr(bytes32 node, address addr) only_owner(node) { addresses[node] = addr; AddrChanged(node, addr); }
1,754,417
./partial_match/1/0xf4BC293A38bD1E3875Cfc141Ba81dd8E95F65f90/sources/StrategyConic.sol
Convert token route to encoded path uint24 type for fees so path is packed tightly
function routeToPath( address[] memory _route, uint24[] memory _fee ) internal pure returns (bytes memory path) { path = abi.encodePacked(_route[0]); uint256 feeLength = _fee.length; for (uint256 i = 0; i < feeLength; i++) { path = abi.encodePacked(path, _fee[...
4,260,121
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "../client/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title A digital time capsule for images * @author John Park * @notice This smart contract's main purpose is to store the state for an image time capsule application. Alon...
John Park Checks if it's time to decrypt an image by marking a boolean _id The Entry id. Used to identify which image is to be marked as ready to be decrypted/
function release(uint256 _id) public checkRelease(_id) onlyOwner(_id) checkIfPaused { Entry storage entry = entries[_id]; entry.isReleased = true; Entry[] storage senderEntries = ownerToEntries[msg.sender]; } for (uint i=0; i<senderEntries.length; i++) { if (senderEntries[i].id == _id) { ...
1,072,814
./partial_match/1/0xa1A7a95d7AD043b356D72b7c5fBE0eF053ba8c13/sources/contracts/Comptroller.sol
Calculate number of tokens of collateral asset to seize given an underlying amount Used in liquidation (called in slToken.liquidateBorrowFresh) slTokenBorrowed The address of the borrowed slToken slTokenCollateral The address of the collateral slToken actualRepayAmount The amount of slTokenBorrowed underlying to co...
function liquidateCalculateSeizeTokens(address slTokenBorrowed, address slTokenCollateral, uint actualRepayAmount) external view returns (uint, uint) { uint priceBorrowedMantissa = oracle.getUnderlyingPrice(SLToken(slTokenBorrowed)); uint priceCollateralMantissa = oracle.getUnderlyingPrice(SLToken(s...
11,022,824
/** *Submitted for verification at Etherscan.io on 2021-12-14 */ /** *Submitted for verification at Etherscan.io on 2021-10-07 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's bu...
Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length./
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex l...
1,274,337
./partial_match/1/0x52dAb11c6029862eBF1E65A4d5c30641f5FbD957/sources/AccountLogic.sol
called from 'enter'
function unfreeze(address payable _account) external allowSelfCallsOnly { require(accountStorage.getDelayDataHash(_account, UNFREEZE) == 0, "delay data already exists"); bytes32 hash = keccak256(abi.encodePacked('unfreeze', _account)); accountStorage.setDelayData(_account, UNFREEZE, hash, now + DELAY_UNFREEZE_KE...
16,014,817
./full_match/43113/0x015Cf48929c446E52CAbBc8fa2d83Ab6C1203Ab0/sources/Masterchef.sol
Update the max transfer amount rate. Can only be called by the current operator./
function updateMaxTransferAmountRate(uint16 _maxTransferAmountRate) public onlyOperator { require(_maxTransferAmountRate <= 10000, "BUD::updateMaxTransferAmountRate: Max transfer amount rate must not exceed the maximum rate."); require(_maxTransferAmountRate >= 100, "BUD::updateMaxTransferAmountRate...
7,144,800
// File: contracts/helpers/ERC20Like.sol // SPDX-License-Identifier: bsl-1.1 /* Copyright 2020 Unit Protocol: Artem Zakharov (az@unit.xyz). */ pragma solidity ^0.7.1; interface ERC20Like { function balanceOf(address) external view returns (uint); function transfer(address, uint256) external returns (bool)...
Transfers 'amount' of tokens from address 'from' to address 'to', and MUST fire the Transfer event from The address of the sender to The address of the recipient amount The amount of token to be transferred/
function transferFrom(address from, address to, uint amount) public returns (bool) { require(to != address(0), "Unit Protocol: ZERO_ADDRESS"); require(balanceOf[from] >= amount, "Unit Protocol: INSUFFICIENT_BALANCE"); if (from != msg.sender) { require(allowance[from][msg.sender]...
276,395
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; // Part: IBasicRewards interface IBasicRewards { function stakeFor(address, uint256) external returns (bool); function balanceOf(address) external view returns (uint256); function earned(address) external view returns (uint256); function wit...
Claims all specified rewards and swaps them to ETH claimParams - an array containing the info necessary to claim routerChoices - the router to use for the swap claimBeforeSwap - whether to claim on Votium or not lock - whether to lock or swap crv to cvxcrv stake - whether to stake cvxcrv (if distributor is vault) ...
function _distribute( IMultiMerkleStash.claimParam[] calldata claimParams, uint256 routerChoices, bool claimBeforeSwap, bool lock, bool stake ) internal { uint256 _startGas = gasleft(); bool _locked = false; if (claimBeforeSwap) { clai...
14,572,682
// 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,...
Get the percentage this contract can claim in this interval return uint256 Rewards percentage this contract can claim in this interval/ Load contract Get the % amount allocated to this claim contract Get the time the % was changed at, it will only use this % on the next interval Ok so this percentage was set during thi...
function getClaimingContractPerc(string memory _claimingContract) override public view returns(uint256) { RocketDAOProtocolSettingsRewardsInterface daoSettingsRewards = RocketDAOProtocolSettingsRewardsInterface(getContractAddress("rocketDAOProtocolSettingsRewards")); uint256 claimContractPerc = daoS...
12,064,638
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; interface IAstraMetadata...
Public sale by ETH minting function Register for a ticket The sender must be a wallet Public sale is not open yet Exceeded the maximum total supply Your ETH amount is insufficient Exceeded the limit per address Make the payment to diffrence wallet
function reserve(uint256 numberOfTokens) external payable { ReserveSaleMapping[msg.sender] = ReserveSaleMapping[msg.sender].add(numberOfTokens); ResevedSupply = ResevedSupply.add(numberOfTokens); ReserveTimestampMapping[msg.sender] = block.timestamp; require(msg.sender == tx.origin,...
10,306,675
// 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...
tokenAddress The address of the token ERC20 contract return harvestedTokenBalance The amount of the token yield harvested held in the Kernel
function getHarvestedTokenBalance(address tokenAddress) external view override returns (uint256 harvestedTokenBalance) { if ( tokenAddress == IIntegrationMap(moduleMap.getModuleAddress(Modules.IntegrationMap)) .getWethTokenAddress() ) { harvestedTokenBalance = ...
13,875,908
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./FuelToken....
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 stakedSupply = stakeToken[_pid].balanceOf(address(this)); if (stakedSupply == 0) { pool.lastRewardBlock = u...
919,091
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; /** * @title GraphTokenDistributor * ...
Withdraw tokens from the contract. This function is included as a escape hatch in case of mistakes or to recover remaining funds. _amount Amount of tokens to withdraw/
function withdraw(uint256 _amount) external onlyOwner { token.safeTransfer(msg.sender, _amount); emit TokensWithdrawn(msg.sender, _amount); }
13,110,980
./full_match/44787/0x218F66D2734d8E4D80C2F0908a6D8f973b0Ea83e/sources/contracts/community/CommunityImplementation.sol
Updates params of a community _minTranche minimum amount that the community will receive when requesting funds _maxTranche maximum amount that the community will receive when requesting funds/
function updateCommunityParams(uint256 _minTranche, uint256 _maxTranche) external override onlyOwner { require( _minTranche <= _maxTranche, "Community::updateCommunityParams: minTranche should not be greater than maxTranche" ); uint256 _ol...
13,243,657
pragma solidity ^0.5.12; import "./CErc20.sol"; import "./CToken.sol"; import "./PriceOracle.sol"; import "./Comptroller.sol"; contract PriceOracleOTL is PriceOracle { /** * @notice The comptroller which is used to white-list assets the oracle will price * @dev Assets which are not white-listed will no...
not white-listed, worthless
function getUnderlyingPrice(CToken cToken) public view returns (uint) { address cTokenAddress = address(cToken); (bool isListed, ,) = comptroller.markets(cTokenAddress); if (!isListed) { return 0; } return prices[address(CErc20(address(cToken)).underlying())]; ...
1,011,906
./full_match/1/0x47d62Ed9fE6ef6810EaC3165053d95579059e827/sources/contracts/lib/ConversionHelpers.sol
Force cast the bytes array into a uint256[], by overwriting its length Note that the uint256[] doesn't need to be initialized as we immediately overwrite it with the input and a new length. The input becomes invalid from this point forward.
function dangerouslyCastBytesToUintArray(bytes memory _input) internal pure returns (uint256[] memory output) { uint256 intsLength = _input.length / 32; require(_input.length == intsLength * 32, ERROR_IMPROPER_LENGTH); assembly { output := _input ...
16,396,867
./partial_match/1/0xbffac64ef43e5bD8036247767f4Af94538804295/sources/BraShop.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. ADJUSTMENTS: Can only mint up to 13k (13e21) BBRA (burn + farm rewards have to be stable at lower than 13k) Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./ if supply is over...
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); if (_totalSupply.add(amount) > 13e21) { amount = uint256(13e21).sub(_totalSupply); ...
4,216,987
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./Registry.sol"; /// @title Extension of the Transferable Certificate standard ERC-1888. contract RegistryExtended is Registry { event TransferBatchMultiple(address indexed operator, address[] from, address[] to, uint256[] ids, uint256[] values); ...
Similar to {IERC1888-batchIssue}, but not a part of the ERC-1888 standard. Allows batch issuing to an array of _to addresses. `_to` cannot be the zero addresses. `_to`, `_data`, `_values`, `_topics` and `_validityData` must have the same length.
function batchIssueMultiple(address[] calldata _to, bytes[] calldata _validityData, uint256[] calldata _topics, uint256[] calldata _values, bytes[] calldata _data) external returns (uint256[] memory ids) { require(_values.length > 0, "no values specified"); require(_to.length == _data.length, "Arrays not sa...
15,795,499
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "./ModuleSelfAuth.sol"; import "./ModuleStorage.sol"; import "./ModuleERC165.sol"; import "./interfaces/IModuleCalls.sol"; import "./interfaces/IModuleAuth.sol"; /** @notice Implements ModuleCalls but ignores the...
Verify if a nonce is valid _rawNonce Nonce to validate (may contain an encoded space) A valid nonce must be above the last one used with a maximum delta of 100/ Retrieve current nonce for this wallet Verify if nonce is valid Skip nonce validation for gas estimation Update signature nonce
function _validateNonce(uint256 _rawNonce) private { (uint256 space, uint256 providedNonce) = _decodeNonce(_rawNonce); uint256 currentNonce = readNonce(space); require( (providedNonce == currentNonce) || true, "MainModule#_auth: INVALID_NONCE" ); uint256 newNonce = providedNonce + 1;...
15,794,949
pragma solidity ^0.8.9; // standard Zeppelin Ownable modified for Plantidote LLC - ie no owner xfer and no owner relinquish. contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed ...
Multiplies two numbers, throws on overflow./
function updateprofile ( string memory _fname, string memory _lname, string memory _nickname, string memory _phone, string memory _nationality, string memory _rolecode } } } function updateinterests( string memory _interest1, string memory _interest2, string ...
5,524,349
./full_match/1/0x3642189B7754302DF84B6F3FE1aE34D2026647A7/sources/src/ConveyorRouterV1.sol
Function to set affiliate address.
function initializeAffiliate(address affiliateAddress) external onlyOwner { uint16 tempAffiliateNonce = affiliateNonce; affiliates[tempAffiliateNonce] = affiliateAddress; affiliateIndex[affiliateAddress] = tempAffiliateNonce; unchecked { tempAffiliateNonce++; ...
3,016,309
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signa...
Transfer a token between 2 addresses. from The sender of the token. to The recipient of the token. id The id of the token.
function transferFrom( address from, address to, uint256 id ) external override { (address owner, bool operatorEnabled) = _ownerAndOperatorEnabledOf(id); require(owner != address(0), "NONEXISTENT_TOKEN"); require(owner == from, "NOT_OWNER"); require(to != ...
11,834,262
//██████╗ █████╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗ //██╔══██╗██╔══██╗██║ ██╔══██╗██╔══██╗██║████╗ ██║ //██████╔╝███████║██║ ███████║██║ ██║██║██╔██╗ ██║ //██╔═══╝ ██╔══██║██║ ██╔══██║██║ ██║██║██║╚██╗██║ //██║ ██║ ██║███████╗██║ ██║██████╔╝██║██║ ╚████║ //╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════...
Return the list of all tokens owned by the user Find all the token owned by the user (in this contract and in the Burned contract) owner User address return uint256[] : list of owned tokens/
function allTokensOf(address owner) external view override returns(uint256[] memory){ require(index > 0); uint256 tokenCount = balances[owner]; uint256 totalCount = tokenCount.add(burnedToken.balanceOf(owner)); uint256[] memory result = new uint256[](totalCount); uint256[] m...
12,938,553
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import { IJustCausePool } from './Interfaces.sol'; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol"; /** * @title JCDepositorERC721 * @author JustCause * This is a proof of concept starter contract for lossle...
_tokenId unique tokenId keccak hash of depositor, pool and asset addresses return asset balance of user in pool/
function getUserBalance(uint256 _tokenId) public view returns (uint256){ return deposits[_tokenId].balance; }
1,758,682
/** *Submitted for verification at Etherscan.io on 2021-05-13 */ // Southparkcoins ICO // Version of compiler pragma solidity ^0.4.11; // SPDX-License-Identifier: unlicensed contract Southparkcoins { // Introducing the maximum number of Southparkcoins available for sale uint public max_southparkcoins...
Getting the equity_in_southparkcoins in USD of an investor
function equity_in_usd(address investor) external constant returns (uint) { return equity_usd[investor]; }
7,984,179
./full_match/1/0xBe9064ec3331F7Fc9E10DD9074Cc23C411E7EE00/sources/contracts/MothValley.sol
Both safeTransferFrom functions in ERC721A call this function so we don't need to override them./
function transferFrom( address from, address to, uint256 tokenId ) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); }
9,702,309
./full_match/1/0xD9909a6fAb1260a352fBB010D058698b5DeeA018/sources/contracts/Satoshigoat.sol
Determine if an address is a smart contract This method relies on `extcodesize`, which returns 0 for contracts in construction, since the code is only stored at the end of the constructor execution.
function _isContract(address a) internal view returns (bool) { uint32 size; assembly { size := extcodesize(a) } return size > 0; }
9,664,684
contract CAVAsset { function __transferWithReference(address _to, uint _value, string _reference, address _sender) returns(bool); function __transferFromWithReference(address _from, address _to, uint _value, string _reference, address _sender) returns(bool); function __approve(address _spender, uint _value,...
Returns asset total supply. return asset total supply./
function totalSupply() constant returns(uint) { return platform.totalSupply(smbl); }
1,488,210
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ /...
Exchange old or bridge tokens for these canonical tokens Pull in the old / bridge tokens Handle the fee, if applicable
function exchangeOldForCanonical(address bridge_token_address, uint256 token_amount) external nonReentrant validBridgeToken(bridge_token_address) returns (uint256 canonical_tokens_out) { require(!exchangesPaused && canSwap[bridge_token_address], "Exchanges paused"); TransferHelper.safeTransferFrom(...
1,090,348
./partial_match/4/0x30baa3Be1FFa7ed91ce4b492f4aD79cB030eD0B8/sources/DummyOracle.sol
Underlying asset for this CToken/ Construct a new money market underlying_ The address of the underlying asset comptroller_ The address of the Comptroller interestRateModel_ The address of the interest rate model initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18 name_ ERC-20 name of this toke...
function getCashPrior() internal view returns (uint); function checkTransferIn(address from, uint amount) internal view returns (Error); function doTransferIn(address from, uint amount) internal returns (Error); function doTransferOut(address payable to, uint amount) internal returns (Error); } ...
8,729,781
./partial_match/1/0x4dDC0C08A6d2724389051E60B2DB761BF7417D52/sources/MGGStaking.sol
Return block rewards over the given _from (inclusive) to _to (inclusive) block.
function getBlockReward(uint256 _from, uint256 _to) public view returns (uint256) { uint256 to = _to; uint256 from = _from; if (from > to) { return 0; } uint256 rewardPerBlock = mggRewardRate; uint256 totalRewards = (to.sub(from)).mul(rewardPerBlock); ...
2,638,180
// SPDX-License-Identifier: No License (None) pragma solidity ^0.8.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 checked for existence in constant time * (O(1...
Returns true if the value is in the set. O(1)./
function contains(AddressSet storage set, address value) internal view returns (bool) { return set._indexes[value] != 0; }
329,081
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "../../core/DaoConstants.sol"; import "../../core/DaoRegistry.sol"; import "../../guards/AdapterGuard.sol"; import "../IExtension.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "...
Required function from IERC721 standard to be able to receive assets to this contract address/
function onERC721Received( address, address, uint256, bytes calldata ) external pure override returns (bytes4) { return this.onERC721Received.selector; }
12,768,465
./full_match/1/0xa9Ccd56De8dE905B3359E05b851ca8311f4EF976/sources/contracts/interfaces/oracle/IOracleRegistry.sol
Alkimiya Oracle Addresses Alkimiya Team /
interface IOracleRegistry { event OracleRegistered(address token, uint256 oracleType, address oracleAddr); function getOracleAddress(address _token, uint256 _oracleType) external view returns (address); pragma solidity 0.8.6; }
16,431,214
./full_match/44787/0xcc9C556FbF52e7F1ca8e0E3eB7311ea21d893512/sources/contracts/LitVerify.sol
args: base 0x40, exponent 0x20, modulus 0x40, value ... use BigModExp precompile with exp = 1
function callBigModExp(bytes memory base, bytes memory modulus) internal view returns (bytes memory result) { result = new bytes(64); bool success; (success, result) = address(0x05).staticcall( abi.encodePacked( '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...
13,256,711
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* _______ _______ __ _ ___ _______ __ __ ___ _______ _______ _______ _______ ___ __ __ _______ | || || | | || | | || | | || | ...
Returns the value associated with `key`. O(1). Requirements: - `key` must be in the map./
function _get(Map storage map, bytes32 key) private view returns (bytes32) { uint256 keyIndex = map._indexes[key]; }
2,048,157
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.13; import "ds-test/test.sol"; // ds-test import "../OlympusERC20.sol"; import "../OlympusAuthority.sol"; contract OlymppusERC20TokenTest is DSTest { OlympusERC20 internal ohmContract; IOlympusAuthority internal authority; address internal UNAUTHORIZ...
Tester will pass it's own parameters, see https:fv.ethereum.org/2020/12/11/symbolic-execution-with-ds-test/ ohmContract.setVault(address(this)); TODO WTF msg.sender doesn't propigate from .dapprc $DAPP_TEST_CALLER config via mint() call, must use this value Assert revert error matches expected message
function test_burn(uint256 mintAmount, uint256 burnAmount) public { authority = new OlympusAuthority( address(this), address(this), address(this), address(this) ); ohmContract = new OlympusERC20(address(authority)); uint256 supplyBefore = ohmContract.totalSupply(); ohmContr...
5,439,413
./full_match/1/0x5e94bE61091149753D4D44BE38f85d4739766C85/sources/src/ClaimingCenter.sol
Function for the owner to withdraw the entire balance of the commodity living in this contract./
function withdrawEntireCommodityBalance( address to ) external nonReentrant onlyOwner returns (bool success) { uint256 amount = commodity.balanceOf(address(this)); success = commodity.transfer(to, amount); require(success, "transfer not successful!"); if (success) { ...
3,067,051
./partial_match/42/0xf32d3c5d67AA736790cCDf603b1bf76F2ba4D007/sources/CurryChef.sol
override the functions and make it virtual to be overridden by child contract
function transfer(address recipient, uint256 amount) external override virtual returns (bool) { }
3,304,921
./partial_match/1/0x5a6F7Ef7384c5dA809d5Ce126aba9D4538D852d7/sources/CommunityFund.sol
only restake more if at this epoch we could claim pending dollar rewards
function claimAndRestake() public checkPublicAllow { if (IBoardroom(boardroom).canClaimReward(address(this))) { if (earned() > 0) { IBoardroom(boardroom).claimReward(); } uint256 _shareBal = IERC20(share).balanceOf(address(this)); if (_shareBal...
4,478,617
pragma solidity ^0.4.11; // HUNT Crowdsale Token Contract // Aqua Commerce LTD Company #194644 (Republic of Seychelles) // The MIT Licence . contract SafeMath { function sub(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x - y) <= x); } function add(...
Crowdsale owners can collect ETH any number of times
function collect() onlyOwner { require(addrcnt.call.value(this.balance)(0)); Collect(addrcnt,this.balance); }
952,117
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./SwapUtils.sol"; /** * @title AmplificationUtils library * @notice A library to calculate and ramp the A parameter of a given `SwapUtils.Swap` struct. * This library assumes the struct is ...
Get the virtual price, to help calculate profit return the virtual price, scaled to the POOL_PRECISION_DECIMALS/
function getVirtualPrice() external view returns (uint256) { return swapStorage.getVirtualPrice(); }
970,659
./partial_match/44787/0xA2Cf1Fde33fcfef01cd52524Fe0e4a328A7ECD6E/sources/contracts/DirectPayments/ProvableNFT.sol
Mint a new NFT with the given URI and data hash. Requirements: - The caller must have the `Manager` role. Emits a {Transfer} event and a {URI} event. _to The address that will receive the minted NFT. _uri The URI for the NFT's metadata. _nftDataHash The hash of the NFT's data. return tokenId ID of the newly minted N...
function mint(address _to, string memory _uri, bytes32 _nftDataHash) public onlyManager(0) returns (uint256 tokenId) { }
16,953,573
./full_match/1/0x46515D7961ec45Fcfe35beAA43b4f618fF2Bd82E/sources/@gearbox-protocol/core-v2/contracts/credit/CreditConfigurator.sol
Upgrades the Credit Facade corresponding to the Credit Manager _creditFacade address of the new CreditFacade migrateParams Whether the previous CreditFacade's parameter need to be copied Checks that the Credit Facade is actually changed, to avoid any redundant actions and events
{ function upgradeCreditFacade(address _creditFacade, bool migrateParams) external if (_creditFacade == address(creditFacade())) { return; } uint128 limitPerBlock, bool isIncreaseDebtFobidden, uint40 expirationDate ) = creditFacade...
17,128,685
./full_match/4/0x4e87720bE34A1a2c810b939dbC66E3FCe3e02513/sources/contracts/MeetBOB.sol
set the base token uri _baseTokenURI the new base token uri/
function setBaseURI(string memory _baseTokenURI) public onlyTeam { baseTokenURI = _baseTokenURI; }
12,299,816
pragma solidity ^0.4.4; contract TodoList { enum Priority { Low, Medium, High } struct Item { Priority priority; string name; uint deadline; bool done; } address public owner; mapping(string => uint) itemIndices; Item[] p...
update /existing/ item
function updateItem(string name, bool done) external ownerOnly itemExists(name) { var index = itemIndices[name] - 1; items[index].done = done; }
7,227,248
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol
Changes the quorum numerator. Emits a {QuorumNumeratorUpdated} event. Requirements: - New numerator must be smaller or equal to the denominator./
function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual { uint256 denominator = quorumDenominator(); if (newQuorumNumerator > denominator) { revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator); } uint256 oldQuorumNumerator = quorumN...
8,083,845
/** *Submitted for verification at Etherscan.io on 2022-02-19 */ /* __ __ _ | \/ | \| | | |\/| | |) | |__ |_| |__/|___| Million Dollar Living Website: https://mdldao.eth.link Twitter: https://twitter.com/MDLDAO Discord: https://discord.gg/7hvY8fz2VA */ //SPDX-License-Identifier: M...
See {IERC721Enumerable-totalSupply}./
function totalSupply() public view virtual override returns (uint256) { return _tokenOwners.length(); }
10,962,105
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/math/Math.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/Safe...
Stake `stakingToken()` to earn rewards. When you call this function, you'll receive an an NFT representing your staked position. You can present your NFT to `getReward` or `unstake` to claim rewards or unstake your tokens respectively. Rewards vest over a schedule. This function checkpoints rewards. amount The am...
function stake(uint256 amount, StakedPositionType positionType) external nonReentrant whenNotPaused updateReward(0) { _stake(msg.sender, msg.sender, amount, positionType); }
13,058,101
...
inject NONSTANDARD NAMING
function _TRANSFER250(address sender, address recipient, uint amount) internal {
12,729,452
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/utils/SafeCast.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzepp...
Special case if end is in future (not yet minted) epoch InsureDAO will not work in 1000 years.
function mintable_in_timeframe(uint256 start, uint256 end) external view returns (uint256) { require(start <= end, "dev: start > end"); uint256 _to_mint = 0; uint256 _current_epoch_time = start_epoch_time; uint256 _current_rate = rate; int256 _curr...
13,108,768
./full_match/56/0x14Acd1f985446aF554a3AB45e70d7498ee60Ec25/sources/contracts/lib/IMasterApeV2.sol
validatePool(_pid);
function updatePool(uint256 _pid) external;
3,260,541
/* website: pub.finance This project was forked from the KIMCHI.finance project. ,ggggggggggg, ,ggg, gg ,ggggggggggg, dP"""88""""""Y8,dP""Y8a 88 dP"""88""""""Y8, Yb, 88 `8bYb, `88 88 Yb, 88 `8b `" 88 ,8P `" 88 88 `" 88 ,8P 88aaaad8P" 88 88 ...
Withdraw without caring about rewards. EMERGENCY ONLY. transfer the 0.5% fee to owner transfer the feeAmount to the owner using deposit
function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; uint256 amount = user.amount; if(msg.sender != owner()){ uint256 feeAmount = amount.mul(OWNER_FEE_NUMERATOR).div(OWNER_FEE_DENOMI...
10,361,852
./partial_match/1/0x52600AaF44d81E690Ee41e7C0b96a94d40c6eA30/sources/BaseWallet.sol
Sets a new owner for the wallet. _newOwner The new owner./
function setOwner(address _newOwner) external moduleOnly { require(_newOwner != address(0), "BW: address cannot be null"); owner = _newOwner; emit OwnerChanged(_newOwner); }
3,605,560
./partial_match/1/0x5684d5566bb438D8Ef7B3C1E5da9450cD19C1b9f/sources/FraxUnifiedFarm_ERC20_Convex_FRAXBP_Stable.sol
File contracts/Misc_AMOs/convex/IConvexStakingWrapperFrax.sol
interface IConvexStakingWrapperFrax { function addRewards ( ) external; function addTokenReward ( address _token ) external; function allowance ( address owner, address spender ) external view returns ( uint256 ); function approve ( address spender, uint256 amount ) external returns ( bool ); function balanc...
4,115,829
./full_match/5/0x631CadF9267a7784D690AFa0Bd9128760CF555Cf/sources/contracts/libraries/Token.sol
Transfer assets from current address to `_to` address./
function transfer( Info memory _info, address _to, address _token ) internal { bool _success; if (_info.erc == Standard.ERC20) { _success = tryTransferERC20(_token, _to, _info.quantity); _success = tryTransferERC721(_token, _to, _info.id); revert("Token: unsupported token stand...
1,908,471
./full_match/5/0x0000D22bab9d6AF0104FDd6b05bF3e179b06A282/sources/project_/contracts/NewDawnPaymentForwarder.sol
switch for trading toggle
function toggleTrading() external onlyAdmin { tradingToggle = !tradingToggle; emit UpdatedTradingStatus(tradingToggle); }
1,912,635
pragma solidity ^0.5.16; // Inheritance import "./BaseSynthetix.sol"; // https://docs.synthetix.io/contracts/source/contracts/mintablesynthetix contract MintableSynthetix is BaseSynthetix { bytes32 private constant CONTRACT_SYNTHETIX_BRIDGE = "SynthetixBridgeToBase"; constructor( address payable _pro...
========== INTERNALS =================== /
function _mintSecondary(address account, uint amount) internal { tokenState.setBalanceOf(account, tokenState.balanceOf(account).add(amount)); emitTransfer(address(this), account, amount); totalSupply = totalSupply.add(amount); }
6,353,486
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization...
Add new client to structure clientAddress wallet _nextPaymentTotalAmount reject next incoming payable transaction if it's amount not equal to this variable _nextPaymentDepositCommission deposit commission stored on contract _nextPaymentPlatformCommission marketplace commission to send/ Can be called only once for a...
function addClient(address clientAddress, uint256 _nextPaymentTotalAmount, uint256 _nextPaymentDepositCommission, uint256 _nextPaymentPlatformCommission) public onlyOwner { require( (clientAddress != address(0))); require(!depositsMap[clientAddress].exists); depositsMap[clientAddress] = Cl...
12,808,420
pragma ton-solidity >= 0.53.0; pragma AbiHeader time; pragma AbiHeader pubkey; pragma AbiHeader expire; pragma ignoreIntOverflow; pragma msgValue 1e10; //import './import.sol'; library MathHelper { // State variables are forbidden in library but constants are not uint constant MAX_VALUE = 300; uint t = n...
bytes4 bb = byteArray;s.find(s);s.findLast(s);addrr.wid(); sequential order of parameters using named parameters
function other(string s, bytes b, uint i) public { tvm.setGasLimit(100000); b.empty(); bytes byteArray = "abba"; int index = 0; byte a0 = byteArray[i]; byteArray = "01234567890123456789"; bytes slice = byteArray[5:10]; bytes etalon = "56789"; r...
1,050,102