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/1/0x86e437FE6E8d6661477f18B1B7fAAD61Aa7506A3/sources/contracts/Dividends.sol | Updates every user's rewards allocation for each distributed token/ if no esToken is allocated or initial distribution has not started yet check if the current cycle has changed since last update update accDividendPerShare for the end of the previous cycle check if distribution is enabled transfer the token's cycleDivi... | function _updateDividendsInfo(address token) internal {
uint256 currentBlockTimestamp = _currentBlockTimestamp();
DividendsInfo storage dividendsInfo_ = dividendsInfo[token];
updateCurrentCycleStartTime();
uint256 lastUpdateTime = dividendsInfo_.lastUpdateTime;
uint256 accD... | 3,216,534 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import { IERC20 } from "./interfaces/IERC20.sol";
import { IExchange } from "./interfaces/IExchange.sol";
import { console } from "hardhat/console.sol"; // TODO: Remove
library Errors {
string internal constant _AmountZero = "Amount can't be 0";
string ... | NOTE: The number of iterations is "bound" given that a (large) gap between executions should be a rare occasion | function _calcAmountToRemove() private view returns (uint256) {
uint256 amountToRemove;
uint256 today = _today();
uint256 dayDiff = today - lastExecution;
for (uint256 i = 0; i < dayDiff; i++) {
amountToRemove += removeAmount[today - i];
}
return amountToR... | 2,514,583 |
pragma solidity ^0.4.19;
import "./Ownable.sol";
import "./BattleboatsStates.sol";
import "./BattleboatsEnums.sol";
contract Battleboats is Ownable, BattleboatsStates, BattleboatsEnums {
// ==============================================================================================
// GAME STATE
// =======... | Calculates the score of a player in a game. _thisPlayer - The state of the player you need the score for _otherPlayer - The state of other player, for reference | function _playerScore(PlayerState _thisPlayer, PlayerState _otherPlayer) internal pure returns (uint) {
uint score = 0;
uint boatPostionIndex = 0;
uint attackPostionIndex = 0;
uint hitPostionIndex = 0;
for (boatPostionIndex = 0; boatPostionIndex < 10; boatPostionIndex++) {
for (att... | 15,788,798 |
// SPDX-License-Identifier: MIT
// Scroll down to the bottom to find the contract of interest.
// File: @openzeppelin/contracts@4.3.2/utils/introspection/IERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implem... | Returns an array of uints representing whether the token has been claimed. | function genesisClaimed(uint[] memory _genesisIds) public view returns(bool[] memory) {
uint n = _genesisIds.length;
bool[] memory a = new bool[](n);
for (uint i = 0; i < n; ++i) {
a[i] = checkGenesisClaimed(_genesisIds[i]);
}
return a;
}
| 102,174 |
pragma solidity 0.4.25;
// File: contracts/saga/interfaces/IPaymentHandler.sol
/**
* @title Payment Handler Interface.
*/
interface IPaymentHandler {
/**
* @dev Get the amount of available ETH.
* @return The amount of available ETH.
*/
function getEthBalance() external view returns (uint256);... | Transfer ETH to an SGA holder. _to The address of the SGA holder. _value The amount of ETH to transfer./ | function transferEthToSgaHolder(address _to, uint256 _value) external only(_IPaymentManager_) {
bool status = _to.send(_value);
getSGATokenManager().postTransferEthToSgaHolder(_to, _value, status);
}
| 7,326,108 |
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
import "./AdvancedTokenStorage.sol";
import "../../openzeppelin/Initializable.sol";
/**
* @title Loan Token Logic Proxy contract.
*
* @notice This contract contains the proxy functionality and it will query the logic target from LoanTokenLogicBeacon
* This... | External function to set the new LoanTokenLogicBeacon Address _newBeaconAddress Address of the new LoanTokenLogicBeacon/ | function setBeaconAddress(address _newBeaconAddress) external onlyAdmin {
_setBeaconAddress(_newBeaconAddress);
}
| 5,433,356 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
import "@openzeppelin/contracts/token/ERC20/ERC20Snapshot.sol";
import "@openzeppelin/contracts/utils/Arrays.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./Humanity.sol";
/**
* @title Vote
* A proxy contract for ProofOfHumanity that impl... | Changes the address of the the related ProofOfHumanity contract. _proofOfHumanity The address of the new contract./ | function changeProofOfHumanity(IProofOfHumanity _proofOfHumanity) external onlyDeployer {
proofOfHumanity = _proofOfHumanity;
}
| 969,189 |
./full_match/1/0x909841982F0753c3391a3e8e7B6Ea484d4ee25B7/sources/PIPE.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("metal pipe", unicode"PIPE") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pa... | 17,038,916 |
// File: openzeppelin-solidity/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 ... | Private implementation of staking methods. staker User address who deposits tokens to stake. beneficiary User address who gains credit for this stake operation. amount Number of deposit tokens to stake./ 1. User Accounting 2. Global Accounting Already set in updateAccounting() _lastAccountingTimestampSec = now; inte... | function _stakeFor(address staker, address beneficiary, uint256 amount) private {
require(amount > 0, 'Cradle: stake amount is zero');
require(beneficiary != address(0), 'Cradle: beneficiary is zero address');
require(totalStakingShares == 0 || totalStaked() > 0,
'Cradle: Inv... | 11,787,292 |
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
interface IERC20 {
function TOTALSUPPLY57() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF949(address account) external view returns (uint256); //inject ... | inject NONSTANDARD NAMING | function TRANSFER654(address recipient, uint256 amount) public returns (bool) { | 12,740,422 |
./partial_match/42/0xb0D299d01bBD2fb20A52E315c768C88C44256d92/sources/ProofOfHumanity.sol | Submit a reference to evidence. EVENT. _submissionID The address of the submission which the evidence is related to. _evidence A link to an evidence using its URI./ | function submitEvidence(address _submissionID, string calldata _evidence) external {
Submission storage submission = submissions[_submissionID];
Request storage request = submission.requests[submission.requests.length - 1];
ArbitratorData storage arbitratorData = arbitratorDataList[request.a... | 3,440,491 |
pragma solidity ^0.4.24;
import '../../common/AgentStorage.sol';
import './appStorageI.sol';
/**
* @title Application Storage contract - contains info about Apps
*/
contract AppStorage is AppStorageI, AgentStorage {
struct _App {
uint32 hashType; // default 0 - IPFS
uint32 appType; // default 0 -... | Apps setters/ | function setHashType(uint _app, uint32 _hashType) external onlyAgentStore(Apps[_app].store) {
Apps[_app].hashType = _hashType;
}
| 5,501,103 |
// File: contracts/uniswapv2/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string me... | refund dust eth, if any | function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) {
(amountTok... | 13,947,770 |
./full_match/4/0xB7B6fCd74c0b02ef669Ef3D017B10f22727E8369/sources/DePass.sol | Method reserved to DeAuth Oracle DeAuth Apps PoA process final step Operation success will emit the `AppProven` event which allows a creator to list his app Operation will fail if app creator has not enough `gasBalance` to pay transaction fees to the oracle _appId Id of the app the query was about result Response ... | function PoA_keyReceiver(uint _appId, string memory result)
external
payable
onlyOracle
appExists(_appId)
{
bool gasConsumed = _consumeGas(appCreator(_appId), ORACLE_QUERY_FEES);
require(gasConsumed, 'query gas cant be consumed');
bool feesPa... | 12,294,683 |
./full_match/1/0x624984fd288e28C0D24d7E0E4aDFDa130717720B/sources/contracts/GraphTokenLockWallet.sol | Forward authorized contract calls to protocol contracts Fallback function can be called by the beneficiary only if function call is allowed/ Only beneficiary can forward calls Function call validation Call function with data Tracked used tokens in the protocol We do this check after balances were updated by the forwar... | fallback() external payable {
require(msg.sender == beneficiary, "Unauthorized caller");
address _target = manager.getAuthFunctionCallTarget(msg.sig);
require(_target != address(0), "Unauthorized function");
uint256 oldBalance = currentBalance();
Address.functionCall(_targ... | 3,215,169 |
./full_match/43114/0xb7f50A256c42f780f1402BF9014222b30854962e/sources/gauge.sol | Bring Deprecated gauge back into use | function renewGauge(address _token) external onlyBenevolent {
require(gauges[_token] == address(0x0), "exists");
gauges[_token] = deprecated[_token];
delete deprecated[_token];
}
| 4,500,653 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./RandomNumberGener... | Change the token's image URI _tokenId Id of the token./ | function uri(uint _tokenId) override public pure returns(string memory) {
return string(abi.encodePacked(
Strings.toString(_tokenId),
".json"
));
event CharacterCreated(uint24 id);
event Rested(uint24 tokenId);
event Fighted(uint24 myTokenId, uint24 rivalTokenId, ... | 2,557,978 |
/*
Copyright 2021 Babylon Finance
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... | GOVERNANCE FUNCTION: Edit an existing operation on the registry _kind Operation kind _operation Address of the operation contract to set/ | function setOperation(uint8 _kind, address _operation) public override onlyGovernanceOrEmergency {
require(_kind < MAX_OPERATIONS, 'Max operations reached');
require(enabledOperations[_kind] != _operation, 'Operation already set');
require(_operation != address(0), 'Operation address must ex... | 13,484,939 |
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract MogulNFT is ERC1155, AccessControl, Ownable {
usin... | Generate next token ID | function generateTokenId() internal returns (uint256) {
return nextTokenId++;
}
| 10,431,208 |
pragma solidity ^0.4.0;
contract dkgEnc {
/**
* DKG phases:
*
* 0) Create the contract with a threshold (t) and
* number of participants.
*
* 1) Each of the participants sends a deposit and
* a public key address that he owns.
*
* (not on contract) - each participant generates t+1
* r... | returns e(a,x) == e(b,y) | function pairingCheck(uint256[2] a, uint256[4] x, uint256[2] b, uint256[4] y)
internal
returns (bool)
{
uint256[12] memory input = [
a[0], a[1], x[0], x[1], x[2], x[3],
b[0], p - b[1], y[0], y[1], y[2], y[3]
];
uint[1] memory result;
assembly {
if iszero(call(not(0), 0x08, 0, inpu... | 913,418 |
./full_match/5/0x8792C8f923454196539AB9D7Fa97F69951AC7278/sources/contracts/6/forwarder/BiconomyForwarder.sol | an external function which exposes the internal _verifySigEIP712 method req : request being verified domainSeparator : the domain separator presented to the user when signing sig : the signature generated by the user's wallet/ | function verifyEIP712(
ERC20ForwardRequest calldata req,
bytes32 domainSeparator,
bytes calldata sig)
external view {
_verifySigEIP712(req, domainSeparator, sig);
}
| 7,037,287 |
./full_match/137/0xE45d523E93C9C5Ceb3cB1fdfa90e2bbEE9DCc324/sources/ForgeToken.sol | Creates `amount` new tokens for `to`, of token type `id`. See {ERC1155-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./ | function mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual {
require(
hasRole(MINTER_ROLE, _msgSender()),
"ERC1155PresetMinterPauser: must have minter role to mint"
);
_mint(to, id, amount, data);
... | 4,771,164 |
pragma solidity 0.4.24;
// _____________________________________________________________
// .''
// ._.-.___.' (`\
// //( ( `'
// '/ )\ ).__. )
// ' <' `\ ._/'\
// ________`___\_____\__________________________________________
// ... | calculate players total earnings (able to be withdrawn)/ | function calcPlayerEarnings()
private
view
returns (uint256)
{
return calcPlayerWinnings()
.add(calcPlayerDividends())
.add(calcPlayerReferrals())
.sub(players_[msg.sender].totalWithdrawn)
.sub(players_[msg.sender].totalReinvested);... | 2,484,565 |
pragma solidity ^0.6.7;
// SPDX-License-Identifier: MIT
interface IController {
function vaults(address) external view returns (address);
function rewards() external view returns (address);
function devfund() external view returns (address);
function treasury() external view returns (address);
... | SPDX-License-Identifier: MIT | interface IStrategy {
function rewards() external view returns (address);
function gauge() external view returns (address);
function want() external view returns (address);
function timelock() external view returns (address);
function deposit() external;
function withdraw(address) external;... | 10,883,363 |
./full_match/1/0xfDA0Da7E45dDCFBaDA35BF01Dd2C85bA881FAef3/sources/contracts/TheMaximals.sol | verify whitelistFree mint checkBlock for free mint | function whitelistMint(uint8 numberOfTokens, bytes32[] calldata proof) external payable nonReentrant whenNotPaused {
require(currentPhase == Phases.Phase1, "ERROR: Mint is not active.");
uint256 _totalCost;
require(_isWhitelisted(msg.sender, proof, minters[_minterRole].root), "ERRO... | 16,557,840 |
./full_match/5/0x19A4010E859ca3d10F0d928C6665F9a9E3BE4B22/sources/contracts/interfaces/types/Position.sol | Returns the socialization factor for the current position Socialization account for the case where `taker` > `maker` temporarily due to a liquidation on the maker side. This dampens the taker's exposure pro-rata to ensure that the maker side is never exposed over 1 x short. self The Position to operate on r... | function socializationFactor(Position memory self) internal pure returns (UFixed18) {
return self.taker.isZero() ? UFixed18Lib.ONE : UFixed18Lib.min(UFixed18Lib.ONE, self.maker.div(self.taker));
}
| 1,912,766 |
./full_match/3/0x1AEf93FCB062b44F7F609E71A8f204AA91ec626D/sources/contracts/UniswapV2Router02.sol | REMOVE LIQUIDITY (supporting fee-on-transfer tokens) | function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) public virtual override ensure(deadline) returns (uint amountETH) {
(, amountETH) = removeLiquidity(
token,
WETH,
liquidity,
amountTokenMin,
amountETHMin,
address(... | 8,235,278 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
im... | function setPublicSwap(bool _swap) public {
require(msg.sender == strategist || msg.sender == governance, "auth");
if (_swap == true) {
require(rebalancedAt + 5 <= block.number, 'not enough block');
require(checkWellBalanced(), 'need rebalance');
}
pool.setPub... | 1,052,061 | |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.10;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/... | accrue rewards for two users on a market | function accrue(ERC20 market, address user, address secondUser) public returns (uint256, uint256) {
RewardsState memory state = marketState[market];
if (state.index == 0) return (0, 0);
state = accrueMarket(market, state);
return (accrueUser(market, user, state), accrueUser(market,... | 1,412,305 |
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
/**
* @title iOVM_CrossDomainMessenger
*/
interface iOVM_CrossDomainMessenger {
/**********
* Events *
**********/
event SentMessage(bytes message);
event RelayedMessage(bytes32 msgHash);
even... | Pushes a single element to the buffer. _self Buffer to access. _value Value to push to the buffer. _extraData Global extra data./ Bump the global index and insert our extra data, then save the context. | function push(
Buffer storage _self,
bytes32 _value,
bytes27 _extraData
)
internal
{
BufferContext memory ctx = _self.getContext();
_self.buf[ctx.length] = _value;
ctx.length++;
ctx.extraData = _extraData;
_self.setContext(ctx);
}... | 6,167,399 |
/**
* The Carmen Token contract bases on the ERC20 standard token contracts
* Founders: Penthora Foundation, Anakatier Group PCL and Kirimanya Holding
*/
pragma solidity ^0.4.25;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
... | collect ether to owner account | function collect() external onlyAuthorized {
owner.transfer(address(this).balance);
}
| 2,483,156 |
./full_match/43113/0xA3c46812cD288fc30c04F8641C39A3718896189A/sources/contracts/NewYeti.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 tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
string memory base = baseURI();
if (bytes(base).length == 0) {
... | 7,137,699 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./SwapUtils.sol";
/**
* @title AmplificationUtils library
* @notice A library to calculate and ramp the A parameter of a given `SwapUtils.Swap` struct.
* This library assumes the struct is ... | pool data view functions min return calculation functions state modifying functions | interface IMetaSwap {
function getA() external view returns (uint256);
function getToken(uint8 index) external view returns (IERC20);
function getTokenIndex(address tokenAddress) external view returns (uint8);
function getTokenBalance(uint8 index) external view returns (uint256);
function getVir... | 970,285 |
./partial_match/3/0xCd25451C6fF0a01003717D0271667376d06c5591/sources/TestCoin.sol | transfer of token to another address. always require the sender has enough balance return the bool true if success. _receiver The address to transfer to. _amount The amount to be transferred./ | function transfer(address _receiver, uint256 _amount) public returns (bool success) {
require(_receiver != address(0));
return ERC20.transfer(_receiver, _amount);
}
| 5,128,859 |
pragma solidity ^0.5.11;
contract ERC20 {
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint... | Admin can transfer his ownership to new address | function transferownership(address _newaddress) public returns(bool){
require(msg.sender==_admin);
_admin=_newaddress;
return true;
}
| 1,493,660 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {OwnableUpgradeable} from '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.... | return The result of safely dividing x and y. The return value is a high precision decimal. y is divided after the product of x and the standard precision unit is evaluated, so the product of x and UNIT must be less than 2256. As this is an integer division, the result is always rounded down. This helps save on gas. R... | function divideDecimal(uint256 x, uint256 y) internal pure returns (uint256) {
return x.mul(UNIT).div(y);
| 217,815 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;
import "./BalancedWeightTree.sol";
library WeightedRandomList {
struct Data {
BalancedWeightTree.Tree tree;
}
/**
* Inserts the id with the specified weight
* _id the identifier. Can have any value. Preferably greater than zero.
... | Performs a weighted random selection Returns the selected id/ | function singleSelect(Data storage data) public view returns (uint) {
return singleSelect(data, rand(0));
}
| 12,754,895 |
pragma solidity ^0.4.23;
contract DSAuthority {
function canCall(
address src, address dst, bytes4 sig
) public view returns (bool);
}
contract DSAuthEvents {
event LogSetAuthority (address indexed authority);
event LogSetOwner (address indexed owner);
}
contract DSAuth is DSAuthEvents {
... | This method can be used by the controller to extract mistakenly sent tokens to this contract. _token The address of the token contract that you want to recover set to 0 in case you want to extract ether. | function claimTokens(address _token) onlyController {
if (_token == 0x0) {
controller.transfer(address(this).balance);
return;
}
ERC20 token = ERC20(_token);
uint balance = token.balanceOf(this);
token.transfer(controller, balance);
emit Clai... | 13,384,782 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts-upgradeable/utils/introspection/ERC165StorageUpgradeable.sol';
// import '@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol';
import '../UnlockUtils.sol';
import './MixinKeys.sol';
import ... | Allows the Lock owner to assign a Symbol for this Lock./ | function updateLockSymbol(
string calldata _lockSymbol
) external
onlyLockManager
{
lockSymbol = _lockSymbol;
emit NewLockSymbol(_lockSymbol);
}
| 2,510,461 |
./partial_match/1/0x4ff428C984c65f88dD291552E75AA4c433E867a5/sources/CompoundSavingsProtocol.sol | get dai from user mainnet only mint cDai balance should be equal to cDai minted return cDai to user | function deposit(address _user, uint _amount) public {
require(msg.sender == _user);
require(ERC20(DAI_ADDRESS).transferFrom(_user, address(this), _amount));
ERC20(DAI_ADDRESS).approve(NEW_CDAI_ADDRESS, uint(-1));
require(cDaiContract.mint(_amount) == 0, "Failed Mint");
uin... | 2,826,623 |
./partial_match/42220/0x553a2a1B70725C1042A0D76e16f4f5a683648dEB/sources/script/Deploy.s.sol | Verify the provided attestation to the `core` address, Then deploy Messenger contract configured with `core` `v`, `r`, `s` are an ECDSA signature over the hash produced by `formatAttestation` core The 20-byte EVM core address. v The v component of the ECDSA signature. r The r component of the ECDSA sig... | function deploy(address core, uint8 v, bytes32 r, bytes32 s) external {
verifyAttestation(core, v, r, s);
messenger.initialize(core);
}
| 3,498,118 |
./partial_match/42/0x43e9c17bfA6d0e751c5B20b22c9263Dc92Ebb16a/sources/SynthetixBridgeToOptimism.sol | create message payload for L2 relay the message to this contract on L2 via L1 Messenger | function _initiateRewardDeposit(uint256 _amount) internal {
bytes memory messageData = abi.encodeWithSignature("completeRewardDeposit(uint256)", _amount);
messenger().sendMessage(synthetixBridgeToBase(), messageData, uint32(getCrossDomainMessageGasLimit()));
emit RewardDeposit(msg.sender, ... | 3,360,715 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.17;
interface IERC20 {
function TOTALSUPPLY668() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF477(address account) external view returns (uint256); //inject... | inject NONSTANDARD NAMING | function HARVEST259() public { | 14,109,690 |
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.4;
import "../interfaces/IERC20.sol";
import "../utils/Context.sol";
import "../interfaces/IWhitelist.sol";
contract PrivateSale is Context {
/**
* Investment Structure.
*/
struct Investment {
uint256 _usdt;
uint256 _usdc;
... | transfers ownership to a different account. Requirements: `newAdmin` cannot be a zero address. `caller` should be current admin./ | function transferControl(address newAdmin) public virtual onlyAdmin {
require(newAdmin != address(0), "Error: owner cannot be zero");
_admin = newAdmin;
}
| 1,129,337 |
pragma solidity ^0.4.18;
/**
* @title Owned contract with safe ownership pass.
*
* Note: all the non constant functions return false instead of throwing in case if state change
* didn't happen yet.
*/
contract Owned {
/**
* Contract owner address
*/
address public contractOwner;
... | Transfers asset balance between holders wallets. Can only be called by asset proxy. _to holder address to give to. _value amount to transfer. _symbol asset symbol. _reference transfer comment to be included in a Transfer event. _sender transfer initiator address. return success. | function proxyTransferWithReference(address _to, uint _value, bytes32 _symbol, string _reference, address _sender) onlyProxy(_symbol) public returns (uint) {
return _transfer(getHolderId(_sender), _createHolderId(_to), _value, _symbol, _reference, getHolderId(_sender));
}
| 5,370,200 |
pragma solidity ^0.5.8;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract SimpleMultiSig {
// EIP712 Precomputed hashes:
// keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)")
bytes32 constant EIP712DOMAINTYPE_HASH = 0xd87cd6ef79d4e2... | only master can execute verify signatures send erc20 tokens send eth | function transfer(
bytes32 id,
uint8[] memory sigV,
bytes32[] memory sigR,
bytes32[] memory sigS,
address payable recipient
) public {
require(master == msg.sender, "Incorrect executor");
verifySigs(id, sigV, sigR, sigS, recipient);
Wallet storag... | 7,215,885 |
/**
*Submitted for verification at BscScan.com on 2022-01-12
*/
pragma solidity ^0.6.0;
// SPDX-License-Identifier: MIT
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, 'SafeMath: addition overflow');
return c;
... | function to set the total tokens to sell only owner can call this function | function setTokenPricePerBNB(uint256 _tokenPerBnb) external onlyOwner {
require(_tokenPerBnb > 0, "Invalid TOKEN price per BNB");
tokenPerBnb = _tokenPerBnb;
}
| 12,660,900 |
./full_match/5/0x9b36C596585036B21cF3792872555E99E89F0ce2/sources/contracts/MISOMarket.sol | Used to check whether an address has the minter role _address EOA or contract being checked return bool True if the account has the role or false if it does not/ | function hasMarketMinterRole(address _address) public view returns (bool) {
return accessControls.hasRole(MARKET_MINTER_ROLE, _address);
}
| 7,060,466 |
./full_match/8453/0x687b8C9b41E01Be8B591725fac5d5f52D0564d79/sources/contracts/aave-v2-linear-pool/AaveLinearPoolFactory.sol | Used for create2 deployments This event allows off-chain tools to differentiate between different protocols that use this factory to deploy Aave Linear Pools. | {
uint256 private _nextRebalancerSalt;
IBalancerQueries private immutable _queries;
address private _lastCreatedPool;
string private _poolVersion;
event AaveLinearPoolCreated(address indexed pool, uint256 indexed protocolId);
constructor(
IVault vault,
IProtocolFeePercentages... | 11,542,371 |
./full_match/43114/0xEC91B2808Ab778d8900634FD2811fD0Be07D9774/sources/project_/contracts/MasterChefV2.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.timestamp <= pool.lastRewardTime) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0 || pool.allocPoint == 0) {
pool.lastR... | 4,591,086 |
./full_match/4/0x6e936fE9E2c386c6BaF77FA21093b91d3dC027f6/sources/500balles.sol | --------------------------------------------------------INTERNAL FUNCTIONS -------------------------------------------------------- calculate and update the user weighted balance | function updateUserWeightedBalance(uint256 _pid, address user) public {
uint256 amount = userInfo[_pid][user].amount;
uint256 poolBalance = poolInfo[_pid].weightedBalance - userInfo[_pid][user].weightedBalance;
if (userInfo[_pid][user].lockedUntil != 0 || userInfo[_pid][user].lockedUntil <= block.timestamp... | 788,268 |
./full_match/10/0xCe1538A8f42617585CD3c42734d5079c0628c9c8/sources/contracts/coordinape-protocol/contracts/cosoul/CoSoul.sol | Function to update the value of a slot in a blob _slots Slot value. Up to 7 _amounts Amout to update _tokenIds Token ID from which to update the blob data/ get the inverse of the slot mask filter current blob with inverse mask to remove the current slot and update it (OR operation) to add slot | function batchSetSlot(
uint256[] calldata _slots,
uint32[] calldata _amounts,
uint256[] calldata _tokenIds
) external authorised(msg.sender) {
for (uint256 i = 0; i < _slots.length; i++) {
require(_slots[i] < 8);
uint256 inverseMask = ~(0xffffffff << _slo... | 3,780,163 |
/**
*Submitted for verification at Etherscan.io on 2019-12-27
*/
/**
Copyright 2019 PoolTogether LLC
This file is part of PoolTogether.
PoolTogether is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation under version... | Deposits the given amount into the current open draw by the given user. self The DrawManager state _addr The address to deposit for _amount The amount to deposit/ update the current draw if this is the users first draw, set it otherwise, if the first draw is not this draw if a second draw does not exist set the seco... | function deposit(State storage self, address _addr, uint256 _amount) public requireOpenDraw(self) onlyNonZero(_addr) {
bytes32 userId = bytes32(uint256(_addr));
uint256 openDrawIndex = self.openDrawIndex;
uint256 currentAmount = self.sortitionSumTrees.stakeOf(bytes32(openDrawIndex), userId)... | 14,091,768 |
pragma solidity 0.4.21;
pragma experimental "v0.5.0";
contract Owned {
address public owner;
address public newOwner;
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
assert(msg.sender == owner);
_;
}
function transferOwnership(... | returns funds not yet vested according to vesting schedule have to do it here, can't use return, because contract selfdestructs returns remainder of funds to VestingMaster and kill vesting contract | function revoke(string _reason) external onlyOwner {
require(revocable);
uint256 releasableFunds = ReleasingScheduleInterface(releasingScheduleContract).getReleasableFunds(this);
ERC20TokenInterface(tokenAddress).transfer(beneficiary, releasableFunds);
VestingMasterInterface(owner).s... | 944,213 |
./full_match/100/0x2c3DE641b0448FF29f917F9808ce63047A04d83c/sources/contracts/rari-fuse/src/core/CToken.sol | Returns latest pending Fuse fee (to be set with `_setFuseFeeFresh`)/ | function getPendingFuseFeeFromAdmin() internal view returns (uint256) {
return fuseAdmin.interestFeeRate();
}
| 14,267,834 |
./full_match/3/0x35861545afed09838fb6DC7ebdD5C2566D34255c/sources/ProofOfStudent.sol | record a student name | function registration(string memory name) public {
recordProof(hashing(name));
}
| 8,263,251 |
./full_match/43113/0xbdB39b6fE09617E276B8194397240dcd614d3798/sources/project_/contracts/IFold.sol | Interface of IFold./ | interface IFold {
function mint(uint _amount) external;
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
} | 7,163,539 |
./full_match/73799/0xb5fF083230fa8f6241Bc17F5ca8cc1D3FB3fDBD7/sources/contracts/libraries/LibProofManager.sol | revokeProof - Revokes a certificate certificateID ID of the certificate to revoke/ | function revokeProof(uint256 certificateID) internal {
LibIssuer.getStorage().certificates[certificateID].isRevoked = true;
}
| 16,362,020 |
./full_match/4/0xCD8c852EB37300f653Cf9336F4B45718b2669bBF/sources/contracts/4_NFTTemplate.sol | Transfers all pending withdrawal balance to the caller. Reverts if the caller is not an authorized minter. IMPORTANT: casting msg.sender to a payable address is only safe if ALL members of the minter role are payable addresses. zero account before transfer to prevent re-entrancy attack | function withdraw() public {
require(
hasRole(MINTER_ROLE, msg.sender),
'Only authorized minters can withdraw'
);
address payable receiver = payable(msg.sender);
uint256 amount = pendingWithdrawals[receiver];
pendingWithdrawals[receiver] = 0;
receiver.transfer(amount);
}
| 12,468,379 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.11;
pragma experimental ABIEncoderV2;
import "deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "deps/@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "deps/@openzeppelin/contracts-upgradeable/math/MathUpgr... | Specify the name of the strategy | function getName() external pure override returns (string memory) {
return "veCVX Voting Strategy";
}
| 1,604,828 |
pragma solidity 0.5.8;
// From: https://github.com/mixbytes/solidity/blob/master/contracts/ownership/multiowned.sol
// Copyright (C) 2017 MixBytes, LLC
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// Unless required by applicab... | Transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0), "Self");
require(_value <= balances[msg.sender], "NSF");
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true... | 13,119,970 |
./partial_match/4/0x1F75b29F849185e8B57E24Fe6fAb09c176583942/sources/ChickenChef.sol | Update dev address by the previous dev. | function dev(address _devaddr) public {
require(msg.sender == devaddr, "Chicken.Finance: wrong dev?");
devaddr = _devaddr;
}
| 8,562,359 |
pragma solidity ^0.4.18;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
r... | low level token purchase DO NOT OVERRIDE _beneficiary Address performing the token purchase/ calculate token amount to be created update state | function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
uint256 tokens = _getTokenAmount(weiAmount);
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit ... | 15,871,870 |
./partial_match/56/0x6b5029A52117139D6Cb9011b13A6B03c8Cc8f612/sources/MasterChef.sol | View function to see pending PLTS on frontend. | function pendingPlanet(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accPlanetPerShare = pool.accPlanetPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
... | 11,085,060 |
pragma solidity ^0.4.19;
import 'zeppelin-solidity/contracts/math/SafeMath.sol';
import 'zeppelin-solidity/contracts/crowdsale/distribution/RefundableCrowdsale.sol';
import 'zeppelin-solidity/contracts/crowdsale/distribution/utils/RefundVault.sol';
import 'zeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsa... | Calcurate the token amount to be exchanged. _weiAmount Value in wei to be converted into tokens return the whole number of tokens that can be purchased with the specified _weiAmount/ | function _getTokenAmount(uint256 _weiAmount)
internal
view
returns (uint256)
{
return uint256(_weiAmount.mul(getRate()));
}
| 895,620 |
./full_match/80001/0x5Af8Fce092dc00FdC11D54f0Dae050802C6Be794/sources/Users/famousbirthdays/Sites/mb-contracts/contracts/libs/ERC1155Tradable.sol | return tokenMaxSupply[_id]; | function initialMaxSupply(uint256 _id) public view returns (uint256) {
return tokenInitialMaxSupply[_id];
}
| 9,443,482 |
./full_match/11155111/0x3Be6088eE6F02F5522E6bd80bAE6533874f9D92a/sources/project_/contracts/interfaces/IAccessControl.sol | AccessControl Interface./ | interface IAccessControl {
event RoleAdminChanged(
bytes32 indexed role,
bytes32 indexed previousAdminRole,
bytes32 indexed newAdminRole
);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address in... | 3,821,589 |
./partial_match/1/0x917089b4881B6bAb9358517cB57bFD8a9189C888/sources/WETHelper.sol | bytes4(keccak256(bytes('approve(address,uint256)'))); | function _safeApprove(IERC20 token, address to, uint value) internal {
(bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), '!TransferHelper: APPROVE_FAILED');
}
| 3,723,168 |
pragma solidity ^0.5.10;
import "ds-math/math.sol";
contract TubInterface {
function open() public returns (bytes32);
function join(uint256) public;
function exit(uint256) public;
function lock(bytes32, uint256) public;
function free(bytes32, uint256) public;
function draw(bytes32, uint256) public;
func... | Find best DAI price and find DAI amount to repay Compare prices for ETH/DAI Unwrap and sell ETH for DAI on uniswap Sell WETH for DAI on oasis | function buyBestDaiOffer(
uint256 freeEthAmt,
TokenInterface sai,
TokenInterface weth,
OtcInterface otc,
UniswapExchangeInterface uniswapDai,
TubInterface tub,
bytes32 cup,
uint256 deadline
) internal returns (uint256) {
uint256 oasisDaiExpected = otc.getBuyAmount(address(sai), a... | 6,365,439 |
./partial_match/1/0xE9F0a0a787CEEA82f1c8fE7A783826eBD181e707/sources/packages/contracts-core/contracts/governance/GovernanceRouter.sol | Dispatch calls on a remote chain via the remote GovernanceRouter _destination The domain of the remote chain _calls The calls/ ensure that destination chain has enrolled router format batch message dispatch call message using Nomad | function _callRemote(
uint32 _destination,
GovernanceMessage.Call[] calldata _calls
) internal onlyGovernor onlyNotInRecovery {
bytes32 _router = _mustHaveRouter(_destination);
bytes memory _msg = GovernanceMessage.formatBatch(_calls);
Home(xAppConnectionManager.home()).d... | 15,740,882 |
pragma solidity ^0.4.18;
import "./owned.sol";
import "./FixedSupplyToken.sol";
contract Exchange is owned {
///////////////////////
// GENERAL STRUCTURE //
///////////////////////
struct Offer {
uint amountTokens;
address who;
}
struct OrderBook {
uint higherPrice;
... | Offers Length in the Sell Order Book for the Sell Limit Offer Price Entry is increased Add Sell Offer to Sell Order Book under the Price Offered Entry for a Token Symbol Case 1 & 2: New Sell Offer is the First Order Entered or Highest Entry Case 1: First Entry. No Sell Orders Exist `highestSellPrice == 0`. Insert New (... | function addSellOffer(uint8 tokenIndex, uint priceInWei, uint amount, address who) internal {
tokens[tokenIndex].sellBook[priceInWei].offers_length++;
tokens[tokenIndex].sellBook[priceInWei].offers[tokens[tokenIndex].sellBook[priceInWei].offers_length] = Offer(amount, who);
if (tokens[toke... | 1,836,894 |
pragma solidity ^0.4.24;
import "./KAICompany.sol";
import "./ETF.sol";
contract CEngine {
// Mappings
mapping (address => uint256) public balances; // Storing token balances
mapping (address => uint256) public rankings; // Storing rankings
mapping (address => bool) public isClaimed; // Storing cla... | hold sets a company on hold given (company id: _id) | function hold(uint _id) public returns (bool){
companies[_id].hold(msg.sender);
return true;
}
| 13,135,959 |
/**
*Submitted for verification at Etherscan.io on 2021-08-23
*/
// Sources flattened with hardhat v2.6.1 https://hardhat.org
// File @openzeppelin/contracts/utils/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's uintXX/intXX casting operators with ad... | Execute arbitrage params Internal params wethAmountOwing WETH amount owed from flash loan/ if it's the liquidation from NAV to DEX issue ckToken and sell for WETH if it's the liquidation from DEX to NAV buy ckToken and redeem it for components. Sell components for WETH | function _executeArbitrage(bytes calldata params, uint256 wethAmountOwing) internal {
(
address _ckToken,
address _issuanceModule,
uint256 _coverAmount,
uint256 _ckAmountToProcess,
bool _isIssue
) = abi.decode(params, (address, address, uin... | 2,238,307 |
./full_match/80001/0xfA648f03E25206F41b6CFAA6fC0F10DB971321c1/sources/contracts/StreamingFeeModule.sol | Returns true if SetToken must be enabled on the controller and module is registered on the SetToken/ | function isSetValidAndInitialized(ISetToken _setToken) internal view returns(bool) {
return controller.isSet(address(_setToken)) &&
_setToken.isInitializedModule(address(this));
}
| 840,595 |
./partial_match/1/0x31Cc7b6EF2DB2124c6f38Eb0B28Aa642576d28e7/sources/EXTREME.sol | Enables viewing of dev/creator address on Etherscan in the "Contract" > "Read" section | function getDevAddress() public view returns (address) {
return _devAddress;
}
| 3,570,194 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol';
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.... | Delegates voting power of the underlying asset to a `delegatee` address delegatee The address that will receive the delegation/ | function delegateUnderlyingTo(address delegatee) external onlyPoolAdmin {
IDelegationToken(_underlyingAsset).delegate(delegatee);
}
| 68,574 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.7.0;
import "./lib/ReEncryptionValidator.sol";
import "./lib/SignatureVerifier.sol";
import "./StakingEscrow.sol";
import "./proxy/Upgradeable.sol";
import "../zeppelin/math/SafeMath.sol";
import "../zeppelin/math/Math.sol";
/**
* @title Adjudicator
*... | ERC897 - ERC DelegateProxy/ | interface ERCProxy {
function proxyType() external pure returns (uint256);
function implementation() external view returns (address);
}
| 1,393,426 |
/**
* The Consumer Contract Wallet
* Copyright (C) 2018 The Contract Wallet Company Limited
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or... | Step 2: the unique keyhash has to match with the sha256 of (context name + queryId) Step 3: we assume sig1 is valid (it will be verified during step 5) and we verify if 'result' is the prefix of sha256(sig1) Step 4: commitment match verification, keccak256(delay, nbytes, unonce, sessionKeyHash) == commitment in storage... | function oraclize_randomDS_proofVerify__main(bytes proof, bytes32 queryId, bytes result, string context_name) internal returns (bool){
uint ledgerProofLength = 3+65+(uint(proof[3+65+1])+2)+32;
bytes memory keyhash = new bytes(32);
copyBytes(proof, ledgerProofLength, 32, keyhash, 0);
... | 990,917 |
/**
*Submitted for verification at Etherscan.io on 2020-12-23
*/
pragma solidity 0.6.2;
/**
* @dev The contract has an owner address, and provides basic authorization control whitch
* simplifies the implementation of user permissions. This contract is based on the source code at:
* https://github.com/OpenZeppel... | service function to check tokens on wallet and allowance of wallet/ | function walletTokenBalance(address wallet) external view returns(uint256){
return token.balanceOf(wallet);
}
| 2,006,312 |
./partial_match/1/0x00000000Ede6d8D217c60f93191C060747324bca/sources/node_modules/@aperture_finance/uni-v3-lib/src/TickBitmap.sol | Computes the word position and the bit position given a tick. tick The tick for which to compute the position return wordPos The key in the mapping containing the word in which the bit is stored return bitPos The bit position in the word where the flag is stored signed arithmetic shift right | function position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) {
assembly {
wordPos := sar(8, tick)
bitPos := and(tick, 255)
}
}
| 15,622,027 |
./partial_match/1/0x89bc08BA00f135d608bc335f6B33D7a9ABCC98aF/sources/contracts/LoanCore.sol | Mint a borrower and lender note together - easier to make sure they are synchronized. loanId The token ID to mint. borrower The address of the recipient of the borrower note. lender The address of the recipient of the lender note./ | function _mintLoanNotes(
uint256 loanId,
address borrower,
address lender
) internal {
borrowerNote.mint(borrower, loanId);
lenderNote.mint(lender, loanId);
}
| 15,886,973 |
pragma solidity ^0.4.24;
/*
* Creator: KVM (KevCoinmovie)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure retur... | Maximum allowed number of tokens in circulation. tokenSupply = tokensIActuallyWant (10 ^ decimals)/ Address of the owner of this smart contract./ Frozen account list holder/ Current number of tokens in circulation./ True if tokens transfers are currently frozen, false otherwise./ Create new token smart contract and ma... | function KVMToken () {
owner = msg.sender;
}
| 7,901,503 |
pragma solidity ^0.5.0;
interface IMultiSigManager {
function provideAddress(address origin, uint poolIndex) external returns (address payable);
function passedContract(address) external returns (bool);
function moderator() external returns(address);
}
interface ICustodianToken {
function emitTransfer(ad... | return totalUsers in the system. | function totalUsers() public view returns (uint) {
return users.length;
}
| 15,885,140 |
./partial_match/1/0x2F66C5aAF006Bd9c51615D617589C16c0ed35fD3/sources/contracts/mock/MockRouter.sol | Make forge coverage ignore | function testSuccess() public {}
| 4,285,478 |
./partial_match/1/0x7a7d84c3C6db983025c5a6CF931b2137791E68f5/sources/LemoCoin.sol | uint never less than 0. The negative number will become to a big positive number | function approve(address _spender, uint256 _value) public stoppable returns (bool) {
require(_value < c_totalSupply);
c_approvals[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| 2,896,600 |
/**
*Submitted for verification at Etherscan.io on 2021-05-04
*/
/**
*Submitted for verification at Etherscan.io on 2018-07-03
*/
/**
* EURS Token Smart Contract: EIP-20 compatible token smart contract that
* manages EURS tokens.
*/
/*
* Safe Math Smart Contract.
* Copyright (c) 2018 by STSS (Malta) Limited.
... | Allow given spender to transfer given number of tokens from message sender. _spender address to allow the owner of to transfer tokens from message sender _value number of tokens to allow to transfer return true if token transfer was successfully approved, false otherwise/ | function approve (address _spender, uint256 _value)
public delegatable payable returns (bool success) {
return AbstractToken.approve (_spender, _value);
}
| 2,159,784 |
./partial_match/1/0xc87aad6DCCd9b543b7131c93560Df48d0Ea86E8A/sources/EMPTtoken.sol | Returns tokens locked for a specified address for a specified reason at a specified time _user The address whose tokens are locked _reason The reason to query the lock tokens for _time The timestamp to query the lock tokens for/ | function tokensLocked(address _user, bytes32 _reason, uint256 _time) public view returns (uint256 amount){
if (locked[_user][_reason].validity > _time)
amount = locked[_user][_reason].amount;
}
| 2,870,138 |
pragma solidity ^0.4.18;
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;
}
function div(uint256 a, uint256 b) internal pure returns (uint2... | _owner must call this function explicitly to release locked balance in a locked wallet | function releaseLockedBalance() public {
address _owner = msg.sender;
require(address(0) != _owner && lockedBalanceOf(_owner) > 0 && releaseTimeOf(_owner) <= now);
mintToken(_owner, lockedBalanceOf(_owner));
_lockedSupply = SafeMath.sub(_lockedSupply, lockedBalanceOf(_owner));
... | 1,229,065 |
/// @title The main smart contract for Etherprises LLC, Delaware, U.S. (c)2017 Etherprises LLC
/// @author Ville Sundell <contact@etherprises.com>
// This source code is available at https://etherscan.io/address/0x0d47d4aea9da60953fd4ae5c47d2165977c7fbea
// This code (and only this source code, not storage data nor ... | Here the fallback function either creates a new series, or transfers funds to existing one.This is important to implement as call so we can forward gas | function () payable {
if (msg.data.length > 0) {
createSeries(msg.data, 0, "", "", 0x0);
if (latestSeriesForUser[msg.sender].call.value(msg.value)())
DepositMade(latestSeriesForUser[msg.sender], msg.value);
createSeries("", 0, "", "", 0x0);
}
}... | 12,558,405 |
pragma solidity ^0.5.2;
/**
* @title RegistryInterface Interface
*/
interface RegistryInterface {
function logic(address logicAddr) external view returns (bool);
function record(address currentOwner, address nextOwner) external;
}
/**
* @title Address Registry Record
*/
contract AddressRecord {
/**... | sets new owner/ | function setOwner(address nextOwner) public auth {
RegistryInterface(registry).record(owner, nextOwner);
owner = nextOwner;
emit LogSetOwner(nextOwner);
}
| 12,881,169 |
/*
👉Discord: https://discord.gg/Z2PEVrGuwg
👉Twitter: https://twitter.com/_JesusDAO
👉TG Channel: https://t.me/JesusDaoChannel
👉TG: https://t.me/JesusDaoGlobal
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual return... | : withdraws taxes to the contract owner/ | function withdrawTaxes() external onlyOwner {
uint256 amount = balanceOf(address(this));
require(amount > 0, "Nothing to withdraw");
_transfer(address(this), msg.sender, amount);
}
| 10,234,055 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {MerkleProof} from "@openzeppe... | Update trading rewards with a new merkle root It automatically increments the currentRewardRound/ | function updateTradingRewards(uint256 newMaximumAmountPerUser) external onlyOwner {
currentRewardRound++;
maximumAmountPerUserInCurrentTree = newMaximumAmountPerUser;
emit UpdateTradingRewards(currentRewardRound);
}
| 902,006 |
./full_match/1/0x4d541a79C2c1A9E88728CE4cAF98be579a4fe507/sources/contracts/StakingHolder.sol | _stake(from, tokenId); | function onERC721Received(
address,
address,
uint256,
bytes calldata
) pure external override returns (bytes4){
return this.onERC721Received.selector;
}
| 4,969,201 |
pragma solidity 0.6.12;
import "./Enum.sol";
import "./ERC165.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// contract Subscription is Enum, ERC165 {
contract Subscription is En... | doing this to make it a view function | function getSubscriptionsForAddress(
address subscriber
) public view returns (
uint[] memory
) {
uint256 numFound = 0;
for(uint i = 0; i < SubscriptionList.length; i++) {
if (SubscriptionList[i].subscriber == subscriber ) {
numFound++;
... | 13,077,514 |
/**
*Submitted for verification at Etherscan.io on 2021-09-14
*/
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens... | Returns the ERC20 token balance of the contract _tokenAddress - token contract address/ | function getContractTokenBalance(address _tokenAddress) public view returns (uint) {
return ERC20(_tokenAddress).balanceOf(address(this));
}
| 8,049,196 |
./partial_match/1/0xa9833D5D3ff75A32709A8dA2E66A7dF9D2c83Aa0/sources/contracts/GeneticChain721.sol | Mint count tokens using securely signed message./ | function secureMint(bytes32 msgHash, bytes memory signature, uint256 allocation, uint256 count, string memory nonce)
external
{
require(!_usedNonces[nonce], "invalid nonce");
require(totalSupply() < tokenMax, "all tokens minted");
require(totalSupply() + count <= tokenMax, "excee... | 4,454,956 |
// File: localhost/SetExchange/common/StaticCaller.sol
pragma solidity ^0.8.3;
/**
* @title StaticCaller
* @author Wyvern Protocol Developers
*/
contract StaticCaller {
function staticCall(address target, bytes memory data) internal view returns (bool result)
{
assembly {
result := st... | Get a location of some free memory and store it in tempBytes as Solidity does for memory variables. The first word of the slice result is potentially a partial word read from the original array. To read it, we calculate the length of that partial word and start copying that many bytes into the array. The first word we ... | function arraySlice(bytes memory _bytes, uint _start, uint _length) internal pure returns (bytes memory){
bytes memory tempBytes;
assembly {
switch iszero(_length)
case 0 {
tempBytes := mload(0x40)
let lengthmod := and(_length, 31)
... | 1,212,443 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol";
/*
Basically this is supposed to be a smart contract that self-regulates masterchef
Inflation is pre-determined with this contract...
It can also be mo... | this can only be called by this smart contract(the rebalancePools function)call the set contract in masterchefif only contract can call then it doesn't really matter, can call them all | function updatePool(int poolID, int allocation, bool massUpdate) {
}
| 1,047,264 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "../core/Common.sol";
import "./IOracle.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/interfaces/IERC165.sol";
/**
* @title Oracle contract
* @dev Implement functionalities of Oracle. Other functional... | @inheritdoc IOracle/ | function getSeasonState(uint16 season)
public
view
override
returns (SeasonState)
{
return seasons[season];
}
| 1,803,358 |
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256 supply);
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(address _to, uint256 _value) ext... | Gets Safe info (collateral, debt) _safeId Id of the Safe _collType CollType of the Safe | function getSafeInfo(uint256 _safeId, bytes32 _collType)
public
view
returns (uint256, uint256)
{
(uint256 collateral, uint256 debt) =
safeEngine.safes(_collType, safeManager.safes(_safeId));
(, uint256 rate, , , , ) = safeEngine.collateralTypes(_collType);
... | 6,312,113 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.