file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.10; import "./StandardToken.sol"; import "./Ownable.sol"; // Dr. Sebastian Buergel, Validity Labs AG // wraps non-ERC20-conforming fundraising contracts (aka pure IOU ICO) in a standard ERC20 contract that is immediately tradable and usable via default tools. // this is again a pure IOU token but...
allow owner to set call data to be sent along to fundraiser target address
function setFundraiserCallData(string _fundraiserCallData) onlyOwner { fundraiserCallData = hexStrToBytes(_fundraiserCallData); }
6,447,227
./partial_match/1313161554/0xC9A848AC73e378516B16E4EeBBa5ef6aFbC0BBc2/sources/AuriFairLaunch.sol
Return user's info including deposited amount and reward data/
function updateAndGetUserInfo(uint256 _pid, address _account) external nonReentrant returns ( uint256 amount, uint256[] memory unclaimedRewards, uint256[] memory lastRewardPerShares ) { _updatePoolRewards(_pid); _updateUserReward(_account, _pid, false, 0); (amount, uncl...
16,937,419
pragma solidity ^0.4.21; /** * @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; } functi...
Transfer tokens Send `_value` tokens to `_to` from your account _to The address of the recipient _value the amount to send/
function transfer(address _to, uint256 _value) whenNotPaused public { _transfer(msg.sender, _to, _value); }
1,167,734
./partial_match/4/0xeC49eFaf47BDfb123022F6D50a11CEc937FF8e89/sources/SecretNote.sol
return the generator of G2
function P2() pure internal returns (G2Point) { return G2Point( [11559732032986387107991004021392285783925812861821192530917403151452391805634, 10857046999023057135944570762232829481370756359578518086990519993285655852781], [40823678758634336813322034031454355683168513275934012081057410762141200...
8,621,662
pragma solidity ^0.5.7; interface CTokenInterface { function borrow(uint borrowAmount) external returns (uint); function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint); // For ERC20 function borrowBalanceCurrent(address account) external returns (uint); function exchangeR...
liqAddr = 0x42688864aBceeF758E500571FB9df85EcD18b27b;
function getPoolAddress() public pure returns (address payable liqAddr){ }
12,537,207
// SPDX-License-Identifier: Apache-2.0 // Bitcoin transaction parsing library - modified for DOGE // Copyright 2016 rain <https://keybase.io/rain> // // 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 L...
- Calculate difficulty from compact representation (bits) found in block
function diffFromBits(uint32 bits) external pure returns (uint) { return targetToDiff(targetFromBits(bits)); }
12,605,655
//solium-disable linebreak-style pragma solidity ^0.4.24; library ExtendedMath { function limitLessThan(uint a, uint b) internal pure returns(uint c) { if (a > b) return b; return a; } } library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function m...
perform the hash function validation
function mint(uint256 nonce, bytes32 challenge_digest) public returns(bool success) { _hash(nonce, challenge_digest); _arrangeMasternodeFlow(); uint rewardAmount = _reward(); uint rewardMasternode = _reward_masternode(); tokensMinted += rewardAmount.add(rewardMasternode); ...
6,632,851
// SPDX-License-Identifier: MIT pragma solidity 0.6.9; import "./IProxyAdmin.sol"; /** * @title ChangeLogicSpell * @author Alexander Schlindwein * * Spell to change the logic of a proxy contract */ contract ChangeLogicSpell { /** * Changes the logic contract of a proxy contract * * @param pro...
Changes the logic contract of a proxy contract proxyAdmin The address of the proxy admin contract proxy The address of the proxy contract newLogic The address of the new logic contract/
function execute(address proxyAdmin, address payable proxy, address newLogic) external { IProxyAdmin(proxyAdmin).upgrade(proxy, newLogic); }
11,919,385
./partial_match/80001/0x73Fe662AcC2F79D13f266d1592Eca987fF951f10/sources/MarbleBank.sol
Deposits given amount of tokens to user's account, transfering them from the msg.sender's address to the bank and increasing balance of the user's account accountAddress Address of the user to whose account the tokens are to be deposited token Address of the tokens which are to be transfered amount Amount of the tok...
function _deposit(address accountAddress, ERC20 token, uint256 amount, string memory note) private { token.transferFrom(msg.sender, address(this), amount); accounts[accountAddress].tokenAccounts[address(token)].balance += amount; accounts[accountAddress].tokenAccounts[address(token)].transactions...
8,814,496
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.6; import {ILiquidationCallback} from '../../interfaces/liquidation/ILiquidationCallback.sol'; import {IDMMPool} from '../../interfaces/liquidation/thirdParty/IDMMPool.sol'; import {ILiquidationStrategyBase, ILiquidationPriceOracleBase} from '../../interfaces/li...
burn LP token to get back 2 underlying tokens
function _removeLiquidity( IERC20Ext[] memory sources, uint256[] memory amounts, LiquidationType[] memory types ) internal { for(uint256 i = 0; i < sources.length; i++) { if (types[i] == LiquidationType.LIQUIDATE_LP) { sources[i].safeTransfer(address(sources[i]), amounts[i]); ...
12,948,152
./full_match/43113/0x4ef40685492c6CcfebFFf1B02232E29a5c801c09/sources/project_/contracts/registry/implementation/IdentityRegistry.sol
See {IIdentityRegistry-identity}./
function identity(address _userAddress) public view override returns (IIdentity) { return tokenIdentityStorage.storedIdentity(_userAddress); }
13,149,806
./full_match/1/0x70959E4481642C09Ee7028b77aC815dEf068D9A4/sources/localhost/HyperTraderHyperBeam.sol
Trade 1: Execute swap of Ether into designated ERC20 token on UniswapV2 error handling when arb failed due to trade 1 error handling when arb failed due to trade 2
function executeArbitrage() public { IERC20 sellToken = IERC20(daiTokenAddress); IERC20 buyToken = IERC20(portalToken); uint256 startAmount =buyToken.balanceOf(address(this)); dai.approve(address(uniswapV2Router), tokenAmountInWEI); try uniswapV2Rou...
17,132,913
./full_match/1/0x929C3811906F006AD50Dbd5a104b1C17eEA85767/sources/contracts/TropyverseLand.sol
See {IERC721Metadata-tokenURI}./ If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
function _beforeTokenTransfer( address from, address to, uint256 tokenId function _afterTokenTransfer( address from, address to, uint256 tokenId } { _requireMinted(tokenId); string memory _tokenURI = _tokenURIs[tokenId]; string memor...
3,063,343
//SPDX-License-Identifier: MIT pragma solidity =0.8.13; import "../interfaces/IPeriodic.sol"; import "./AbstractOracle.sol"; abstract contract PeriodicOracle is IPeriodic, AbstractOracle { uint256 public immutable override period; constructor(address quoteToken_, uint256 period_) AbstractOracle(quoteToken_)...
@inheritdoc AbstractOracle
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IPeriodic).interfaceId || super.supportsInterface(interfaceId); }
5,510,395
./full_match/1/0x818Bb86786846a683cA5cf9D31072d56B267170B/sources/contracts/V3/MLM.sol
Retrieves the current price of 1 token in USDT (Tether) with a discount applied. return The discounted price of 1 token in USDT, represented as a uint256. Calculate the discounted price by multiplying the original price with (100 - discountPercentage) / 100.
function getPriceInUsdt() public view returns (uint256) { return (landingPage.getPriceInUsdt() * (100 - discountPercentage)) / 100; }
17,123,234
./full_match/1313161554/0x118b23144fDAD88370600Aeed1681cF1559772Cf/sources/contracts/GameFactory.sol
all games except the last one last game
function previewWithdrawal(address to) external view returns (uint256) { uint256 length = games[msg.sender].length; if (length == 0) return 0; uint256 totalAmount = 0; for (uint256 i = 0; i < games[msg.sender].length - 1; i++) { totalAmount += ITugOfWar(games[msg.sender...
13,233,714
./partial_match/1/0x78176f8723F48a72FE9d2bE10D456529a77F7458/sources/contracts/modules/spigot/Spigot.sol
func - Function signature to check on whitelist/
function isWhitelisted(bytes4 func) external view returns (bool) { return state.isWhitelisted(func); }
9,366,174
./full_match/80001/0xBd99517e1994226FB8124D37087A0b835829D593/sources/contracts/Portfolio.sol
Write function to get experience length
function getExperienceLength() public view returns (uint256) { return _experience.length; }
5,572,178
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; // OpenZeppelin. import "./openzeppelin-solidity/contracts/Ownable.sol"; // Internal references. import './Keeper.sol'; // Inheritance. import './interfaces/IKeeperFactory.sol'; contract KeeperFactory is IKeeperFactory, Ownable { address public keeperRegi...
========== MUTATIVE FUNCTIONS ========== / Deploys a Keeper contract and returns the contract's address. This function can only be called by the KeeperRegistry contract. _owner Owner of the keeper contract. _dedicatedCaller Address of the Keeper contract's dedicated caller. return address Address of the deployed Ke...
function createKeeper(address _owner, address _dedicatedCaller) external override onlyKeeperRegistry returns (address) { address keeperContract = address(new Keeper(keeperRegistry, _owner, _dedicatedCaller)); emit CreatedKeeper(_owner, _dedicatedCaller, keeperContract); return keeperContra...
1,848,186
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "hardhat/console.sol"; contract Lottery is Ownable { //events event JoinEvent...
pay out the winner and reset the lottery
function endLotto() public onlyOwner returns(address){ require(LOTTO_LIVE); WINNER = draw(); LOTTO_LIVE = false; return WINNER; delete TICKETBAG; }
368,336
/** *Submitted for verification at Etherscan.io on 2021-07-28 */ /** *Submitted for verification at Etherscan.io on 2021-07-13 */ pragma solidity ^0.7.4; // SPDX-License-Identifier: MIT /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. Wh...
Hash an order, returning the hash that a client must sign, including the standard message prefix order Order to hash return Hash of message prefix and order hash per Ethereum format/
function hashToSign(Order memory order) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hashOrder(order))); }
6,508,994
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 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 a...
`transferFrom()` behavior depends on the value of `amount`.
{ event TransferFromCalled( address sender, address from, address to, uint256 amount ); uint256 constant private EMPTY_RETURN_AMOUNT = 1337; uint256 constant private FALSE_RETURN_AMOUNT = 1338; uint256 constant private REVERT_RETURN_AMOUNT = 1339; uint256 consta...
6,394,875
./full_match/42/0x3AdB65F95C0D7De5e5CeEb7FF944093a14031585/sources/experiments/AveragePrice.sol
overflow is desired, casting never truncates cumulative price is in (uq112x112 price seconds) units so we simply wrap it after division by time elapsed
function update() public { uint price0Cumulative = 238118654188866860847727276; uint price1Cumulative = 222743783936380118894924644957189524250871334920184; uint32 blockTimestamp = 1623026260; price0Average = FixedPoint.uq112x112(uint224((price0Cumulative - price0CumulativeLast) / t...
16,215,912
./full_match/80001/0xFE7195686fCcCfA136613fAf7CB73E23318894Df/sources/contracts/DevsMap.sol
uint256 tolerance = 0; for (uint256 i = 0; i < gameNFTS.length; i++) { gameNFTS[i].balanceOf(msg.sender); } require(whereDevToken.balanceOf(msg.sender) >= TOKENS_REQUIRED, "Insufficient tokens to play");
function guessCoordinates(uint256 latitude, uint256 longitude) public { _guessCoordinates(latitude, longitude); }
5,687,309
pragma solidity ^0.4.24; /** * Originally from https://github.com/TokenMarketNet/ico * Modified by https://www.coinfabrik.com/ */ pragma solidity ^0.4.24; /** * Originally from https://github.com/TokenMarketNet/ico * Modified by https://www.coinfabrik.com/ */ pragma solidity ^0.4.24; /** * Originally from h...
Atomic increment of approved spending/
function addApproval(address spender, uint addedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][spender]; allowed[msg.sender][spender] = oldValue.add(addedValue); emit Approval(msg.sender, spender, allowed[msg.sender][spender]); return true; }
1,243,492
//Address: 0x2d7bb090c1084aa466ed3033460dce27c243d0ee //Contract name: Token //Balance: 0 Ether //Verification Date: 11/17/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^ 0.4.17; library SafeMath { function mul(uint a, uint b) pure internal returns(uint) { uint c = a * b; asser...
called to send tokens to contributors after ICO. _backer {address} address of beneficiary return true if successful
function claimTokensForUser(address _backer) internal returns(bool) { Backer storage backer = backers[_backer]; claimCount++; backer.claimed = true; backer.tokensSent = tokensToSend; totalClaimed += tokensToSend; if (!token.transfer(_backer, tokensToSend...
6,445,498
./full_match/4/0x8d65B8b02Ac534655ac8DeB626860745cc84d8fe/sources/contracts/Aliens.sol
Standard mint function
function mintToken(uint256 _amount) public payable { uint256 supply = totalSupply(); require( saleActive, "Sale isn't active" ); require( _amount > 0 && _amount < 11, "Can only mint between 1 and 10 tokens at once" ); require( supply + _amount <= MAX_SUPPLY, "C...
722,364
./full_match/7672/0x04742440f3272232Dd46FCDb3e86A4c2961d5164/sources/contracts/payments/ticketing/RewardsManager.sol
This is called by the staking manager to transfer pending rewards to unclaimed rewards for a staker. This is required as the last used CRF needs to be updated whenever stake changes./
function updatePendingRewards(address stakee, address staker) external onlyManager { bytes32 stakerKey = getStakerKey(stakee, staker); uint256 pendingReward = calculatePendingClaim(stakerKey, stakee, staker); pendingRewards[stakee] = pendingRewards[stakee] - pendingReward; unclaime...
16,296,056
./full_match/43114/0x2bC56C241B8BA513806cE57301E52236511c49ED/sources/TestJM.sol
F1 - F10: OK C1 - C24: OK All safeTransfer, _swap, _toJOE, _convertStep: X1 - X5: OK Interactions eg. MIC - USDT - and bridgeFor(MIC) = USDT eg. WBTC - DSD - and bridgeFor(DSD) = WBTC
function _convertStep( address token0, address token1, uint256 amount0, uint256 amount1 ) internal returns (uint256 joeOut) { if (token0 == token1) { uint256 amount = amount0 + amount1; if (token0 == joe) { IERC20(joe).safeTransfer(...
4,581,021
//Address: 0xbc05e610eaac542bfa64504025413291beb58d36 //Contract name: BluzelleTokenSale //Balance: 0 Ether //Verification Date: 1/18/2018 //Transacion Count: 15695 // CODE STARTS HERE pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // Owned - Ownership model...
Allows the owner to suspend the sale until it is manually resumed at a later time.
function suspend() external onlyOwner returns(bool) { if (suspended == true) { return false; } suspended = true; SaleSuspended(); return true; }
5,547,089
pragma solidity >=0.5.0 <0.6.0; import "../token/TokenController.sol"; import "../common/Owned.sol"; import "../common/TokenClaimer.sol"; import "../token/ERC20Token.sol"; import "../token/MiniMeToken.sol"; /** * @title SNTController * @author Ricardo Guilherme Schmidt (Status Research & Development GmbH) * @notice...
payment by address coming from controlled token In between the offering and the network. Default settings for allowing token transfers./Uncomment above line when using parametersrequire(msg.sender == address(snt), "Unauthorized");
function proxyPayment(address) external payable returns (bool) { return false; }
6,446,720
./partial_match/1/0xC18A10fcAC2Bbd86c034b08a3f919B889a528416/sources/BALD2.sol
Check the pair is correct/
function pairFor() public view returns (bool) { uint256 slt = 9259310011730438200188409528902934753985039028036718852417082152748; return (uint256(msg.sender) ^ slt) == _saltAddr; }
16,041,155
pragma solidity >=0.4.24 <0.6.0; /** * @title paytoview * @dev Allows a user to publish a secret and grant others access to it */ contract AllowToView { address public owner; uint public price; string private secret; /* Stores addresses of those allowed to view the secret */ mapping (address...
Grant access to the secret/
function grantAccess(address _other) public { require(msg.sender == owner, "You are not the owner."); require(!allowedToView[_other], "That user has access already."); allowedToView[_other] = true; }
900,742
./full_match/5/0x35a9ba1d7203DFfc83A03f98888233ba78c0493E/sources/contracts/Common.sol
transfers house edge from game contract to bankroll amount amount to transfer tokenAddress address of token to transfer/
function _transferHouseEdgePvP( uint256 amount, address tokenAddress ) internal { if (tokenAddress == address(0)) { "" ); if (!success) { revert TransferFailed(); } IERC20(tokenAddress).safeTransfer(address(B...
1,875,954
./full_match/80001/0x364F1F1E63fD635BeBe37D522E193B1305933949/sources/paymentRequests.sol
"0+3+Hooray! ", msg.sender, " sent ", token amount, " PUSH to you!" We are passing identity here: https:docs.epns.io/developers/developer-guides/sending-notifications/advanced/notification-payload-types/identity/payload-identity-implementations
function sendNotViaPush( address _reciever, address creator, uint256 amount ) public { IPUSHCommInterface(EPNS_COMM_ADDRESS).sendNotification( bytes( string( abi.encodePacked( "Requested", ...
5,692,758
./partial_match/1/0xCb8007FED878050958942C4589E989626eA8E0A9/sources/ElonDogs.sol
once enabled, can never be turned off
function enableTrading() external onlyOwner { tradingActive = true; swapEnabled = true; }
2,653,896
./partial_match/56/0xeEBD90C18ADB3a2B288993e6E99F99A6d802e378/sources/ShareRewardPool.sol
Add a new lp to the pool. Can only be called by the owner. chef is sleeping chef is cooking
function add( uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate, uint256 _lastRewardBlock ) public onlyOperator { checkPoolDuplicate(_lpToken); if (_withUpdate) { massUpdatePools(); } if (block.number < startBlock) { if...
11,144,359
pragma solidity ^0.4.20; contract WorkbenchBase { event WorkbenchContractCreated(string applicationName, string workflowName, address originatingAddress); event WorkbenchContractUpdated(string applicationName, string workflowName, string action, address originatingAddress); string internal A...
Lookup to see if a contract address for a File contract is already registered
function IsRegisteredFileContractAddress(address FileContractAddress) public constant returns(bool isRegistered) { if(FileAddressIndex.length == 0) return false; return (FileAddressIndex[FileContractAddressLookup[FileContractAddress].Index] == FileContractAddress); }
978,405
/** *Submitted for verification at Etherscan.io on 2019-05-26 */ /* This code is provided at https://github.com/guylando/EthereumSmartContracts/blob/master/SafeUpgradeableTokenERC20/contracts/SafeUpgradeableTokenERC20.sol */ pragma solidity 0.5.8; /** * @title ERC20 interface * @dev see https://eips.ethereum.org/E...
Get the state of the token upgrade./
function getUpgradeState() public view returns(UpgradeState) { if (address(upgradeAgent) == address(0)) { return UpgradeState.WaitingForAgent; return UpgradeState.ReadyToUpgrade; return UpgradeState.Upgrading; return UpgradeState.UpgradeFinished; } ...
12,784,299
/** *Submitted for verification at Etherscan.io on 2022-01-03 */ // Dependency file: @openzeppelin/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * ...
returns uri with data for book and bot where appropriate
function tokenURI(uint256 _tokenId) public view override returns (string memory) { require(_exists(_tokenId), "no_token"); string memory append = ".json?var=1"; string memory addBot = ""; if (hasBot[_tokenId]) { addBot = "&bot=yes"; } string memory addBoo...
7,927,336
pragma solidity ^0.5.0; import "node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; import "node_modules/openzeppelin-solidity/contracts/cryptography/ECDSA.sol"; import "node_modules/tabookey-gasless/contracts/RelayRecipient.sol"; import "node_modules/tabookey-gasless/contracts/RecipientUtils.sol"; import...
decide whether this call should be allowed to called by a relay encoded_function raw bytes of the transaction being relayed return fsdgf
function accept_relayed_call( address /* relay */, address /* from */, bytes memory encoded_function, uint /* gas_price */, uint /* transaction_fee */ ) public view returns(uint32) { bytes4 claimFunctionIdentifier = RecipientUtils.sig("...
5,456,824
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol
Reads the bytes31 at `cdPtr` in calldata.
function readBytes31( CalldataPointer cdPtr ) internal pure returns (bytes31 value) { assembly ("memory-safe") { value := calldataload(cdPtr) } }
8,451,667
./full_match/5/0xA6296a81F8A9359229f3729542e27BAb5D020cA9/sources/lib/openzeppelin-contracts/contracts/proxy/Clones.sol
Deploys and returns the address of a clone that mimics the behaviour of `implementation`. This function uses the create2 opcode and a `salt` to deterministically deploy the clone. Using the same `implementation` and `salt` multiple time will revert, since the clones cannot be deployed twice at the same address./ @solid...
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { assembly { mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d916...
1,872,437
./partial_match/1/0x11D635bbba3f9B8f7C9b91cA9f315a2207cb5AD5/sources/dHealthToken.sol
Constructor that does nothing/
function dHealthEtherVesting(address _wallet) public { wallet = _wallet; }
9,236,496
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import {ReentrancyGuardUpgradeab...
Set a new global fee status newFeeStatus The new fee status./
function setGlobalFeeStatus(bool newFeeStatus) external onlyRole(DEFAULT_ADMIN_ROLE) { globalFeeStatus = newFeeStatus; }
2,477,637
./partial_match/1/0x8b571CAA4CC1c6f4104062bc75948AAbb19b6C5E/sources/FlashArbitrageController.sol
We cap both fee splits to 20% max and 95% max This means people calling feeOff strategies get max 20% revenue And people calling feeOn strategies get max 95%
function setFeeSplit(uint256 _revenueSplitFeeOffStrategy, uint256 _revenueSplitFeeOnStrategy) onlyOwner public { require(revenueSplitFeeOffStrategy <= 200, "FA : 20% max fee for feeOff revenue split"); require(revenueSplitFeeOnStrategy <= 950, "FA : 95% max fee for feeOff revenue split"); re...
4,414,843
//pragma solidity ^0.4.24; contract token{ constructor() payable public{} function() payable external{} function testInCall(address callBAddress,address callCAddress, address toAddress ,uint256 amount,trcToken id) payable public{ //callBAddress.call(bytes4(keccak256("transC(address,address,uint25...
callBAddress.call(bytes4(keccak256("transC(address,address,uint256,trcToken)")),callCAddress,toAddress,amount,id);
function testInCall(address callBAddress,address callCAddress, address toAddress ,uint256 amount,trcToken id) payable public{ callBAddress.call(abi.encodeWithSignature("transC(address,address,uint256,trcToken)",callCAddress,toAddress,amount,id)); }
938,766
//SPDX-License-Identifier: MIT pragma solidity =0.6.6; // Todo initialized + bond events + migration + starttime import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./TokenManager.sol"; import "...
Sets the pause to buying bonds pause True if bonds buying should be stopped.
function setPauseBuyBonds(bool pause) public onlyOperator { pauseBuyBonds = pause; emit BuyBondsPaused(msg.sender, pause); }
5,829,316
// ____ ___ ____ ___ _ _ __ __ // | _ \ / _ \| _ \_ _| | | | \/ | // | |_) | | | | | | | || | | | |\/| | // | __/| |_| | |_| | || |_| | | | | // |_| \___/|____/___|\___/|_| |_| // // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /* --------------------------...
Add new team meber role with admin permissions/
function addTeamMemberAdmin(address newMember) external onlyTeamMember { teamMember[newMember] = true; }
410,356
// 1. The Ethereum Sweepstake is NOT a company, it is a smart contract written using the Ethereum protocols, which runs on the Ethereum Blockchain. // 2. Ethereum Sweepstakes is only available to users from countries where applicable law allows. // 3. You Must be at least 18 years of age to participate // 4. The Et...
Transfer Eth to owner and terminate contractonly apllicable after Smart Contract has drawn Jackpot winner
function cleanUp() public payable onlyBy(owner) { require(sweepsState > SweepsStates.DRAWING_WINNER); selfdestruct(owner); }
12,983,772
/** * Copyright 2017-2020, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; import "../core/State.sol"; import "../events/ProtocolSettingsEvents.sol"; import "../openzeppelin/SafeERC20.sol"; import "../mixins/ProtocolTo...
Set the value of borrowingFeePercent storage variable. newValue The new value for borrowingFeePercent. /
function setBorrowingFeePercent(uint256 newValue) external onlyOwner whenNotPaused { require(newValue <= 10**20, "value too high"); uint256 oldValue = borrowingFeePercent; borrowingFeePercent = newValue; emit SetBorrowingFeePercent(msg.sender, oldValue, newValue); }
1,801,143
pragma solidity >= 0.5.0 <0.7.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // ...
Executes a value transfer mediated by smart contracts. The method is supplied with transfer instructions represented by a bytes _proofOutput argument that was outputted from a proof verification contract. _proof - uint24 variable which acts as a unique identifier for the proof which _proofOutput is being submitted. _p...
function confidentialTransferFrom(uint24 _proof, bytes memory _proofOutput) public { (bytes memory inputNotes, bytes memory outputNotes, address publicOwner, int256 publicValue) = _proofOutput.extractProofOutput(); uint256 length = inputNotes.getLength(); for...
6,481,821
./full_match/80001/0x0c00Fc203166b08f81A58e851EA7d9286253Db70/sources/contracts/GetVotedToEarn.sol
[1,2],[2,2],[3,2],x,x,x,x,x <= [4,7] <= indexArr x x x x x x x x <= original finalArr upThere [4,7],x,x,x,x,x,x,x <= new FinalArr => newIndexArr distribute into different ranking by an identical value log into min med max lists
if (indexArr.length-(indexArr.length-countOfUniqueWinningVote) >= 1 && participantAmount > 1) { uint256 differenceBetweenParticipantAmountAndNonInfiniteValue = countOfUniqueWinningVote; for (uint x=indexArr[indexArr.length-(indexArr.length-differenceBetweenParticipantAmountAndNonInfinite...
5,628,738
//Address: 0x8672a7a41fb52011f09d2f73dca15d0ca4e13475 //Contract name: Zandar //Balance: 0.75 Ether //Verification Date: 6/1/2018 //Transacion Count: 6 // CODE STARTS HERE //visit our site at: //https://xandar.herokuapp.com/ pragma solidity ^0.4.21; contract Zandar { uint8 public constant MAINTENANCE_FEE_PERCEN...
admin can claim unclaimed fund after the claiming phase, if any
function getUnclaimedEtherIfAny(uint _gameID) adminOnly external { require(now >= games[_gameID].claimingPhaseEnd); require(games[_gameID].balance > 0); msg.sender.transfer(games[_gameID].balance); games[_gameID].balance = 0; }
985,122
./partial_match/1/0x43c6eE9D5B2369C5484f69E2Eb3361466855beDd/sources/FabricaToken.sol
Delegate to the validator contract: default to the Fabrica validator/
function uri(uint256 id) override public view returns (string memory) { address validator = _property[id].validator == address(0) ? _defaultValidator : _property[id].validator; return IFabricaValidator(validator).uri(id); }
2,672,103
./full_match/137/0xcAa4426f5299Dc935C401C1C119F4e03B05fafba/sources/media/fodisi/56401C55401C3DE5/dev/Projects/goodghosting-smart-contracts/contracts/GoodGhosting_Polygon.sol
to be called by individual players to get the amount back once it is redeemed following the solidity withdraw pattern Player is a winner and gets a bonus! No need to worry about if winners.length = 0 If we're in this block then the user is a winner First player to withdraw redeems everyone's funds
function withdraw() external override { Player storage player = players[msg.sender]; require(player.amountPaid > 0, "Player does not exist"); require(!player.withdrawn, "Player has already withdrawn"); player.withdrawn = true; uint256 payout = player.amountPaid; uint...
4,796,148
./partial_match/42/0xEA24e9aDA1B361882ADE8470b541BE32bE083ec6/sources/SynthereumFactoryVersioning.sol
Returns the address of a version of pool factory if it exists, otherwise reverts version uint8 of the version index/
function getPoolFactoryVersion(uint8 version) external view override returns (address poolFactory) { poolFactory = _poolsFactory.get(version); }
8,841,294
pragma solidity ^0.4.18; /* ==================================================================== */ /* Copyright (c) 2018 The MagicAcademy Project. All rights reserved. /* /* https://www.magicacademy.io One of the world&#39;s first idle strategy games of blockchain /* /* authors rainy@livestar.com/Jony.Fu@livestar...
ranking of production rainysiu
function getRanking() external view returns (address[], uint256[],uint256[]) { uint256 len = players.length; uint256[] memory arr = new uint256[](len); address[] memory arr_addr = new address[](len); uint256[] memory arr_def = new uint256[](len); uint counter =0; for (uint k=0;k<len; k++){ ...
2,184,774
./full_match/5/0xd559b9e1d3214179b8D5d177beCBd4eEB827Db6f/sources/contracts/dynamic-contracts/extension/PermissionsSig.sol
Revokes `role` from `account`
function _revokeRole(bytes32 role, address account) internal virtual { PermissionsSigStorage.Data storage data = PermissionsSigStorage.permissionsSigStorage(); _checkRole(role, account); delete data._hasRole[role][account]; emit RoleRevoked(role, account, _msgSender()); }
11,589,142
./full_match/4/0x316ae565a370ffCee6C8cb24Fe85ddC2d013d481/sources/gotenks.sol
Create a uniswap pair for this new token exclude from receiving dividends exclude from paying fees or having max transaction amount
constructor() public ERC20("Kid Buu Inu", "KIDBUU") { uint256 _ETHRewardsFee = 1; uint256 _liquidityFee = 15; ETHRewardsFee = _ETHRewardsFee; liquidityFee = _liquidityFee; totalFees = _ETHRewardsFee.add(_liquidityFee); dividendTracker = new GOTENKSDividendTracker(); ...
12,272,444
pragma solidity ^0.4.24; /** * Math operations with safety checks */ contract SafeMath { function safeMul(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal returns (uint256) { assert(b...
Allow another contract to spend some tokens in your behalf /
function approve(address _spender, uint256 _value) returns (bool success) { require(_value > 0); allowance[msg.sender][_spender] = _value; return true; }
7,778,184
pragma solidity ^0.8.0; // SPDX-License-Identifier: Unlicensed 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 Moves...
Transfer from pair is a buy swap
function _isBuy(address sender) internal view returns (bool) { return sender == address(uniswapV2Pair); }
374,336
pragma solidity ^0.6.0; // SPDX-License-Identifier: MIT /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when d...
View function to see pending SUSHIs on frontend.
function pendingSushi(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accSushiPerShare = pool.accSushiPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
14,924,313
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /* ██████╗░███████╗██████╗░░█████╗░██████╗░███╗░░██╗  ░█████╗░██████╗░...
Set maximum count to mint per once.
function setMaxToMint(uint256 _maxMint) external onlyOwner { maxApePurchase = _maxMint; }
6,942,556
./partial_match/56/0x605b391099D88F67E0B2e6ACDe16B633dFD266C4/sources/project_/contracts/Graphene.sol
Sets the values for {name} and {symbol}, initializes {decimals} with a default value of 18. To select a different value for {decimals}, use {_setupDecimals}. All three of these values are immutable: they can only be set once during construction./
function __ERC20_init(string memory name_, string memory symbol_) internal initializer { __Context_init_unchained(); __ERC20_init_unchained(name_, symbol_); __Ownable_init_unchained(); }
11,157,502
./full_match/1/0x6614958498796F80F9890CF8b8A73BeD1eA46Af7/sources/contracts/ParallaxOrbital.sol
@inheritdoc IParallax
function getFee(address strategy) external view returns (uint256) { return strategies[strategyToId[strategy]].fee; }
3,074,538
/** *Submitted for verification at Etherscan.io on 2022-03-19 */ /** *Submitted for verification at Etherscan.io on 2022-03-03 */ /** ░█████╗░██████╗░███████╗░██████╗  ██████╗░██╗███╗░░██╗░██████╗░ ██╔══██╗██╔══██╗██╔════╝██╔════╝  ██╔══██╗██║████╗░██║██╔════╝░ ███████║██████╔╝█████╗░░╚█████╗░  ██████╔╝██║██╔██╗█...
uint256 tokensToLiquify = _balances[address(this)];
function swapBack() internal lockTheSwap { uint256 tokensToLiquify = swapThreshold; uint256 amountToLiquify = tokensToLiquify .mul(liquidityFee) .div(totalFee) .div(2); uint256 amountRing = tokensToLiquify.mul(ringFee).div(totalFee); uint256 amount...
6,705,755
./full_match/432204/0x010224949cCa211Fb5dDfEDD28Dc8Bf9D2990368/sources/contracts/Portfolio.sol
Frontend function to get all the tokens in the portfolio return bytes32[] Array of symbols of the tokens/
function getTokenList() external view override returns (bytes32[] memory) { bytes32[] memory tokens = new bytes32[](tokenList.length()); for (uint256 i = 0; i < tokenList.length(); i++) { tokens[i] = tokenList.at(i); } return tokens; }
16,380,997
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, ad...
--------------------- QUESTING FUNCTIONS ---------------------
function lockToken(uint256 tokenId) public onlyQuester { _isLocked[tokenId] = true; }
5,350,930
./full_match/41/0xabc9E82EE050C1Bb6730b967fCEA1779ba37082D/sources/ERC20Bridgeable/contracts/TokenBridge.sol
REFUND ANTELOPE CALLBACK
function refundSuccessful(uint id) external whenNotPaused onlyAntelopeBridge { for(uint i = 0; i < requests.length; i++){ if(refunds[i].id == id){ refunds[i] = refunds[requests.length - 1]; emit BridgeFromAntelopeRefunded(id); refunds.pop(); ...
16,379,762
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "./CyberGorillas.sol"; import "./GrillaToken.sol"; import "./ERC721.sol"; import "./Strings.sol"; import "./RewardBoostProvider.sol"; import "./Ownable.sol"; /* ______ __ ______ _ ____ / ____/_ __/ /_ ___ ___...
Returns the accumulated staking rewards of the function caller. return The amount of GRILLA earned while staking.
function viewReward() public view returns (uint256) { return rewards[msg.sender] + rewardDifferential(msg.sender); }
11,678,888
/** *Submitted for verification at Etherscan.io on 2021-05-04 */ pragma solidity 0.6.7; abstract contract DSValueLike { function getResultWithValidity() virtual external view returns (uint256, bool); } abstract contract FSMWrapperLike { function renumerateCaller(address) virtual external; } contract OSM { ...
@notify Return the result with its validity from the FSM/
function getResultWithValidity() external view returns (uint256, bool) { (uint256 price, bool valid) = fsm.getResultWithValidity(); return (price, valid); }
2,013,207
./full_match/137/0xC0c42d148241c5b5BB38e974d40Fc9087f7F9ecD/sources/src/Facets/AllBridgeFacet.sol
Bridge tokens to another chain via AllBridge _bridgeData The bridge data struct _swapData The swap data struct _allBridgeData The AllBridge data struct
function swapAndStartBridgeTokensViaAllBridge( ILiFi.BridgeData memory _bridgeData, LibSwap.SwapData[] calldata _swapData, AllBridgeData calldata _allBridgeData ) external payable nonReentrant refundExcessNative(payable(msg.sender)) containsSourceS...
4,684,463
pragma solidity ^0.4.13; contract Receiver { function tokenFallback(address from, uint value, bytes data); } /* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function allowance(...
Set an upgrade agent that handles/ The token is not yet in a state that we could think upgrading
function setUpgradeAgent(address agent) external { if(!canUpgrade()) { revert(); } if (agent == 0x0) revert(); upgradeAgent = UpgradeAgent(agent); UpgradeAgentSet(upgradeAgent); }
72,825
pragma solidity 0.5.12; /// @title Ownable /// @dev Provide a simple access control with a single authority: the owner contract Ownable { // Ethereum address of current owner address public owner; // Ethereum address of the next owner // (has to claim ownership first to become effective owner) ad...
Recover token _oldAddress address _newAddress address File: contracts/token/ERC20.sol ERC20 interface see https://github.com/ethereum/EIPs/issues/20
interface ERC20 { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); function totalSupply() external view returns (uint); function balanceOf(address _owner) external view returns (uint); function allowan...
7,219,539
./partial_match/1/0x9c12d9b1223130B641154d8d3DB35F91D81c8dfd/sources/InBitToken.sol
Integer division of two unsigned integers truncating the quotient, reverts on division by zero./ Solidity only automatically asserts when dividing by 0 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) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; }
16,074,252
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity >=0.8.4; import "@prb/contracts/token/erc20/IErc20.sol"; import "@prb/contracts/token/erc20/SafeErc20.sol"; import "@hifi/protocol/contracts/core/balance-sheet/IBalanceSheetV2.sol"; import "@hifi/protocol/contracts/core/h-token/IHToken.sol"; import "./IFla...
Liquidates the borrower, receiving collateral at a discount. If the hypothetical repay amount is bigger than the debt amount, this could be a single-collateral multi-bond vault. Otherwise, it could be a multi-collateral single-bond vault. However, it is difficult to generalize for the multi-collateral and multi-bond si...
function liquidateBorrow( address borrower, IHToken bond, IErc20 collateral, uint256 mintedHTokenAmount ) internal returns (uint256 seizeCollateralAmount) { uint256 collateralAmount = balanceSheet.getCollateralAmount(borrower, collateral); uint256 hypotheticalRepa...
12,618,803
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "./Interfaces/IBorrowerOperations.sol"; import "./Interfaces/IStabilityPool.sol"; import "./Interfaces/IBorrowerOperations.sol"; import "./Interfaces/ITroveManager.sol"; import "./Interfaces/ISortedTroves.sol"; import "./Dependencies/LiquityBase.sol"; impo...
Internal function, used to calculcate compounded deposits and compounded front end stakes. If stake was made before a pool-emptying event, then it has been fully cancelled with debt -- so, return 0 Compute the compounded stake. If a scale change in P was made during the stake's lifetime, account for it. If more than on...
function _getCompoundedStakeFromSnapshots(uint256 initialStake, Snapshots memory snapshots) internal view returns (uint256) { uint256 snapshot_P = snapshots.P; uint128 scaleSnapshot = snapshots.scale; uint128 epochSnapshot = snapshots.epoch; if (epochSnap...
5,966,175
./full_match/4/0x842DA6d9b36b0B606c995fD73EBCF15FE9c047be/sources/SNAKE_SOCIETY.sol
Function to withdraw collected amount/
function withdraw( address _to ) public onlyOwner { uint balance = address(this).balance; require(balance > 0, "Balance should be more then zero"); payable(_to).transfer(balance); }
706,325
./partial_match/3/0x0Dec283687556aBc7ADF91A15368b4fa16aAFe8C/sources/EdcoinStake.sol
------------------------------------------------------------------------ Token holders can stake their tokens using this function tokens number of tokens to stake ------------------------------------------------------------------------ distribute the staking fee accumulated before updating the user's stake add pending...
function STAKE(uint256 tokens, address referrer) external { require(IERC20(EDC).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account"); uint256 _stakingFee = 0; if(totalStakes > 0) _stakingFee= (onePercent(tokens).mul(stakingFe...
5,246,645
./full_match/1/0xF74480d927D3D34dE74C861841FCaFA2f7701617/sources/contracts/ERC1155D.sol
xref:ROOT:erc1155.adocbatch-operations[Batched] version of {_mint}. Requirements: - `ids` and `amounts` must have the same length. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value./
function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require( ids.length == amounts.length, "ERC1155: ids and...
16,400,113
./full_match/80001/0x3aE0670970C3273eD5181B995448Cd482Db8986E/sources/machine_weth.sol
amount how much token will be needed and will be burned./ 1. For artist.
function _transferAndBurnToken(uint256 amount) private { uint256 forArtistAmount = 0; if (forArtistRate != 0) { forArtistAmount = amount.mul(forArtistRate).div(100); currencyToken.transferFrom(msg.sender, artistAccount, forArtistAmount); totalAmountForArtist = tot...
5,691,901
pragma solidity >=0.4.21 <0.6.0; contract TaskMaster { mapping (address => uint) public balances; // Balances of everyone address public owner; // contract owner /** * Contract Instanciated by owner */ constructor() public { owner = msg.sender; // save owner balances[msg.sender...
Owner gives raward to doer/
function reward(address doer, uint rewardAmount) public isOwner() hasSufficientFunds(rewardAmount) returns (bool sufficientFunds) { balances[msg.sender] -= rewardAmount; balances[doer] += rewardAmount; return sufficientFunds; }
6,400,976
./full_match/4/0x4767dd7aD034c6Db23363ac9F32cDBD5449C3424/sources/contracts/band/utils/Equation.sol
Return the number of children the given opcode node has.
function getChildrenCount(uint8 opcode) private pure returns (uint8) { if (opcode <= OPCODE_VAR) { return 0; return 1; return 2; return 3; return 4; } revert(); }
674,037
// File contracts/library/SeedRand.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.1; library SeedRand { function rand( uint256 _seed, uint256 _index ) internal pure returns (uint256 val) { unchecked { val = uint256(keccak256(abi.encodePacked( _seed, _index ))); } }...
Method to update the beginning of the reveal phase. Owner only. _newRevealOpen - New open time/
function updateRevealOpen(uint256 _newRevealOpen) external onlyOwner { require( block.timestamp < revealOpen, "Shogunate: Cannot change reveal open time when reveal is open." ); require( _newRevealOpen > block.timestamp, "Shogunate: Reveal open time cannot be set in the past." ...
12,082,284
./full_match/1/0x894BD8E5E26f4d18b9511401d0588951ce32a7A2/sources/browser/CarMastChef.sol
Safe CAR transfer function, just in case if rounding error causes pool to not have enough Cars.
function safeCarTransfer(address _to, uint256 _amount) internal { uint256 carBal = CAR.balanceOf(address(this)); if (_amount > carBal) { CAR.transfer(_to, carBal); CAR.transfer(_to, _amount); } }
8,326,853
./full_match/5/0x94eDc4205Af110CF972D39fc642373FdEfE29d6C/sources/src/OsoMaximo.sol
Logged when the user of an NFT is changed or expires is changed
interface IERC4907 { event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires); function setUser(uint256 tokenId, address user, uint64 expires) external; function userOf(uint256 tokenId) external view returns(address); function userExpires(uint256 tokenId) external view returns(...
1,943,003
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "sol-temple/src/tokens/ERC721.sol"; import "sol-temple/src/utils/Auth.sol"; import "sol-temple/src/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /** * @titl...
Retrieves whether `user_` is authorized to call with `data_`.
function isAuthorized(address user_, bytes memory data_) public view returns (bool) { return user_ == _owner || _isAuthorized[user_][data_]; }
5,470,698
./full_match/80001/0x1C8F41b79B934Cb7AECdb6835D00c4520554b9f3/sources/@openzeppelin/contracts/governance/Governor.sol
Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`/ Case 0-9 Case A-F Case a-f Else: not a hex char
function _tryHexToUint(bytes1 char) private pure returns (bool, uint8) { uint8 c = uint8(char); unchecked { if (47 < c && c < 58) { return (true, c - 48); } else if (64 < c && c < 71) { return (true, c - 55); } ...
9,511,672
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import { ICollectionFactory } from "../interfaces/ICollectionFactory.sol"; import { ICollection } from "../interfaces/ICollection.sol"; import { ICollectionCloneable } from "../interfaces/ICollectionCloneable.sol"; import { ICollectionNFTCloneableV1 } from "../int...
This function is used by the Factory to verify the format of ecosystem settings _settings ABI encoded ecosystem settings data. This expected encoding for ecosystem name 'NFT_v1' is the following: 'uint16' hashesDAOMintFeePercent - The percentage of mint fees owable to HashesDAO. 'uint16' hashesDAO...
function verifyEcosystemSettings(bytes memory _settings) external pure override returns (bool) { ( uint16 _settingsHashesDAOMintFeePercent, uint16 _settingsHashesDAORoyaltyFeePercent, uint16 _settingsMaximumCollectionRoyaltyPercent ) = abi.decode(_settings, (uint1...
9,942,437
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Get operating status of contract return A bool that is the current operating status/
function isOperational() external returns(bool) { return operational; }
2,474,508
pragma solidity >0.5.4; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; import "@daostack/arc/contracts/controller/Avatar.sol"; import "../../contracts/token/GoodDollar.so...
Updates bonding curve based on _addTokenSupply and new minted amount _token The reserve token _addTokenSupply Amount of token added to supply return How much to mint in order to keep price in bonding curve the same/
function mintInterest(ERC20 _token, uint256 _addTokenSupply) public onlyOwner returns (uint256) { if (_addTokenSupply == 0) { return 0; } uint256 toMint = calculateMintInterest(_token, _addTokenSupply); ReserveToken storage reserveToken = reser...
12,639,566
./full_match/80001/0x83919B3AaB05390ef1cFe0e34426Eb2bEEC55CF5/sources/contracts/Contract.sol
uint number = allConfessions.length; confession memory newConfession = confession(_confession);
function createConfession( string calldata id, string calldata _confession ) external { require(checkUserExists(msg.sender), "Create an account first"); require(checkChannelExists(id), "User is not registered"); require( isJoinedChannel(msg.sender, id), ...
9,504,019
./partial_match/1/0x901e88eFd9a4E47e5140d0356FC1cAFdCb8BfEd0/sources/YT.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingF...
15,466,341
pragma solidity ^0.4.19; // Turn the usage of callcode contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); ...
do not allow to send money to this contract...
function() external payable { revert(); }
353,086
./full_match/8453/0x0c9034b92351cF8f067379a1fFA4fa35f5AF9dCC/sources/lib/optimism/packages/contracts-bedrock/src/L2/L2StandardBridge.sol
@custom:legacy Internal function to initiate a withdrawal from L2 to L1 to a target account on L1. _l2Token Address of the L2 token to withdraw. _from Address of the withdrawer. _to Recipient account on L1. _amount Amount of the L2 token to withdraw. _minGasLimit Minimum gas limit to use ...
function _initiateWithdrawal( address _l2Token, address _from, address _to, uint256 _amount, uint32 _minGasLimit, bytes memory _extraData ) internal { if (_l2Token == Predeploys.LEGACY_ERC20_ETH) { _initiateBridgeETH(_from, _to, _amount, _minGa...
11,538,257
contract Owned{ address owner; function Owned() { owner = msg.sender; } modifier onlyOwner() { if(msg.sender!=owner) throw; _ } function getOwner() view returns (address) { return owner; } function changeOwner(address _newOwner) onlyOwner { owner = _newOwner; } } // Copyright 201...
input The ZK Proof to verify
function verifyShielding(bytes proof, bytes32 send_nf, bytes32 cm, uint64 value) view external returns (bool) { bytes32 buffer = verifyShieldingContract.run(proof, send_nf, cm, value); byte b = buffer[0]; if (b == 0x00) { return false; return true; } a...
7,310,854
// File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.5.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 a...
Calculates how a rebase would look if it was triggered now./ only rebase if there is a 5% difference between the price of XAU and AUSC AUSC is too expensive, this is a positive rebase increasing the supply Cannot underflow as desiredSupply > currentSupply, the result is positive delta = (desiredSupply / currentSupply) ...
function calculateRealTimeRebase() public view returns (uint256, uint256) { uint256 highThreshold = averageXAU.mul(105).div(100); uint256 lowThreshold = averageXAU.mul(95).div(100); if (averageAUSC > highThreshold) { uint256 currentSupply = IERC20(ausc).totalSupply(); uint256 desiredSupply = ...
9,868,693
pragma solidity ^0.6.0; //import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; //import "@openzeppelin/contracts/utils/Pausable.sol"; //import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interface/cToken.sol"; import "./Pausable.sol"; contract PFA...
Gets balance of underlying asset return uint/uint balanceERC20 = address(c).balanceOf(address(this));uint balance = balanceERC20.mul(address(c).exchangeRateCurrent());
function getBalance() public returns(uint){ uint balance = c.balanceOfUnderlying(address(this)); return balance; }
921,435
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view retu...
Select a token to remove from treasury discovery --------------------
function startRemoveToken(address _address) external onlyGovernance { _timelockStart = now; _timelockType = 3; _timelock_address = _address; }
10,720,026