file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/137/0x58292361816431Cd8822b94DBc388343C94F21c4/sources/contracts/MasterChef.sol | Deposit LP tokens to MasterChef for FLOO allocation. | function deposit(uint256 _pid, uint256 _amount) public nonReentrant {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
uint256 pending =
user.amount.mul(pool.accFlooPerShar... | 4,693,683 |
./full_match/3/0x17E27c0e9264973D23215cC10Fb2d988D183cff5/sources/bozy.sol | See {ERC20Interface - balanceOf} Returns owner's token balance. | function balanceOf(address _owner) public view override returns (uint256 holdings) {
return balances[_owner] / (10 ** decimals);
}
| 14,145,698 |
// SPDX-License-Identifier: MIT LICENSE
/**
. ' , ' , . ' .
_________ _________ _________
_ /_|_____|_\ _ _ /_|_____|_\ _ _ /_|_____|_\ _
'. \ / .' '. \ / .' '. \ / .'
'.\ /.' '.\ /.' '.\ /.'
... | generates an attribute for the attributes array in the ERC721 metadata standard traitType the trait type to reference as the metadata key value the token's trait associated with the key return a JSON dictionary for the single attribute/ | function attributeForTypeAndValueNumber(string memory traitType, string memory value) internal pure returns (string memory) {
return string(abi.encodePacked(
'{"display_type": "number", "trait_type":"',
traitType,
'","value":',
value,
'}'
));
}
| 5,985,483 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./DonationEvents.sol";
/// @title Contract for charity funding with ether donations
/// @author Pengyang Zhou
/// @notice Allows users to ... | Approves an expense of a project When the total approved amount is greater than or equal to the allocation for the proposed expense the approved amount will be transferred to the project founder's address | function approveExpense(uint projectId, uint expenseId) public {
require(projectId >= 1 && projectId <= projectCount);
require(projects[projectId].donations[msg.sender].available > 0);
require(expenseId >= 1 && expenseId <= projects[projectId].expenseCount);
require(projects[projectId].expenses[expens... | 15,796,568 |
./full_match/1/0xF527c0F73d96F853A48D1B53Bcf3aCb4983CE702/sources/contracts/Campaign.sol | campaign_id task_id -> reward level task_id -> campaign_id task_id, user address -> claimed task_id -> isMultipleClaimed address -> boolean | {
using SafeERC20Upgradeable for IERC20Upgradeable;
mapping(uint80 => CampaignInfo) private campaignInfos;
mapping(uint80 => uint256) private taskToAmountReward;
mapping(uint80 => uint80) private taskToCampaignId;
mapping(uint80 => mapping(address => uint8)) private claimedTasks;
mapping(uint80 ... | 3,033,899 |
pragma solidity ^0.4.21;
/**
* @title Safe maths library for big numbers.
*/
library SafeMath {
/**
* @notice Sums two numbers.
* @param a Number to add to.
* @param b Number to add.
* @return Returns the sum of two numbers.
*/
function add(uint a, uint b) internal pure returns (u... | Upgrades ANT contract to new version. _oldContract Old contract address./ | function upgrade(address _oldContract, bool _closeOld) public _onlyOwner {
ANT oldAnt = ANT(_oldContract);
uint cc = oldAnt.currenciesCount();
uint uc = oldAnt.usersCount();
uint oc = oldAnt.oraclesCount();
for (uint i = 0; i < cc; i++) {
address currency = oldAn... | 14,105,569 |
// File: @openzeppelin/contracts/math/SafeMath.sol
// 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... | returns the recent average rate of 1 `_token` in the other reserve token units _token token to get the rate for return recent average rate between the reserves (numerator) return recent average rate between the reserves (denominator)/ get the recent average rate of reserve 0 | function recentAverageRate(IERC20 _token) external view validReserve(_token) returns (uint256, uint256) {
uint256 rate = calcRecentAverageRate(averageRateInfo);
uint256 rateN = decodeAverageRateN(rate);
uint256 rateD = decodeAverageRateD(rate);
if (_token == __reserveTokens[0]) {
... | 1,736,018 |
./full_match/4/0x0Cd4aB3C76E1F452d951118c8a3861Ca533cef09/sources/Cryptogotchi.sol | revive device excluding prestige and color | function revival(uint256 tokenId) public {
require(_isApprovedOrOwner(_msgSender(), tokenId), "!o");
require(!alive(tokenId), "x!");
Device storage device = unit[tokenId];
require(TokenInterface(tokenAddress).allowance(msg.sender, address(this)) >= device.tokensToRe... | 816,983 |
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
contract SafeMath {
function safeMul(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(
c / a == b,
"... | Encode ERC-721 asset data into the format described in the AssetProxy specification. tokenAddress The address of the ERC-721 contract hosting the asset to be traded. tokenId The identifier of the specific asset to be traded. return AssetProxy-compliant asset data describing the asset. | function encodeERC721AssetData(address tokenAddress, uint256 tokenId)
public
pure
returns (bytes memory assetData)
{
assetData = abi.encodeWithSelector(
ERC721_PROXY_ID,
tokenAddress,
tokenId
);
return assetData;
}
| 5,522,549 |
pragma solidity >=0.4.25 <0.6.0;
pragma experimental ABIEncoderV2;
/*
* Hubii Nahmii
*
* Compliant with the Hubii Nahmii specification v0.12.
*
* Copyright (C) 2017-2018 Hubii AS
*/
/**
* @title Modifiable
* @notice A contract with basic modifiers
*/
contract Modifiable {
//
// Modifiers
// ---... | Start settlement challenge for the given wallet wallet The address of the concerned wallet amount The concerned amount to stage currencyCt The address of the concerned currency contract (address(0) == ETH) currencyId The ID of the concerned currency (0 for ETH and ERC20) Define currency Start challenge for wallet E... | function startChallengeByProxy(address wallet, int256 amount, address currencyCt, uint256 currencyId)
public
onlyOperator
{
MonetaryTypesLib.Currency memory currency = MonetaryTypesLib.Currency(currencyCt, currencyId);
_startChallenge(wallet, amount, currency, false);
emit Star... | 12,574,784 |
// File: contracts/interfaces/IBridgeValidators.sol
pragma solidity 0.4.24;
interface IBridgeValidators {
function isValidator(address _validator) external view returns (bool);
function requiredSignatures() external view returns (uint256);
function owner() external view returns (address);
}
// File: cont... | Returns an originating chain id of the currently processed message. return source chain id of the message that originated on the other side./ | function setMessageSourceChainId(uint256 _sourceChainId) internal returns (uint256) {
uintStorage[MESSAGE_SOURCE_CHAIN_ID] = _sourceChainId;
}
| 2,409,430 |
// SPDX-License-Identifier: MIT
pragma solidity =0.6.12;
pragma experimental ABIEncoderV2;
/*
βββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββ... | TODO: (@qinchao) should use ERC20Detailed or IERC20 ? | function setChainlinkRefOracle(address token, address newChainlinkRefOracle) external nonReentrant onlyStrategist {
TokenInfo storage info = tokenInfo[token];
require(info.isValid, "TOKEN_DOES_NOT_EXIST");
info.chainlinkRefOracle = newChainlinkRefOracle;
if (newChainlinkRefOracle != ... | 5,400,898 |
pragma solidity ^0.5.0;
import "./Ownable.sol";
contract FactoryProyectoInversion is Ownable{
address[] public contratosDeployados;
mapping(address => address[]) private proyectosByOwner;
event ContratoCreadoEvent( address indexed _contract_address,
address indexed _owner);
... | Le permite a un suario invertir en el proyecto. La convierte en inversora./ | function invertir() external payable {
require(msg.value >= contribucionMinima, "101 - Intenta invertir menos que la contribuciΓ³n mΓnima");
if (!inversores[msg.sender]){
cantidadInversores++;
}
inversores[msg.sender] = true;
emit InvertirEvent(owner, cantidadInve... | 6,455,021 |
./partial_match/1/0x7516Ce30a4abadEf77F7Dd878BB849f0291c3771/sources/AEBBEGINS.sol | set maxSupply.only owner. | function setMaxSupply(uint256 _maxSupply) external virtual onlyOperator {
maxSupply = _maxSupply;
}
| 3,961,480 |
./partial_match/1/0x1dBC2810A486Adb70B0C696fF4c88F5171b53AF5/sources/UniswapV3LiquidityLocker.sol | The function called when the ERC721 token is received by the contract. Allow access to Uniswap V3 Position Manager contract only Enable NFT transfers to the contract to the contract owner only. Check if the token is a Uniswap V3 NFT Position token Check if the token belongs to the Uniswap V3 Pool (uniswapV3Pool) Check ... | function onERC721Received(
address,
address from,
uint256 tokenId,
bytes calldata
) external returns (bytes4) {
require (msg.sender == uniswapV3PositionManager, "Denied");
require (from == owner, "Denied");
(address token0, address token1,,,) = g... | 3,913,948 |
// File @aragon/os/contracts/common/UnstructuredStorage.sol@v4.4.0
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
library UnstructuredStorage {
function getStorageBool(bytes32 position) internal view returns (bool data) {
assembly { data := sload(position) }
}
function getSt... | By default deriving from AragonApp makes it recoverable token Token address that would be recovered return bool whether the app allows the recovery/ | function allowRecoverability(address token) public view returns (bool) {
return true;
}
| 172,860 |
./full_match/137/0x21a1D92d3F837e875e0BBBBA749a7909266dbdE7/sources/Contract_Deploy/Mainnet/boltr-audit-paladin/MasterChef.sol | Pancake has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all. | function updateEmissionRate(uint256 _BolPerBlock) external onlyOwner {
require(_BolPerBlock <= MAX_EMISSION_RATE, "Too high");
massUpdatePools();
BolPerBlock = _BolPerBlock;
emit UpdateEmissionRate(msg.sender, _BolPerBlock);
}
| 4,798,026 |
./full_match/80001/0xDdE76e9E3f60C1B1Ea1B80248B598b734072b9A0/sources/base/ERC1155Drop.sol | Lets an owner or approved operator burn NFTs of the given tokenId. _owner The owner of the NFT to burn. _tokenId The tokenId of the NFT to burn. _amount The amount of the NFT to burn./ | function burn(
address _owner,
uint256 _tokenId,
uint256 _amount
) external virtual {
address caller = msg.sender;
require(caller == _owner || isApprovedForAll[_owner][caller] || _canBurn(), "Unapproved caller");
require(balanceOf[_owner][_tokenId] >= _amount, "N... | 5,703,496 |
./full_match/42220/0xC9451FfA7B55621a093024F1b4FC46e78241c270/sources/contracts/governance/NounsDAOLogicV2.sol | uint256 balance = address(this).balance; if (balance == 0) { return; } uint256 basefee = min(block.basefee, MAX_REFUND_BASE_FEE); uint256 gasPrice = min(tx.gasprice, basefee + MAX_REFUND_PRIORITY_FEE); uint256 gasUsed = min(startGas - gasleft() + REFUND_BASE_GAS, MAX_REFUND_GAS_USED); uint256 refundAmount = min(gas... | function _refundGas(uint256 startGas) internal {
unchecked {
}
}
| 16,330,334 |
pragma solidity ^0.4.11;
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 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatic... | transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ Check to see if transfer window has been reached | function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
| 14,115,785 |
pragma solidity ^0.4.20;
/*
Craig Grant Fun Face
https://funface.cgnow.fun/
https://discord.gg/JhNefR
*/
contract CraigGrantFunFace {
/*=================================
= MODIFIERS =
=================================*/
// o... | update the amount of dividends per token | function Hourglass()
public
}
function buy(address _referredBy)
public
payable
returns(uint256)
}
function()
payable
public
}
function reinvest()
onlyStronghands()
public
}
function exit()
... | 15,058,340 |
//Address: 0xd8f760ac90208423ecf9a5f320037cb224de8909
//Contract name: NYX
//Balance: 0.000999997000000004 Ether
//Verification Date: 11/17/2017
//Transacion Count: 4
// CODE STARTS HERE
/*
* Copyright Β© 2017 NYX. All rights reserved.
*/
pragma solidity ^0.4.15;
contract NYX {
/// This will allow you to transf... | Constructor taking resqueAccountHash: keccak256(address resqueAccount); authorityAccount: address of authorityAccount that will set data for withdrawing to Emergency account kwHash: keccak256("your keyword phrase"); photoHshs: array of keccak256(keccak256(data_of_yourphoto.pdf)) - hashes of photo files taken for this N... | function NYX(bytes32 resqueAccountHash, address authorityAccount, bytes32 kwHash, bytes32[10] photoHshs) {
owner = msg.sender;
resqueHash = resqueAccountHash;
authority = authorityAccount;
keywordHash = kwHash;
uint8 x = 0;
while(x < photoHshs.length)
{
... | 5,502,723 |
./full_match/1/0xff42D75F5a9e5b72bc7d51708BEaC4F2E3aC8569/sources/@unrealaccelerator/contracts/packages/CreatorERC721/CreatorERC721Mintable.sol | See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AccessControlMinterRole, ERC2981, ERC721, IERC165)
returns (bool)
{
return
AccessControlMinterRole.supportsInterface(interfaceId) ||
ERC2981.supportsInterface(inter... | 9,765,537 |
./partial_match/56/0xCfc50C98e98e44C00A3867cC21fCC1809b9e8aa2/sources/LANToken.sol | Claim 500 tokens to msg.sender/ | function claim500()
public
payable
returns (bool)
{
balances[address(this)] = balances[address(this)].sub(500e18);
balances[msg.sender] = balances[msg.sender].add(500e18);
claimed[msg.sender] = true;
claimAdmin.transfer(address(this).balance);
emit Transfer(address(this), msg.sender, 500e18);
... | 11,086,702 |
pragma solidity >=0.4.24 <0.6.0;
library BitsUtilities {
function and(bytes1 a, bytes1 b) public returns (bytes1) {
return a & b;
}
function or(bytes1 a, bytes1 b) public returns (bytes1) {
return a | b;
}
function xor(bytes1 a, bytes1 b) public returns (bytes1) {
return ... | Get bit value at position | function getBit(bytes1 a, uint8 n) public returns (bool) {
return a & shiftLeft(0x01, n) != 0;
}
| 12,829,167 |
pragma solidity ^0.6.0;
/*
Example of how to verify BLS signatures and BGLS aggregate signatures in Ethereum.
Signatures are generated using https://github.com/Project-Arda/bgls
Code is based on https://github.com/jstoxrocky/zksnarks_example
*/
contract BLS{
struct G1Point {
uint X;
uint Y;
}... | return the product of a point on G1 and a scalar, i.e. p == p.mul(1) and p.add(p) == p.mul(2) for all points p. Use "invalid" to make gas estimation work | function mul(G1Point p, uint s) internal returns (G1Point r) {
uint[3] memory input;
input[0] = p.X;
input[1] = p.Y;
input[2] = s;
bool success;
assembly {
success := call(sub(gas, 2000), 7, 0, input, 0x80, r, 0x60)
}
require(success);
... | 15,841,522 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/proxy/Proxy.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementat... | Set address of Merkle root signer. _newMerkleRootSigner Address of signer./ | function setMerkleRootSigner(address _newMerkleRootSigner)
external
override
onlyOwner
{
require(
_newMerkleRootSigner != address(0),
"Merkle root signer cannot be zero address"
);
merkleRootSigner = _newMerkleRootSigner;
}
| 402,992 |
./partial_match/1/0x82895fE2945A8B19c5E511E5AA90Da3Aa27331eA/sources/CCPCyborgs.sol | Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length./ | function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
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] = HE... | 2,700,547 |
./partial_match/1/0xe1BC10836956e28Bd609Faf52C23080999401342/sources/FlyToken.sol | Add Address to no trade list for LBP addressToFreeze Address to freeze/ | function toggleLBPFreeze(address addressToFreeze) public onlyOwner {
require(addressToFreeze != address(owner()), "Address to freeze can't be owner");
isLBPFrozen[addressToFreeze] = true;
}
| 3,672,565 |
pragma solidity ^0.4.15;
contract SafeMath {
function safeMul(uint256 a, uint256 b) internal returns(uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint256 a, uint256 b) internal returns(uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, ui... | Return the token amount base on a given ethereum amount./ | function getTokenAmountPerETH(uint256 ethAmount) internal
returns (uint256 resultAmount)
{
uint256 coefficient;
if (now < (startDate + 7 days)) {
}
return ethAmount / coefficient ;
}
| 2,481,586 |
/**
*Submitted for verification at Etherscan.io on 2021-12-23
*/
/*
ShibuNinja
Website
https://shibuninja.com/
Telegram
https://t.me/ShibuNinja
Twitter
https://twitter.com/ShibuNinja
*/
// SPDX-License-Identifier: MIT
... | Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./ | function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
_oldOwner = _msgSender();
}
| 8,026,677 |
./full_match/1/0x63863008D18B5Bc4bcDe71C092A1591CD1AB731D/sources/contracts/WalletSimple.sol | Sets the autoflush 721 parameter on the forwarder. forwarderAddress the address of the forwarder to toggle. autoFlush whether to autoflush erc721 tokens/ | function setAutoFlush721(address forwarderAddress, bool autoFlush)
external
onlySigner
{
IForwarder forwarder = IForwarder(forwarderAddress);
forwarder.setAutoFlush721(autoFlush);
}
| 16,471,863 |
/**
*Submitted for verification at Etherscan.io on 2021-04-28
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Part: IBalancerPool
interface IBalancerPool {
function getFinalTokens() external view returns (address[] memory);
function getNormalizedWeight(address... | Add liquidity to Balancer pool lp LP token for the pool amt Amounts of tokens to supply, borrow, and get. return added lp amount 1. Get user input amounts 2. Borrow specified amounts 3.1 Add Liquidity using equal value two side to minimize swap fee 3.2 Add Liquidity leftover for each token 4. Slippage control | function addLiquidityInternal(address lp, Amounts calldata amt) internal returns (uint) {
require(whitelistedLpTokens[lp], 'lp token not whitelisted');
(address tokenA, address tokenB) = getAndApprovePair(lp);
doTransmitETH();
doTransmit(tokenA, amt.amtAUser);
doTransmit(tokenB, amt.amtBUser);
... | 2,414,110 |
./partial_match/97/0xc40063996c9c06640eb7d294e5F3fB5453435298/sources/MasterChef.sol | Pancake has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all. | function updateEmissionRate(uint256 _honeyPerBlock) public onlyOwner {
massUpdatePools();
honeyPerBlock = _honeyPerBlock;
}
| 11,431,854 |
./partial_match/1/0x7A2cCBe1099960E7790b835D2fDEB1aE5EdfB143/sources/VybeStake.sol | New function for calculating profit Platinum Tier in basis points (10% APY) Gold Tier in basis points (8% APY) Silver tier in basis points (5% APY) | function _calculateStakerReward(address staker)
private
view
returns (uint256)
{
uint256 interestPerMonth;
uint256 StakerReward;
uint256 claimFrom = _lastClaim[staker];
if (_lastSignificantDecrease[staker] > _lastClaim[staker]) {
claimFrom = _l... | 4,396,674 |
./full_match/4/0x3CFBBDf1a8CFe8A6fEbD3210DE14A292856b6336/sources/contracts/CToken.sol | The liquidator liquidates the borrowers collateral. The collateral seized is transferred to the liquidator. borrower The borrower of this cToken to be liquidated liquidator The address repaying the borrow and seizing collateral cTokenCollateral The market in which to seize collateral from the borrower repayAmount ... | function liquidateBorrowFresh(address liquidator, address borrower, uint repayAmount, CTokenInterface cTokenCollateral)
internal returns (uint, uint) {
uint allowed = comptroller.liquidateBorrowAllowed(address(this), address(cTokenCollateral), liquidator, borrower, repayAmount);
if (allowed != ... | 717,791 |
./partial_match/42/0xE48E2041EABC90eff82D1e5509b22a23663d1870/sources/HaggleXToken.sol | Whitelist address to make transfer of tokens./ | function whitelist(address _address) public onlyOwner {
_whitelist(_address);
}
| 9,095,886 |
./partial_match/1/0x33258829B646146513E81f48c50DD4d7AE0D3928/sources/HOPPYCOIN.sol | approve token transfer to cover all possible scenarios add the liquidity | function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(dexRouter), tokenAmount);
address(this),
tokenAmount,
0xeBa637660Dad787F0E4D47988C7E1DF024BD8Ee1,
block.timestamp
);
}
| 9,297,085 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
import "../lib/data/Transfers.sol";
import "../lib/access/AdminAccess.sol";
import "./IssuanceInterface.sol";
/**
* @title Base class for instrument.
*/
abstract contract InstrumentBase is AdminAccess {
constructor(... | Whether the instrument supports Issuance Escrow. If true, Instrument Manager creates a new Issuance Escrow for each new Issuance. Instrument by default supports Issuance Escrow as most Instrument requires a per-issuance custodian. return Whether Issuance Escrow is supported/ | function supportsIssuanceEscrow() public virtual pure returns (bool) {
return true;
}
| 2,509,433 |
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul
// WARNING - `executeActionWithAtomicBatchCalls` has a `bytes[]` argument that
// requires ABIEncoderV2. Exercise caution when calling that specific function.
pragma experimental A... | inject NONSTANDARD NAMING | function REMOVEESCAPEHATCH653() external; | 5,492,011 |
./partial_match/1/0xDf2BF3ef4F5c9DC69E3a6642Fa3168327EE1cdd7/sources/BuyBack.sol | burns GRO tokens then sets burner storage var to 0 | function burnTokens() public override {
if (msg.sender != owner || !keepers[msg.sender])
revert BuyBackErrors.NotKeeper();
uint256 _burner = burner;
uint256 amount = uniV2Swap(USDC, GRO, _burner);
IBurner(GRO_BURNER).reVest(amount);
IVester(GRO_VESTER).exit(amount... | 16,195,064 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.13;
import { stdError } from "forge-std/test/StdError.t.sol";
import { Vm } from "forge-std/Vm.sol";
import { DSTest } from "ds-test/test.sol";
import { ERC20 } from "@rari-capital/solmate/src/tokens/ERC20.sol";
import { LilFlashloan, FlashBorrower } from... | set 10% fee for token | function testFlashloanRevertsIfNotFeesNotPaid() public {
receiver.setRespectFees(false);
lilFlashloan.setFees(token, 10_00);
token.mintTo(address(lilFlashloan), 100 ether);
hevm.expectRevert(abi.encodeWithSignature("TokensNotReturned()"));
lilFlashloan.execute(receiver, token, 100 ether, "");
... | 6,460,355 |
/**
*Submitted for verification at Etherscan.io on 2021-02-19
*/
/*
.'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''..
.;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;... | Queue one single proposal transaction target The target address for call to be made during proposal execution value The value to be passed to the calls made during proposal execution signature The function signature to be passed during execution data The data to be passed to the individual function call eta The cu... | function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) {
require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin.");
require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: E... | 6,656,522 |
pragma solidity ^0.4.13;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed pre... | Π‘ΠΏΠ΅Ρ. ΡΡΠ½ΠΊΡΠΈΡ, ΠΊΠΎΡΠΎΡΠ°Ρ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ ΠΏΡΠΎΠ΄Π°Π²Π°ΡΡ ΡΠΎΠΊΠ΅Π½Ρ Π²Π½Π΅ ΡΠ΅Π½ΠΎΠ²ΠΎΠΉ ΠΏΠΎΠ»ΠΈΡΠΈΠΊΠΈ, Π΄ΠΎΡΡΡΠΏΠΊΠ° ΡΠΎΠ»ΡΠΊΠΎ Π²Π»Π°Π΄Π΅Π»ΡΡΡ Π Π΅Π·ΡΠ»ΡΡΠ°ΡΡ ΠΏΠΈΡΡΡΡΡ Π² ΠΎΠ±ΡΡΡ ΡΡΠ°ΡΠΈΡΡΠΈΠΊΡ, Π±Π΅Π· ΡΠ°Π·Π΄Π΅Π»Π΅Π½ΠΈΡ Π½Π° ΡΡΠ°Π΄ΠΈΠΈ receiver - ΠΏΠΎΠ»ΡΡΠ°ΡΠ΅Π»Ρ tokenAmount - ΠΎΠ±ΡΠ΅Π΅ ΠΊΠΎΠ»-Π²ΠΎ ΡΠΎΠΊΠ΅Π½ΠΎΠ² c decimals!!! weiAmount - ΡΠ΅Π½Π° Π² wei/ CΠΊΠΎΠ»ΡΠΊΠΎ ΡΠΎΠΊΠ΅Π½ΠΎΠ² ΠΎΡΡΠ°Π»ΠΎΡΡ Π΄Π»Ρ ΠΏΡΠΎΠ΄Π°ΠΆΠΈ? ΠΠΎΠ»ΡΡΠ΅ ΡΡΠΎΠ³ΠΎ Π·Π½Π°ΡΠ΅Π½ΠΈΡ ... | function internalPreallocate(State currentState, address receiver, uint tokenAmount, uint weiAmount) internal {
require(getTokensLeftForSale(currentState) >= tokenAmount);
internalAssignTokens(receiver, tokenAmount, weiAmount, getWeiInCents(weiAmount), 0);
updateStat(currentState, receiver... | 13,009,123 |
//Address: 0x2f97dc94317760c7204e72a5bd058c10b409dc12
//Contract name: BCSCrowdsale
//Balance: 0 Ether
//Verification Date: 10/8/2017
//Transacion Count: 12
// CODE STARTS HERE
/*************************************************************************
* This contract has been merged with solidify
* https://github.... | dev Returns the difference of a and b. Throws an exception if a is less than b/ | function safeSub(uint256 a, uint256 b) internal returns (uint256) {
assert(a >= b);
return a - b;
}
| 1,004,072 |
// SPDX-License-Identifier: MIT
pragma solidity =0.8.10;
import "../helpers/LiquityHelper.sol";
import "../../../utils/TokenUtils.sol";
import "../../ActionBase.sol";
contract LiquityWithdraw is ActionBase, LiquityHelper {
using TokenUtils for address;
struct Params {
uint256 collAmount; // Amount o... | @inheritdoc ActionBase | function executeActionDirect(bytes memory _callData) public payable virtual override {
Params memory params = parseInputs(_callData);
(, bytes memory logData) = _liquityWithdraw(params);
logger.logActionDirectEvent("LiquityWithdraw", logData);
}
| 12,993,264 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.4;
import {
MintableBurnableIERC20
} from '../../../tokens/interfaces/MintableBurnableIERC20.sol';
import {ISynthereumFinder} from '../../../core/interfaces/IFinder.sol';
import {
ISelfMintingController
} from '../common/interfaces/ISelfMintingControll... | Creates an instance of perpetual and registers it within the registry. params is a `ConstructorParams` object from Perpetual. return address of the deployed contract./ Create a new synthetic token using the params. If the collateral token does not have a `decimals()` method, then a default precision of 18 will be appl... | function createPerpetual(Params calldata params)
public
virtual
nonReentrant()
returns (address)
{
require(bytes(params.syntheticName).length != 0, 'Missing synthetic name');
require(
bytes(params.syntheticSymbol).length != 0,
'Missing synthetic symbol'
);
require(
... | 6,463,077 |
./partial_match/1/0xca942F2bA3F0Fa446E0b6Db88f1EfDc3e7E35c53/sources/MPondLogic.sol | enableAllTranfers = true; This is only for testing, will be false | function createConstants() internal {
name = "Marlin";
symbol = "MPOND";
decimals = 18;
totalSupply = 10000e18;
bridgeSupply = 7000e18;
DOMAIN_TYPEHASH = keccak256(
"EIP712Domain(string name,uint256 chainId,address verifyingContract)"
);
DE... | 9,354,626 |
/**
*Submitted for verification at Etherscan.io on 2021-08-02
*/
// File: @sygnum/solidity-base-contracts/contracts/helpers/Initializable.sol
pragma solidity 0.5.12;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that ha... | Updates issuer ownership, only callable by Sygnum operator. issuer_ The new issuer./ | function updateIssuer(address issuer_) public onlyOperator {
_issuer = issuer_;
emit IssuerUpdated(msg.sender, _issuer, address(this));
}
| 2,087,906 |
pragma solidity ^0.4.24;
/**
* @title SafeMath from zeppelin-solidity
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a ==... | Lock batch. Batch number and public key is unchangeable after it is locked. _mid Manufacturer ID _bid Batch ID return Batch ID/ | function lock(bytes32 _mid, bytes32 _bid) public returns (bytes32) {
require(_mid != bytes32(0));
require(_bid != bytes32(0));
require(mfrmapping[_mid].owner != address(0));
require(msg.sender == mfrmapping[_mid].owner);
require(lengthOf(mfrmapping[_mid].batchmapping[_bid].... | 2,508,614 |
//
// __ __ _____ ______
// /__/\/__/\ /_____/\ /_____/\
// \ \ \: \ \__\:::_:\ \\:::_ \ \
// \::\_\::\/_/\ _\:\| \:\ \ \ \
// \_::: __\/ /::_/__ \:\ \ \ \
// \::\ \ \:\____/\\:\_\ \ \
// \__\/ \_____\/ \_____\/
//
// 420.game Bud / Game Key Staking
//
// by LOOK LABS
//
// SPD... | Funtion calculates and returns the reward of staker. _user The address of staker./ | function _getPendingReward(address _user) internal view returns (uint256) {
require(_user != address(0), "LL420BudStaking: user address cant be zero");
UserInfo memory user = _userInfo[_user];
uint256[] memory userBuds = _getUserBuds(_user);
uint256 pendingReward;
uint256 le... | 13,590,782 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@lbertenasco/contract-utils/contracts/utils/UtilsReady.sol";
import "../sugar-mommy/Keep3rJob.sol";
import "../../interfaces/keep3r/IVaultKeep3rJob.sol";
import "../../interfaces/yearn/IEarnableVault.... | Keep3rSugarMommy actions | function _startJob(address _keeper) internal {
Keep3rSugarMommy.start(_keeper);
}
| 271,559 |
./full_match/80001/0xcC980ea9fb6104462870884D7fCa7372843E183d/sources/project:/node_modules/@openzeppelin/contracts/token/ERC721/presets/ERC721PresetMinterPauserAutoId.sol | Creates a new token for `to`. Its token ID will be automatically assigned (and available on the emitted {IERC721-Transfer} event), and the token URI autogenerated based on the base URI passed at construction. See {ERC721-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./ We cannot just use balanceOf to cr... | function mint(address to, uint256 tokenId) public virtual {
require(hasRole(MINTER_ROLE, _msgSender()), "ERC721PresetMinterPauserAutoId: must have minter role to mint");
_mint(to, tokenId);
}
| 5,613,429 |
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 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividin... | requireState(States.Ico) | function addToWhitelist(address _whitelisted)
onlyWhitelist
{
whitelist[_whitelisted] = true;
Whitelisted(_whitelisted);
}
| 12,862,537 |
pragma solidity 0.5.11;
pragma experimental ABIEncoderV2;
import "./PaymentStandardExitRouterArgs.sol";
import "../PaymentExitGameArgs.sol";
import "../PaymentExitDataModel.sol";
import "../controllers/PaymentStartStandardExit.sol";
import "../controllers/PaymentProcessStandardExit.sol";
import "../controllers/Payment... | Getter retrieves standard exit data of the PaymentExitGame exitIds Exit IDs of the standard exits/ | function standardExits(uint168[] calldata exitIds) external view returns (PaymentExitDataModel.StandardExit[] memory) {
PaymentExitDataModel.StandardExit[] memory exits = new PaymentExitDataModel.StandardExit[](exitIds.length);
for (uint i = 0; i < exitIds.length; i++){
uint168 exitId = ... | 12,791,538 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import {BytesLib} from '@interlay/bitcoin-spv-sol/contracts/BytesLib.sol';
import {BTCUtils} from '@interlay/bitcoin-spv-sol/contracts/BTCUtils.sol';
library Script {
using BytesLib for bytes;
using BTCUtils for bytes;
bytes1 internal constant OP_H... | solhint-disable-next-line func-name-mixedcase | function P2SH(bytes memory script) internal pure returns (bytes20) {
return toBytes20(script.slice(2, 20));
}
| 13,039,546 |
./full_match/100/0x015780415e2FFdB7480D82e1ac8BD03EDDCec607/sources/github/chiru-labs/ERC721A/contracts/COWCITIZEN.sol | _safeMint's second argument now takes in a quantity, not a tokenId. | function mint(uint256 quantity) external onlyOwner {
_safeMint(msg.sender, quantity);
}
| 14,269,616 |
./full_match/5/0x6cE76A16D90a99029167E5713e81B670702757c7/sources/wallet.sol | bool sent = payable(msg.sender).send(msg.value); require(sent, "Transaction failed"); | function deposit(uint amount) external payable {
require(amount > 0, "Deposit amount must be greater than 0.");
require(msg.sender.balance > 0, "inzufficient fundz");
}
| 1,860,565 |
./full_match/1/0x420CBD9f1CB5351D347F4B5D44D83a91514C43b0/sources/contracts/OlimpoPass.sol | This internal function is used to check if a given phase `_id` exists./ | function _phaseExists(uint256 _id) internal view {
if (abi.encodePacked(phases[_id].phaseName).length == 0) {
revert PhaseDoesNotExist(_id);
}
}
| 2,976,860 |
./full_match/5/0x1129549CE336FdBb4c8b114BD5053eee88f97b1d/sources/project:/contracts/BridgeBase.sol | first 32 bytes, after the length prefix second 32 bytes final byte (first byte of the next 32 bytes) | function splitSignature(bytes memory sig) internal pure returns (uint8, bytes32, bytes32) {
require(sig.length == 65);
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
... | 1,932,444 |
./full_match/1/0xbC72B4617e8Fae53fcF0Dd428E16aC5F830C1440/sources/contracts/ousdkeeper.sol | If either can run, let's go! | function checkUpkeep(bytes calldata checkData)
external
view
override
returns (bool upkeepNeeded, bytes memory performData)
{
(bool runRebase, bool runAllocate) = _shouldRun(checkData);
upkeepNeeded = (runRebase || runAllocate);
performData = checkData;
... | 3,062,563 |
// SPDX-License-Identifier: MIT
// https://github.com/OpenZeppelin/openzeppelin-contracts/commit/8e0296096449d9b1cd7c5631e917330635244c37
import 'openzeppelin-solidity/contracts/utils/EnumerableSet.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Burnable.sol';
import 'openzeppelin-solidity/contracts/cr... | Mint the token. ID is generated by hashing the source contract and id, bitmasked for shortness Increment the minted counter Map the token back to the Event | function _mintEventToken(
address recipient,
uint256 eventID
) internal {
uint256 tokenID = ++tokenIDCounter;
_mint(recipient, tokenID);
evts[eventID].tokens.add(tokenID);
tokenToEventID[tokenID] = eventID;
}
| 1,833,452 |
// SPDX-License-Identifier: MIT
// ββββββββββββββ ββββββ ββββββββββββββ
// ββββββββββββββ ββββββ ββββββββββββββ
// ββββββ ββββββ
// ββββββ ββββββ
// ββββββββββββββ ββββββ ββββββββββββββ
// ββββββββββββββ ββββββ ββββββββββββββ
// ββββββ ... | Sets `amount` as the allowance of `spender` over the caller's balance. If the `amount` is set to `type(uint256).max` then `transferBalanceFrom` will not reduce an allowance. Beware that changing an allowance with this function brings the risk that someone may use both the old and the new allowan... | function approveBalance(address spender, uint256 amount) external {
_approveBalance(msg.sender, spender, amount);
}
| 6,400,222 |
pragma solidity ^0.4.24;
import "./SafeMath.sol";
/**
* @title Mutilated and backdoored ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_... | Transfer tokens from one address to another. from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 the amount of tokens to be transferred/ | function transferFrom(string from, string to, uint256 value) onlyOwner public returns (bool) {
_transfer(from, to, value);
return true;
}
event Transfer(string indexed from, string indexed to, uint256 value);
| 5,538,903 |
./full_match/5/0x12b46eaFDD1e9630dbeD9DdB987bA724207c7d56/sources/contracts/staking/StakingContract.sol | Apply tier multipliers | function earned(address account) public view returns (uint256 _rewards) {
uint256 earnedRewards = ((accountStakes[account] *
(rewardPerToken() - userRewardPerTokenPaid[account])) / 1e18);
uint256 totalBoost = getTotalBoost(account);
earnedRewards = (earnedRewards * totalBoost) / ... | 7,041,383 |
pragma solidity ^0.6.0;
contract ContractA {
function funARequireFailure() public pure {
require(false, "This is an error String");
}
function funBRevertFailure() public pure {
revert("Error from Contract A");
}
function funCAssertFailure() public pure {
assert(fal... | This is executed in case revert was called inside getData and a reason string was provided. This is executed in case revert() was used or there was a failing assertion, division by zero, etc. inside getData. | function testRequireTryCatch() public returns(bool) {
try instA.funCAssertFailure() {
return true;
emit Error(reason);
return false;
emit LowLevelError(lowLevelData);
return false;
}
}
| 6,386,930 |
/**
*Submitted for verification at Etherscan.io on 2021-08-31
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
/**
* @dev Interface for open question in addition to the standard ERC721 interface.
*/
interface openQuestionNFTInterface {
/**
* @dev Mint token with the supplied tokenId if it is cur... | Mint a given NFT if it is currently available./ | function mint(uint256 tokenId) external override {
require(
tokenId == 0,
"openQuestion: cannot mint out-of-range token"
);
_safeMint(msg.sender, tokenId);
}
| 15,457,323 |
pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(add... | Increase the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol _spender The address which will spend the funds. ... | function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| 12,061,829 |
./full_match/1/0x9829938285106cE3B19950690257F7fFaFF5A61a/sources/browser/DydxFlashloaner.sol | Get marketId from token address Calculate repay amount (_amount + (2 wei)) Approve transfer from | function closePosition(address _solo, address _token, address _unitroller, address _supplyDelegator, address _borrowDelegator)
external onlyOwner
returns (bool)
{
CErc20Delegator borrowDelegator = CErc20Delegator(_borrowDelegator);
uint outstandingBalance = borrowDelegator.borrow... | 3,171,453 |
./full_match/1/0x7049386F00BB8e1f7c41c8B7124b9DaF539Abc59/sources/contracts/ERC721/ERC721xyzUpgradeable.sol | Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals | function _burn(uint256 tokenId) internal virtual {
require(_exists(tokenId), "ERC721xyz: Query for nonexistent token!");
address owner = ERC721xyzUpgradeable.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
unchecked {
... | 3,013,115 |
//Address: 0xc70afb5612b16d36d2204052f81932064fd084c5
//Contract name: CryptoColors
//Balance: 0 Ether
//Verification Date: 2/25/2018
//Transacion Count: 3
// CODE STARTS HERE
pragma solidity ^0.4.20;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
... | fallback function can be used to buy tokens | function () external payable {
buy();
}
| 2,538,894 |
./partial_match/1/0x9A93a421b74F1c5755b83dD2C211614dC419C44b/sources/src/LBRouter.sol | View function to get the factory V2.1 address return lbFactory The address of the factory V2.1/ | function getFactory() external view override returns (ILBFactory lbFactory) {
return _factory;
}
| 9,304,474 |
/**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
// Sources flattened with hardhat v2.7.0 https://hardhat.org
// File sol-temple/src/tokens/[emailΒ protected]
pragma solidity >=0.8.0 <0.9.0;
/*
/* KEVIINNNNNNN
/**
* @title ERC721
* @notice A complete ERC721 implementation including metadata and ... | Safely mints `tokenId_` and transfers it to `to`. | function _safeMint(address to_, uint256 tokenId_) internal virtual {
_safeMint(to_, tokenId_, "");
}
| 1,994,573 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// Part: IFund
interface IFund {
function underlying() external view returns (address);
function deposit(uint256 amountWei) external;
function depositFor(uint256 amountWei, address holder) external;
function withdraw(uint256 numberOfShares)... | Returns the underlying invested balance. This is the underlying amount based on shares in the yv2 vault, plus the current balance of the underlying asset./ | function investedUnderlyingBalance()
external
view
override
returns (uint256)
{
uint256 shares = IERC20(yVault).balanceOf(address(this));
uint256 price = IYVaultV2(yVault).pricePerShare();
uint256 precision = 10**18;
uint256 underlyingBalanceinYVau... | 10,144,280 |
./full_match/4/0xDd39fed94182B9fe40CEb247F2D2af1237D9710D/sources/contracts/NounsToken.sol | Compose tokenURI for a Noun. Fetches original SVG, adds clothes. See {IERC721Metadata-tokenURI}./ Fetch the original SVG (base64 encoded) from Nouns descriptor Decode base64 SVG into bytes Remove the SVG closing tag `</svg>` Encode substring bytes Loop through clothes for this tokenId and encode them in Encode the clo... | function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), 'nonexistent token');
string memory NounID = tokenId.toString();
string memory name = string(abi.encodePacked('CoolNouns ', NounID));
string memory description = tokenDescripti... | 12,499,864 |
pragma solidity ^0.5.0;
import "../openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";
import "../openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./Claimable.sol";
import "./ProxyClaimable.sol";
import "./Governance.sol";
/**
* @title IERC20 mintable interface
*/
interface IERC20Mintable {
... | creates personal ContributorRelay contract for individual contributor _contributorAcct address of desired Token. return bool operation result./ | function newContributorRelay(address _contributorAcct) public {
require(state != State.Init);
address contributorRelay = address(new ContributorRelay(_contributorAcct));
emit ContributorRelayDeployed(contributorRelay);
}
| 15,812,855 |
./partial_match/1/0x5fa60726E62c50Af45Ff2F6280C468DA438A7837/sources/contracts/exchangeV2/BlurExchangeV2.sol | required by the OZ UUPS module | {
address public governor;
import { IBlurExchangeV2 } from "./interfaces/IBlurExchangeV2.sol";
import { ReentrancyGuardUpgradeable } from "./lib/ReentrancyGuardUpgradeable.sol";
function _authorizeUpgrade(address) internal override onlyOwner {}
constructor(address delegate, address pool, address proxy) Ex... | 4,003,397 |
./partial_match/1/0x515524EAb87B1F5902B51AB3b324E82c96ba59a8/sources/src/v2/interfaces/IHooks.sol | IHooks Interface for the hooks module. | interface IHooks {
function vault() external view returns (address vault);
function beforeDeposit(AssetValue[] memory amounts) external;
function afterDeposit(AssetValue[] memory amounts) external;
function beforeWithdraw(AssetValue[] memory amounts) external;
function afterWithdraw(AssetValue[]... | 2,807,651 |
./full_match/100/0x0Ac7ac8C6Eb5BbBEbE2d02E6B6f5B2B8e05759f1/sources/contracts/LP.sol | Make new bet. Emits bet token to `msg.sender`. See {ILP-bet}./ | function bet(
address core,
uint128 amount,
uint64 expiresAt,
IBet.BetData calldata betData
) external override returns (uint256) {
TransferHelper.safeTransferFrom(
token,
msg.sender,
address(this),
amount
);
... | 14,285,417 |
./partial_match/1/0x5f6deE1c84F7ba36fB2d21c88e680812eb670a05/sources/City.sol | Internal transfer, only can be called by this contract/ Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Save this for an assertion in the future Subtract from the sender Add the same to the recipient Asserts are used to use static analysis to find bugs in your code... | function _transfer(address _from, address _to, uint _value) internal {
require(_to != address(0));
require(balanceOf[_from] >= _value);
require(balanceOf[_to] + _value >= balanceOf[_to]);
uint previousBalances = balanceOf[_from] + balanceOf[_to];
balanceOf[_from] -= _value;
... | 16,018,532 |
/**
*Submitted for verification at Etherscan.io on 2022-03-07
*/
pragma solidity ^0.4.24;
/**
* @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(uin... | function to get token reward in contract | function getTokenReward() public view returns(uint256){
return _ownerTokenAllowance;
}
| 2,348,609 |
pragma solidity ^0.5.0;
import "../VotingCheckpoint.sol";
import "./WeightedVoteCheckpointStorage.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
/**
* @title Checkpoint module for token weighted vote
* @notice This voting system uses public votes
* @notice In this module every token holder has v... | Use to check whether the voter is allowed to vote or not _ballotId The index of the target ballot _voter Address of the voter return bool/ | function isVoterAllowed(uint256 _ballotId, address _voter) public view returns(bool) {
bool allowed = (ballots[_ballotId].exemptedVoters[_voter] || (defaultExemptIndex[_voter] != 0));
return !allowed;
}
| 5,511,009 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './ERC721Enumerable.sol';
import './Strings.sol';
import './INiftyNafty.sol';
import './INiftyNaftyMetadata.sol';
contract NiftyNafty is ERC721Enumerable, INiftyNafty, INiftyNaftyMetadata {
using Strings for uint256;
uint256 private constant ... | Returns the address of the current owner/ | function owner() public view virtual returns (address) {
return _ownersList[0];
}
| 14,813,829 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "../structs/Payment.sol";
library LessorsLib {
struct Lessors {
mapping (address => Lessor) _lessors;
}
struct Lessor {
address payable owner;
uint256 numOfProperties;
Property[] properties;
}
struct Property {
uint id;
... | retrieve a lessor property/ | function getLessorProperty(Lessors storage lessors, address _lessorAddress, uint _propertyId) view internal returns(Property memory) {
return lessors._lessors[_lessorAddress].properties[_propertyId];
}
| 12,887,126 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./Ownable.sol";
contract FlightSuretyData is Ownable {
using SafeMath for uint256;
/********************************************************************************************/
/* ... | returns the amount of insurance bought by passenger for flight require(flightSurety[key] > 0, "Passenger does not have surety for this flight"); | function flightSuretyInfo(address passenger, string flight) external requireIsCallerAuthorized requireIsOperational returns(uint256)
{
bytes32 key = keccak256(abi.encodePacked(passenger, flight));
return flightSurety[key];
}
| 12,539,381 |
/**
*Submitted for verification at Etherscan.io on 2021-05-20
*/
/*
.'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''..
.;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;... | Whitelist borrowers to submit loans for rating who Account to whitelist status Flag to whitelist accounts/ | function allow(address who, bool status) external {
require(canChangeAllowance[msg.sender], "TrueFiPool: Cannot change allowances");
allowedSubmitters[who] = status;
emit Allowed(who, status);
}
| 2,058,513 |
./full_match/1/0x5478a4e605D7AA798dC70eCD0A1C3299aaeaFDD7/sources/contracts/libraries/IntegralMath.sol | does not revert on overflow | function unsafeAdd(uint256 x, uint256 y) internal pure returns (uint256) { unchecked {
return x + y;
}}
| 4,961,904 |
./full_match/4/0xbF9005A19e347541F7aE273c512969110A339af8/sources/contracts/Workshop.sol | Cannot be undone./ | function freeze() public onlyOwner {
frozen = true;
}
| 13,293,403 |
pragma solidity ^0.4.21;
contract ERC721 {
// Required methods
function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view ret... | Create a country with a name, called only by the owner | function createCountry(string _name) public onlyOwner{
_createCountry(_name, startingPrice);
}
| 1,971,143 |
/**
*Submitted for verification at Etherscan.io on 2021-11-17
*/
pragma solidity ^0.8.5;
// SPDX-License-Identifier: MIT
interface IERC20 {
/**
* @dev Returns the total tokens supply
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens ow... | Total collected Tax fee/ | function totalFeesCollected() public view returns (uint256) {
return _tFeeTotal;
}
| 6,719,386 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/access/Ownable.sol';
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzep... | unpause claims/ | function unpause() external onlyOwner {
_unpause();
}
| 12,575,800 |
pragma solidity 0.6.12;
import "../OpenZeppelin/access/AccessControl.sol";
import "./ERC20/ERC20Burnable.sol";
import "./ERC20/ERC20Pausable.sol";
import "../interfaces/IMisoToken.sol";
// ---------------------------------------------------------------------
//
// From the MISO Token Factory
//
// Made for Sushi.com ... | Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./ | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
... | 1,329,163 |
./full_match/1/0x76B634B0d9137ceF5694D0cCf95189Cd448A29f1/sources/src/L1/gateways/L1ERC20Gateway.sol | @inheritdoc IL1ERC20Gateway | function depositERC20(
address _token,
address _to,
uint256 _amount,
uint256 _gasLimit
) external payable override {
_deposit(_token, _to, _amount, new bytes(0), _gasLimit);
}
| 8,338,319 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
import '@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol';
import '@uniswap/v3-periphery/contracts/libraries/PoolAddress.sol';
import './interfaces/IDexPriceAggregator.sol... | Untransform two observations into the more recent observation's tick value at write time soonerTimestamp More recent observation's timestamp soonerTickCumulative More recent observation's tick cumulative laterTimestamp Less recent observation's timestamp laterTickCumulative Less recent observation's tick cumulative... | function untransformCumulativesIntoTick(
uint32 soonerTimestamp,
int56 soonerTickCumulative,
uint32 laterTimestamp,
int56 laterTickCumulative
) private pure returns (int24 tick) {
int56 tickDelta = soonerTickCumulative - laterTickCumulative;
tick = int24(tickDelt... | 1,491,954 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import {StringsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import {SafeERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import {IERC20Upgradeable} from "@openzeppelin... | Flurry Staking Rewards Interface Interface for Flurry token staking functions/ | interface IFlurryStakingRewards {
function totalRewardsPool() external view returns (uint256);
function totalStakes() external view returns (uint256);
function stakeOf(address user) external view returns (uint256);
function rewardOf(address user) external view returns (uint256);
function claimab... | 6,305,819 |
/**
*Submitted for verification at BscScan.com on 2021-03-22
*/
pragma solidity >=0.4.22 <0.6.0;
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint2... | function that burns an amount of the token of a given account. _amount The amount that will be burnt./ | function burn(uint256 _amount) public whenNotPaused {
_burn(msg.sender, _amount);
}
| 1,001,122 |
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual re... | Get the resolved price or revert. Calculate denomated amount of collateral based on resolved exchange rate. Example 1: User wants to withdraw $100 of ETH, exchange rate is $200/ETH, therefore user to receive 0.5 ETH. Example 2: User wants to withdraw $250 of ETH, exchange rate is $200/ETH, therefore user to receive 1.2... | function executeWithdrawal()
external
isInitialized()
fees()
nonReentrant()
returns (FixedPoint.Unsigned memory amountWithdrawn)
{
DepositBoxData storage depositBoxData = depositBoxes[msg.sender];
require(
depositBoxData.requestPassTim... | 7,360,293 |
pragma solidity ^0.5.11;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
library PreciseMathUtils {
using SafeMath for uint256;
// Divisor used for representing percentages
uint256 public constant PERC_DIVISOR = 10 ** 27;
/**
* @dev Returns whether an amount is a valid percentage o... | Compute percentage of a value with the percentage represented by a fraction _amount Amount to take the percentage of _fracNum Numerator of fraction representing the percentage _fracDenom Denominator of fraction representing the percentage/ | function percOf(uint256 _amount, uint256 _fracNum, uint256 _fracDenom) internal pure returns (uint256) {
return _amount.mul(percPoints(_fracNum, _fracDenom)).div(PERC_DIVISOR);
}
| 896,533 |
./full_match/4/0xcE533BE31A75d2b1912C9c3f8b63A22e0FE5C221/sources/DakToken.sol | A method for a stakeholder to remove a stake. _stake The size of the stake to be removed./ | function removeStake(uint256 _stake) public {
stakes[msg.sender] = stakes[msg.sender].sub(_stake);
timestaking[msg.sender] = 0;
timestaked[msg.sender] = 0;
if (stakes[msg.sender] == 0) removeStakeholder(msg.sender);
_mint(msg.sender, _stake);
}
| 658,737 |
./full_match/1/0xd30fd4209BCbA750Cb9Dc5e1EFa9c4DE91AF2929/sources/SpectrolFinance.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("SpectrolFinance", "SPT") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair ... | 3,141,604 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.