file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces... | Update project info _info Struct of name, link, themeId/ | function updateProjectInfo(ProjectInfo calldata _info) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(bytes(info.name).length != 0, "Must set name");
require(info.themeId > 0 && info.themeId < 10, "Wrong theme id");
info = _info;
}
| 51,404 |
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;
/**
* ... | Contract that will work with ERC223 tokens. | interface ERC223ReceivingInterface {
function tokenFallback(address _from, uint _value, bytes _data) external;
}
| 1,265,483 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than a... | Deposit Ether into the payment channel, creating the account if none exists yet Create the account by setting the nonce to 1 | function deposit() onlyUnlocked public payable {
address player = msg.sender;
uint amount = msg.value;
if (accounts[player].nonce == 0) {
accounts[player].nonce = 1;
}
increaseBalance(player, amount);
emit Deposit(player, balanceOf(player));
}
| 2,522,572 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
pragma experimental ABIEncoderV2;
// Interfaces.
import '../interfaces/IERC20.sol';
import '../interfaces/IAssetHandler.sol';
import '../interfaces/IAddressResolver.sol';
import '../interfaces/Mobius/ISwap.sol';
import '../interfaces/Mobius/IMasterMind.sol';
imp... | Returns the amount of MOBI rewards available for the pool in the given farm. _poolAddress Address of the pool. _pid ID of the farm on Mobius. return uint Amount of MOBI available./ | function getAvailableRewards(address _poolAddress, uint _pid) external view override returns (uint) {
require(_poolAddress != address(0), "MobiusAdapter: invalid pool address.");
require(_pid >= 0, "MobiusAdapter: pid must be positive.");
address masterMindAddress = ADDRESS_RESOLVER.getCont... | 12,726,999 |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2017 Loopring Technology Limited.
pragma solidity ^0.7.0;
/// @title Poseidon hash function
/// See: https://eprint.iacr.org/2019/458.pdf
/// Code auto-generated by generate_poseidon_EVM_code.py
/// @author Brecht Devos - <brecht@loopring.org>
library ... | Process the callback logic. | function submitBlocksWithCallbacks(
bool isDataCompressed,
bytes calldata data,
CallbackConfig calldata config
)
external
{
bool performCallback;
if (config.blockCallbacks.length > 0) {
require(config.receivers.le... | 2,137,942 |
./partial_match/1/0x44864937277DB607656e600e5C36304B7279111c/sources/Bitcrore.sol | require(msg.sender == owner); | function burnFrom(address _from, uint256 _value) public onlyOwner returns (bool success) {
require(!frozenAccount[_from]);
emit Burn(_from, _value);
emit Transfer(msg.sender, 0x0 , _value);
return true;
}
| 2,718,157 |
./partial_match/56/0xF2DEE8e1Cd8114F4E63da4C0dB8087BBdcBcB83b/sources/FeeApprover.sol | Dont have a fee when bscVault is sending, or infinite loop And when pair is sending (buys are happening, do not tax on it) | function calculateAmountsAfterFee(
address sender,
address recipient,
uint256 amount
)
public
returns (
uint256 transferToAmount,
uint256 transferToFeeDistributorAmount
)
{
require(paused == false, "FEE APPROVER: Transfers Paused");... | 11,071,430 |
./partial_match/97/0x3957007f09501027790fE06DCadFC123a4CDC8c4/sources/Toilet.sol | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(address sender, address recipient, uint256 amount) internal {
uint256 sendAmount;
sendAmount = amount.sub(_burn);
}
sendAmount = amount.sub(_burn);
| 11,440,692 |
./partial_match/3/0x81063d2b1076b0F3F7899280dD8C9a76d17Ef2a5/sources/RigelToken.sol | ------------------------------------------------------------------------ Adds record of addresses with locking period and tokens to lock ------------------------------------------------------------------------ | function _addRecord(address to, uint tokens, uint256 lockingPeriod) private {
records[to].push(LockRecord(lockingPeriod,tokens, false));
}
| 5,088,239 |
./partial_match/1/0x0B579726A389E1E009A4BdFBa093d732edCdE811/sources/contracts/protocol/configuration/ACLManager.sol | @inheritdoc IACLManager | function addAssetListingAdmin(address admin) external override {
grantRole(ASSET_LISTING_ADMIN_ROLE, admin);
}
| 3,987,577 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.1;
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title FakeVault is solely for testing purposes, this contract will
/// already be deployed, but this is a simple... | User can use this function to deposit the vault token and receive the exact number of accepted tokens in return. (Normally this number would be calculated based) on a % share of the pool./ | function withdrawTokens(uint256 _amount, address _user) public {
_burn(address(this), _amount);
bool withdrawSuccess = acceptedToken.transfer(_user, _amount);
require(withdrawSuccess, "FakeVault: Withdraw transfer failed.");
}
| 12,983,049 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "../../utils/Whitelistable.sol";
import "../../rarible/impl/RoyaltiesV2Impl.sol";
import "../../rarible/libs/LibPart.sol";
... | Burn token tokenId (uint256): Numeric identifier of token | function burn(uint256 tokenId) external {
_burn(tokenId);
}
| 12,596,487 |
/*
โโโ โโโโโโโโโโโ โโโ
โโโ โโโโโโโโโโโโโโโโ
โโโ โโโโโโ โโโโโโ
โโโ โโโโโโ โโโโโโ
โโโโโโโโโโโโโโโโโโโโ โโโ
โโโโโโโโโโโโโโโโโโโ โโโ
โโโ โโโโโโโ โโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โโโ โโโ โโโโโโ โโโโโโโ โโโโโโ โโโโโโโโ
โโโ โโโ โโโ... | resolver splits locked deposit between plaintiff & defendant per opinion | function resolveDispute(uint256 index, uint256 plaintiffAward, uint256 defendantAward, string calldata opinion) external { | 5,351,092 |
./full_match/5/0xD30CcAe468024de230Bc20A6C334Ae80Ac630a8F/sources/contracts/messagePassingBridge/MessagePassingBridge.sol | Bridges tokens from one chain to another, this performs minting or unlock from The address to bridge tokens from target The address to bridge tokens to normalizedAmount The amount of tokens to bridge sourceChainId The chain ID of the source chain id The ID of the transfer/make it easier to find out for relayers ab... | ) internal {
if (_toLzChainId(sourceChainId) == 0) revert UNSUPPORTED_CHAIN(sourceChainId);
if (disabledSourceBridges[keccak256(abi.encode(sourceChainId, bridge))])
revert BRIDGE_LIMITS('source disabled');
if (executedRequests[id]) revert ALREADY_EXECUTED(id);
_enforceL... | 1,909,615 |
pragma solidity ^0.8.0;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves... | Transfer to pair from non-router address is a sell swap | function _isSell(address sender, address recipient) internal view returns (bool) {
return sender != address(uniswapV2Router) && recipient == address(uniswapV2Pair);
}
| 374,335 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "contracts/interfaces/IAMM.sol";
import "contracts/interfaces/IERC20.sol";
import "contracts/interfaces/ILPToken.sol";
import "contracts/interfaces/... | Getter for the paused state of the AMM return true if the AMM is paused, false otherwise/ | function getAMMState() external view returns (AMMGlobalState) {
return state;
}
| 1,493,782 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/Auctoritas/openzeppelin-contracts/blob/main/contracts/token/ERC721/IERC721.sol";
import "https://github.com/Auctoritas/openzeppelin-contracts/blob/main/contracts/token/ERC721/IERC721Receiver.sol";
import "https://github.com/Auctoritas/op... | Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. `_data` is additional data, it has no specified format and it is sent in call to `to`. This internal function is equivalent to {safeTransferFrom}, a... | function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal {
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
_transfer(from, to, tokenId);
}
| 12,749,893 |
pragma solidity >=0.5.6 <0.6.0;
/// @title Shared constants used throughout the Cheeze Wizards contracts
contract WizardConstants {
// Wizards normally have their affinity set when they are first created,
// but for example Exclusive Wizards can be created with no set affinity.
// In this case the affinity... | ERC165Interface https://eips.ethereum.org/EIPS/eip-165 | interface ERC165Interface {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
}
| 2,503,781 |
//Address: 0xbc05e610eaac542bfa64504025413291beb58d36
//Contract name: BluzelleTokenSale
//Balance: 0 Ether
//Verification Date: 1/18/2018
//Transacion Count: 15695
// CODE STARTS HERE
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// Owned - Ownership model... | Returns the number of tokens that the user has purchased. We keep a separate balance from the token contract in case we'd like to do additional sales with new purchase limits. This behavior is different from the base implementation which just checks the token balance from the token contract directly. | function getUserTokenBalance(address _beneficiary) internal view returns (uint256) {
return accountTokensPurchased[_beneficiary];
}
| 5,547,128 |
pragma solidity ^0.4.24;
interface PlayerBookInterface {
function getPlayerID(address _addr) external returns (uint256);
function getPlayerName(uint256 _pID) external view returns (bytes32);
function getPlayerLAff(uint256 _pID) external view returns (uint256);
function getPlayerAddr(uint256 _pID) exter... | generates a random number between 0-99 and checks to see if thats resulted in an airdrop win return do we have a winner?/ | function airdrop()
private
view
returns(bool)
{
uint256 seed = uint256(keccak256(abi.encodePacked((block.timestamp).add(block.difficulty).add((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (now)).add(block.gaslimit).add((uint256(keccak256(abi.encodePacked(msg.sender)))) / (now)).ad... | 1,205,478 |
pragma solidity ^0.4.19;
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @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 (uint... | Create new instance of token contract/ | function createTokenContract() internal returns (MintableToken) {
return MintableToken(0);
}
| 2,199,636 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
/**
* @title UntitledSnakesProject contract.
* @author manuelpires.eth
* @notice An NFT collecti... | Giveaway `_amount` tokens to `_to`. Requirements: - Must be called by the contract owner. - `_amount` must be greater than 0 and less than or equal to {MAX_TOKENS_PER_TX}. - The current supply plus `_amount` must be less than or equal to {MAX_TOKENS_GIVEAWAYS}. _to target address that will receive the tokens. _amoun... | function giveaway(address _to, uint256 _amount) external onlyOwner {
uint256 supply = totalSupply();
require(_amount > 0 && _amount <= MAX_TOKENS_PER_TX, "Invalid giveaway amount");
require(supply + _amount <= MAX_TOKENS_GIVEAWAYS, "Would exceed max giveaway tokens");
for (uint256 ... | 1,041,418 |
./full_match/1/0x1D0977e86c70EAbb5c8fD98DB1B08C6d60caa0C1/sources/contracts/engine/GenArt721CoreV2_ENGINE_FLEX.sol | Updates preferredArweaveGateway to `_gateway`./ | function updateArweaveGateway(
string calldata _gateway
) public onlyWhitelisted {
preferredArweaveGateway = _gateway;
emit GatewayUpdated(ExternalAssetDependencyType.ARWEAVE, _gateway);
}
| 9,648,714 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "./vaults/DesignedVault.sol";
contract MarketingVault is DesignedVault {
constructor(address _tosAddress, uint256 _maxInputOnce)
DesignedVault("Marketing Fund", _tosAddress, _maxInputOnce)
{}
}
//SPDX-License-Identifier: Unlicense
pr... | set max input at once time of whitelist _maxInputOnceTime max input at once time | function setMaxInputOnceTimeWhitelist(uint256 _maxInputOnceTime)
external
onlyOwner
nonZero(_maxInputOnceTime)
nonSame(maxInputOnceTime, _maxInputOnceTime)
{
maxInputOnceTime = _maxInputOnceTime;
}
| 231,967 |
./partial_match/42/0xe284dde18745fA341E969E5AC23E8d4215b72751/sources/TokenExt.sol | Mint `amount` tokens from the caller. See {ERC20-_mint}./ | function mint(address account,uint256 amount) public isOwner {
_mint(account, amount);
}
| 9,106,177 |
./partial_match/1/0x8937a0aB96e07EDbD93cBd473174Fe9B147CdA4F/sources/Get1001Voken2.sol | Returns the VOKEN public-sale contract address./ | function PUBLIC_SALE() public view returns (VokenPublicSale) {
return _PUBLIC_SALE;
}
| 2,673,467 |
./full_match/1/0xd06712108dAcEe3BfEa6BaCe8f6ee8C06491b843/sources/contracts/crosschain/ZunamiForwarder.sol | receive stargate deposit in USDT | function sgReceive(
uint256 _nonce,
bytes memory _payload
) external {
require(
_msgSender() == address(stargateRouter),
"Forwarder: only stargate router can call sgReceive!"
);
require(_srcChainId == gatewayChainId, "Forwarder: wrong source chain... | 16,439,425 |
pragma solidity ^0.4.11;
import "./VotingLib.sol";
import "../Common.sol";
import "./BaseProposal.sol";
contract Withdrawal is BaseProposal {
uint public withdrawalSum;
address public withdrawalWallet;
bool public dxc;
function Withdrawal(address _baseVoting, address _dao, string _name, string _descr... | Delegates request of finishing to the Voting base contract/ | function finish() public {
VotingLib.delegatecallFinish(baseVoting);
if(result.description == "yes") dao.withdrawal(withdrawalWallet, withdrawalSum, dxc);
}
| 12,572,137 |
pragma solidity ^0.4.18;
import "./Controlled.sol";
import "./TokenController.sol";
import "./DeveloperToken.sol";
import "./ExpositoProjectFactory.sol";
import "./EIP20Interface.sol";
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 _amount, address _token, bytes _data) public; ... | `updateValueAtNow` used to update the `balances` map and the `totalSupplyHistory` checkpoints The history of data being updated _value The new number of tokens/ | function updateValueAtNow(Checkpoint[] storage checkpoints, uint _value
) internal {
if ((checkpoints.length == 0)
|| (checkpoints[checkpoints.length - 1].fromBlock < block.number)) {
Checkpoint storage newCheckPoint = checkpoints[ checkpoints.length++ ];
newCheckP... | 5,392,965 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;
// File: witnet-ethereum-bridge/contracts/Request.sol
/**
* @title The serialized form of a Witnet data request
*/
contract Request {
bytes public bytecode;
/**
* @dev A `Request` is constructed around a `bytes m... | Read and consume the next 2 bytes from the buffer as an IEEE 754-2008 floating point number enclosed in an `int32`. Due to the lack of support for floating or fixed point arithmetic in the EVM, this method offsets all values by 5 decimal orders so as to get a fixed precision of 5 decimal positions, which should be OK ... | function readFloat16(Buffer memory _buffer) internal pure returns (int32) {
uint32 bytesValue = readUint16(_buffer);
uint32 sign = bytesValue & 0x8000;
int32 exponent = (int32(bytesValue & 0x7c00) >> 10) - 15;
int32 significand = int32(bytesValue & 0x03ff);
if (exponent == 15) {
significand... | 997,776 |
./full_match/1/0x44D39e215C112c5AEC6a733d691B464aa62b3F85/sources/src/ERC721SeaDrop.sol | Update the public drop data for this nft contract on SeaDrop. Only the owner can use this function. seaDropImpl The allowed SeaDrop contract. publicDrop The public drop data./ Update the public drop data on SeaDrop. | function updatePublicDrop(
address seaDropImpl,
PublicDrop calldata publicDrop
) external virtual override onlyOwner onlyAllowedSeaDrop(seaDropImpl) {
ISeaDrop(seaDropImpl).updatePublicDrop(publicDrop);
}
| 16,441,183 |
./partial_match/4/0x87982cf26664A07d4E36f279427e8Fc9D8798AD3/sources/animalMain.sol | TO DOไฝฟ็จไบๆธไพ็ข็DNA, ๆ็ด, ๅ็ฉ็จฎ้กๅๆ็ฉๅตๆ๏ผๅฏไปฅ้ๅถๆฏๆฌกๅปบ็ซๅ็ฉ้่ฆ่ฑ่ฒปๅคๅฐETH | function createAnimal() public payable {
bytes32 dna;
uint star;
uint roletype;
dna = random();
uint ram =uint(random())% 100;
if (ram <40 ) star =1;
else if (ram <65) star =2;
else if (ram <85) star = 3;
else if (ram <95) star =4;
else star= 5;
... | 8,593,615 |
pragma solidity ^0.5.16;
import "./ComptrollerInterface.sol";
import "./CTokenInterfaces.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
import "./InterestRateModel.sol";
/**
* @title Compound's CToken Contract
* @notice Abstra... | Calculates the exchange rate from the underlying to the CToken This function does not accrue interest before calculating the exchange rate return calculated exchange rate scaled by 1e18/ | function exchangeRateStoredInternal() internal view returns (uint256) {
uint256 _totalSupply = totalSupply;
if (_totalSupply == 0) {
return initialExchangeRateMantissa;
uint256 totalCash = getCashPrior();
uint256 cashPlusBorrowsMinusReserves = sub_(add_(totalCash,... | 333,119 |
./partial_match/1/0xBB8F3F39B86D4e326A1C6e90e6FceED36EF03329/sources/BUNNYGIRLS.sol | Returns the unpacked 'TokenOwnership' struct at 'index'./ | function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
| 2,812,744 |
pragma solidity ^0.4.23;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two ... | withdraw the tokens from the deposit address with charge fee _deposit the deposit address _time the timestamp the withdraw occurs _value the amount of tokens need to be frozen/ depositRepos[_deposit].balance = _balance; | function withdrawWithFee(address _deposit, uint256 _time, uint256 _value) onlyOwner public returns (bool) {
require(_deposit != address(0));
uint256 _balance = tk.balanceOf(_deposit);
require(_value <= _balance);
uint256 frozenAmount = depositRepos[_deposit].frozen;
require... | 9,845,246 |
./full_match/1313161554/0x1E5F52B668434adC1dd69125E6509b1345981EaC/sources/bastion-protocol/contracts/CToken.sol | User redeems cTokens in exchange for the underlying asset Assumes interest has already been accrued up to the current block redeemer The address of the account which is redeeming the tokens redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero) ... | function redeemFresh(address payable redeemer, uint redeemTokensIn, uint redeemAmountIn) internal returns (uint) {
require(redeemTokensIn == 0 || redeemAmountIn == 0, "one of redeemTokensIn or redeemAmountIn must be zero");
RedeemLocalVars memory vars;
(vars.mathErr, vars.exchangeRateManti... | 13,230,775 |
pragma solidity ^0.5.11;
import "../Manager.sol";
interface IBridgeMinterToken {
function transfer(address _to, uint256 _amount) external;
function mint(address _to, uint256 _amount) external;
function transferOwnership(address _owner) external;
function balanceOf(address _addr) external view retur... | Migrate to a new Minter. Only callable by Controller owner _newMinterAddr New Minter address/ Transfer ownership of token to new Minter Transfer current Minter's LPT balance to new Minter Transfer current Minter's ETH balance to new Minter call() should be safe from re-entrancy here because the Controller owner and _n... | function migrateToNewMinter(address _newMinterAddr) external onlyControllerOwner {
require(
_newMinterAddr != address(this) && _newMinterAddr != address(0),
"BridgeMinter#migrateToNewMinter: INVALID_MINTER"
);
IBridgeMinterToken token = IBridgeMinterToken(tokenAddr);... | 13,039,190 |
pragma solidity ^0.4.24;
/**
* @title SpinWinInterface
*/
interface SpinWinInterface {
function refundPendingBets() external returns (bool);
}
/**
* @title AdvertisingInterface
*/
interface AdvertisingInterface {
function incrementBetCounter() external returns (bool);
}
contract SpinWinLibr... | Allow player to claim lottery blocks reward and spend it on lottery blocks/ | function claimLotteryBlocks() public isActive {
require (_lottery.isActive() == true);
require (lotteryBlocksAmount[msg.sender] > 0);
uint256 claimAmount = lotteryBlocksAmount[msg.sender];
lotteryBlocksAmount[msg.sender] = 0;
uint256 claimStatus = 1;
if (!_lottery.claimReward(msg.sender, claimAmount)) {
... | 6,478,573 |
./partial_match/1/0x2E2709043f640392A10488a653885e009acC50d2/sources/NoFiPartyStarter.sol | Can also be used to upgrade the idle contract, but not switch to new DeFi token (ie. iDAI to iUSDC) | function _setIdle(address _idle) internal {
idleToken = _idle;
}
| 3,578,842 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error,... | Exposes the internal next() iterator current The current address return Returns the next address in the list | function next(address current) public view returns (address) {
return addressList.addressMap[current];
}
| 5,985,241 |
./partial_match/56/0xa6fA6ffC386c8456D411CDbf178737d2281E0c6F/sources/StrategyNyanswopLP.sol | Function that puts the funds to work. It gets called whenever someone deposits in the strategy's vault contract. It deposits {lpPair} in the stakingRewards to farm {nya}/ | function deposit() public whenNotPaused {
uint256 pairBal = IERC20(lpPair).balanceOf(address(this));
if (pairBal > 0) {
IStakingRewards(stakingRewards).stake(pairBal);
}
}
| 11,044,825 |
pragma solidity ^0.4.21;
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... | 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(address _from, address _to, uint256 _value) public returns (bool) {
require(now >= FREEZE_END || msg.sender == owner || hasPoolRole(_to) || hasPoolRole(msg.sender));
return super.transferFrom(_from, _to, _value);
}
| 2,163,338 |
/*
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 ... | PRIVILEGED FACTORY FUNCTION. Adds a list of assets to the whitelist _keepers List with keeprs of the assets to whitelist/ | function addKeepers(address[] memory _keepers) external override onlyOwner {
for (uint256 i = 0; i < _keepers.length; i++) {
keeperList[_keepers[i]] = true;
}
}
| 1,627,019 |
pragma solidity ^0.5.8;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/math/Math.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "solidity-bytes-utils/contracts/BytesLib... | Returns whether or not a proposal is in the queue. proposalId The ID of the proposal. return Whether or not the proposal is in the queue./ solhint-disable-next-line not-rely-on-time | function isQueued(uint256 proposalId) public view returns (bool) {
return queue.contains(proposalId) && now < proposals[proposalId].timestamp.add(queueExpiry);
}
| 12,589,512 |
./partial_match/1/0x3bbd0B701755130f14EbB81c8581e1be55eB6B15/sources/contracts/interfaces/IFeeController.sol | ================ Events ================= ================ Fee Setters ================= ================ Fee Getters ================= | interface IFeeController {
event UpdateOriginationFee(uint256 _newFee);
event UpdateRolloverFee(uint256 _newFee);
function setOriginationFee(uint256 _originationFee) external;
function setRolloverFee(uint256 _rolloverFee) external;
function getOriginationFee() external view returns (uint256);
... | 15,971,013 |
./partial_match/1/0xBB13E608888E5D30C09b13F89d27631056161B9F/sources/GNR.sol | `msg.sender` approves `_spender` to spend `_amount` tokens on its behalf. This is a modified version of the ERC20 approve function to be a little bit safer _spender The address of the account able to transfer the tokens _amount The amount of tokens to be approved for transfer return True if the approval was success... | function approve(address _spender, uint256 _amount) returns (bool success) {
require(transfersEnabled);
require((_amount==0)||(allowed[msg.sender][_spender]==0));
if (isContract(controller)) {
assert(Controller(controller).onApprove(msg.sender,_spender,_amount));
}
... | 4,122,032 |
./full_match/5/0xACe276A173dDA61AC9C78424F95aD0E77510473F/sources/project_/contracts/RevealTZRKTV2.sol | reveal TZRKT -> DGVEH/ | function revealToDGVEH(uint256 tzrktTokenId) public returns (uint256) {
require(_tzrktContract != address(0), "revealToDGVEH: _tzrktContract is the zero address.");
require(_dgvehContract != address(0), "revealToDGVEH: _dgvehContract is the zero address.");
ITZRKT(_tzrktContract).burn(tzrktTokenId);
uint256 ... | 7,037,309 |
./partial_match/3/0xC6AA9F3C6dB00eE21631ffb25dBF9B7C664dD2B0/sources/Dice.sol | Check Game Players Balance Emit events of this game | function playDiceGame(
address[] memory playerList,
uint256[] memory playerScoreList,
uint256 playAmount,
uint256 gameLength
) public payable onlyOwner returns (bool) {
for (uint256 i = 0; i < gameLength; i++) {
require(
_playerETHBalance[playe... | 5,289,630 |
pragma solidity ^0.4.24;
/*
* Creator: VLC (Volume Coin)
*/
/*
* 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 return... | 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 VLCCoin () {
owner = msg.sender;
}
| 1,187,119 |
./full_match/84531/0xce6525630B6cBC45F7DdC204a59022d8E39f560E/sources/node_modules/_zoralabs/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol | See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length./ | function balanceOfBatch(
address[] memory accounts,
uint256[] memory ids
) public view virtual override returns (uint256[] memory batchBalances) {
uint256 numAccounts = accounts.length;
if (numAccounts != ids.length) {
revert ERC1155_ACCOUNTS_AND_IDS_LENGTH_MISMATCH(... | 11,522,769 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "./VoterStorage.sol";
import "./BallotStorage.sol";
/// @title A city voting smart contract
/// @author Hubert Kdayssi
/// @notice Contract can store voters, set up ballots with elections and issues
/// @custom:experimental This is an experimental contra... | Admin adds multiple voters to voting roll & increases total voter count voterAddresses Addresses of voters to add to voter roll | function addMultipleVoters(address[] memory voterAddresses) public onlyOwner {
for (uint i = 0; i < voterAddresses.length; i++) {
Voter memory newVoter = Voter(voterAddresses[i]);
voterRoll[voterAddresses[i]] = newVoter;
voterCount = voterCount + 1;
}
}
| 12,873,682 |
./partial_match/1/0x98ad9B32dD10f8D8486927D846D4Df8BAf39Abe2/sources/contracts/rebaser/VELORebaser.sol | NOTE: why do we need this to be an actiual person? calculate the Vt, an limit the ranges scale our supply according to formula reset the velocity so we can track the velocity for the next epoch | function rebase() public {
require(block.timestamp >= START_REBASE_AT, "Rebase not allowed yet");
require(block.timestamp - lastRebase >= REBASE_INTERVAL, "Rebase interval not exceeded");
require(msg.sender == tx.origin, "!eoa");
IVELO velo_token = IVELO(VELO);
uint256 Vt = this.getRelativeVelo... | 4,282,402 |
./full_match/11155111/0xf97CF62Dd7d5caff5937ADC34237358ffCEa823E/sources/contracts/interfaces/royalties/IRoyaltyInfo.sol | Interface for EIP-2981: NFT Royalty Standard./ | interface IRoyaltyInfo {
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
| 3,795,287 |
/* / /
* .'<_.-._.'<
* / \ .^.
* ._ | -+- -+- | (_|_)
* r- |\ \ / / //
* /\ \\ : \ -=- / \\
* `. \\.' ___.__`..;... | Team rewards (19.8 tokens) Sale (646.2 tokens) | function _distributeTokens(
address _teamAddress,
address _saleAddress
)
internal
{
_mint(_teamAddress, 19.8 * 1e18);
setWhitelistedSender(_teamAddress, true);
_mint(_saleAddress, 646.2 * 1e18);
setWhitelistedSender(_saleAddress, true);
}
| 1,406,944 |
pragma solidity ^0.5.1;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() ex... | Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend)./ | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "");
uint256 c = a - b;
return c;
}
| 15,860,316 |
./full_match/71401/0xe009B9508b0F30E4596884F96A14124C30fEFDf6/sources/contracts/BadgeToken.sol | calculates the next token ID based on value of _currentTokenId return uint256 for the next token ID/ | function _getNextTokenId() private view returns (uint256) {
return _currentTokenId+1;
}
| 7,100,260 |
./full_match/1/0xBAF3554F94A5Ce912e82B3A442a495eF3a1788B8/sources/Satoru_Contract.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint2... | 3,859,755 |
./full_match/43113/0xaB1211F1eb56B0AFC01E8a01537B0116Edcd8160/sources/contracts/Yeswap.sol | Burn some tokens/ burn the amount move delegates | function burn() external {
require(msg.sender == minterBurner, "YESW::burn: Only the burner can burn");
uint96 amount = balances[minterBurner];
require(amount != 0, "YESW::burn: No YESW token to burn");
balances[minterBurner] = 0;
totalSupply = SafeMath.sub(totalSupply, amo... | 13,191,999 |
pragma solidity 0.6.11;
interface IMainUniLotteryPool
{
function isLotteryOngoing( address lotAddr )
external view returns( bool );
function scheduledCallback( uint256 requestID )
external;
function onLotteryCallbackPriceExceedingGivenFunds(
address lottery, uin... | Set the mapping entry for this lottery address. | function setLotteryCallbackGas(
address lotteryAddr,
uint64 callbackGasLimit,
uint160 totalEtherTransferedForThisOne )
external
poolOnly
{
LotteryGas... | 7,567,994 |
/**
*Submitted for verification at BscScan.com on 2021-10-05
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.5.17;
// Part: IERC20
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function... | Decrease the amount of tokens that an owner has allowed to a spender. spender The address which will spend the funds. subtractedValue The amount of tokens to decrease the allowance by./ | function decreaseAllowance(address spender, uint256 subtractedValue)
external
initialDistributionLock
returns (bool)
{
uint256 oldValue = _allowedFragments[msg.sender][spender];
if (subtractedValue >= oldValue) {
_allowedFragments[msg.sender][spender] = 0;
... | 15,860,645 |
pragma solidity 0.4.24;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a5d6d1c0c3c4cb8bc2c0cad7c2c0e5c6cacbd6c0cbd6dcd68bcbc0d1">[email protected]</a>>
cont... | Internal functions/ Returns if amount is within daily limit and resets spentToday after one day. amount Amount to withdraw. return Returns if amount is under daily limit. | function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
| 15,391,164 |
pragma solidity >=0.4.21 <0.6.0;
// Import the library 'Roles' and SafeMath
//import "../node_modules/openzeppelin-solidity/contracts/access/Roles.sol";
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
// Define a contract 'ContributorRole' to manage this role - add, remove, check
contract ... | Define a function to return article date published | function getArticleDatePublished(uint articleNumber) public view returns (uint datePublished){
articleInfo storage article = allArticles[articleNumber];
uint articleDatePublished = article.datePublished;
return articleDatePublished;
}
| 13,000,582 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
/** @notice This contract is extremely simple. It adds an IPFS Multihash (by it's 3 distinct parts) to a contract.
* @dev It's dependent on a js file (see ../util/multihash.js or you can use an equiv.) takin... | returns an IPFS hash by it's ID number. Note that the Multihash will need to be re-combined, (see ../util/multihash.js). / | function retrieveAgreement(uint _agreementID) public view returns(Multihash memory _agreement) {
(Multihash storage agreement) = (agreements[_agreementID]);
return agreement;
}
| 7,312,834 |
./partial_match/42/0x7f360502325964953B0737c22b2698Ba877fEE9C/sources/Exchanger.sol | Note: We don't need to insist on non-stale rates because effectiveValue will do it for us. Note: We don't need to check their balance as the burn() below will do a safe subtraction which requires the subtraction to not overflow, which would happen if their balance is not sufficient. Burn the source amount Issue their ... | function exchange(
address from,
bytes32 sourceCurrencyKey,
uint sourceAmount,
bytes32 destinationCurrencyKey,
address destinationAddress
)
external
onlyShadowsorSynth
returns (uint amountReceived)
{
require(sourceCurrencyKey != destina... | 8,886,512 |
pragma solidity ^0.5.11;
// solium-disable-next-line
pragma experimental ABIEncoderV2;
import "./interfaces/MReserve.sol";
import "./interfaces/MTicketProcessor.sol";
import "./interfaces/MTicketBrokerCore.sol";
import "./interfaces/MContractRegistry.sol";
import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol... | Returns whether a signature over a ticket hash is valid for a sender _sender Address of sender _sig Signature over `_ticketHash` _ticketHash Hash of the ticket return Boolean indicating whether `_sig` is valid signature over `_ticketHash` for `_sender`/ | function isValidTicketSig(
address _sender,
bytes memory _sig,
bytes32 _ticketHash
) internal pure returns (bool) {
address signer = ECDSA.recover(ECDSA.toEthSignedMessageHash(_ticketHash), _sig);
return signer != address(0) && _sender == signer;
}
| 906,059 |
pragma solidity >0.4.99 <0.6.0;
import "./CAT1400Transfer.sol";
import "./verify-transfer/ICAT1400VerifyTransfer.sol";
import "../CAT1400TokenStorage.sol";
/**
* @title ERC-20 Token methods
* @notice Contains all methods for backward compatibility with ERC-20 standard
* @dev https://theethereum.wiki/w/index.php/ERC2... | tokenHolder Token holder address return Token holder balance/ | function balanceOf(address tokenHolder) public view returns (uint result) {
uint balanceByPartition = 0;
for (uint i = 0; i < partitions.length; i++) {
balanceByPartition = balances[partitions[i]][tokenHolder];
result = result.add(balanceByPartition);
}
}
| 12,911,100 |
pragma solidity ^0.5.1;
import "./SafeMath.sol";
import "./SafeMath8.sol";
import "./IceGlobal.sol";
import "./IceSort.sol";
import "./IceFMSAdv.sol";
/**
* @title Ice Protocol Files / Groups / Users Meta Management System Libray
* @author Harsh Rajat
* @notice Create sorting order for maximizing space utilizati... | Function to initiate requested file transfer in a permissioned manner self is the pointer to the File Struct (IceFMS Library) passed _transfereeEIN is the EIN to which the file will be transferred _transfers is the mapping of all transfers for the transferee's FMS _transferOrderMapping is the mapping of the order o... | function doPermissionedFileTransfer(
File storage self,
uint _transfereeEIN,
mapping (uint => IceGlobal.GlobalRecord) storage _transfers,
mapping (uint => IceSort.SortOrder) storage _transferOrderMapping,
mapping (uint => uint) storage _transferCountMapping,
... | 12,693,919 |
./partial_match/1/0x457cD63bee88ac01f3cD4a67D5DCc921D8C0D573/sources/contracts/abstract/JBPayoutRedemptionPaymentTerminal3_1_1.sol | Allows a project owner to migrate its funds and operations to a new terminal that accepts the same token type. Only a project's owner or a designated operator can migrate it. _projectId The ID of the project being migrated. _to The terminal contract that will gain the project's funds. return balance The amount of fu... | function migrate(
uint256 _projectId,
IJBPaymentTerminal _to
)
external
virtual
override
requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.MIGRATE_TERMINAL)
returns (uint256 balance)
{
if (!_to.acceptsToken(token, _projectId)) revert TERMINAL_TOKENS_INCOMPATI... | 4,264,510 |
./full_match/97/0x8a0C9A61d59c3A9135267C57fE2b64f21E6E1Fd9/sources/contracts/LeonicornPairV2.sol | force balances to match reserves | function skim(address to) external lock {
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
| 3,271,962 |
// Sources flattened with hardhat v2.1.1 https://hardhat.org
// File @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol@v3.4.1
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
*... | Function for delisting a NFT from marketplace. Can be called if creator wants to manually removbe the listing, or once the NFT has been bought/ | function _unlistNft(uint256 _nftListingId) internal {
_listedNftTokenIds.remove(_nftListingId);
delete nftListingById[_nftListingId];
emit NftDelisted(_nftListingId);
}
| 1,353,410 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol";
import "@openzeppelin/cont... | Get the version of the current implementation | function getVersion() public pure returns (string memory) {
return "v1.0.0";
}
| 5,473,256 |
/*
Copyright 2019 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | IMetaOracle Set Protocol Interface for operating with any MetaOracle (moving average, bollinger, etc.)/ | interface IMetaOracle {
function read(
uint256 _dataDays
)
external
view
returns (bytes32);
function getSourceMedianizer()
external
view
returns (address);
Copyright 2019 Set Labs Inc.
} | 7,272,320 |
/**
*Submitted for verification at Etherscan.io on 2021-12-20
*/
pragma solidity 0.5.16;
// SPDX-License-Identifier: CC BY-NC-ND 4.0 International - PPS (Protected Public Source) License
// Legal: https://continuousindex.org/docs#legal
//----------------------------------------------------------------------------
/... | ---------------------------------------------------------------------------- IERC20 Ethereum OpenZeppelin Interface /---------------------------------------------------------------------------- | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
fu... | 15,204,093 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract AURUM is IERC20 {
// --- Auth -----------------------
// The original VAI token contract using rely,deny function to add/remove admin address
// This contract will simplify it... | Returns the token name./ | function name() external view returns (string memory) {
return _name;
}
| 5,491,503 |
./full_match/11155111/0xCf89AA0E8DDE4D64982f1d7b25cb80A6F2bC52F4/sources/contracts/periphery/SwapRouter.sol | --/ Token out Exact Tokens out | function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external virtual ensure(deadline) returns (uint256[] memory amounts) {
amounts = SwapLibrary.getAmountsIn(factory, amountOut, path);
... | 3,837,683 |
pragma solidity ^0.5.0;
import "../filesystem/Filesystem.sol";
import "../openzeppelin-solidity/Ownable.sol";
import "../interface/IGameMaker.sol";
import "../interface/IDisputeResolutionLayer.sol";
interface Callback {
function solved(bytes32 taskID, bytes32[] calldata files) external;
function cancelled(by... | Task storage t = tasks[taskID]; | function solverLoses(bytes32 taskID) public returns (bool) {
Solution storage s = solutions[taskID];
if (IDisputeResolutionLayer(disputeResolutionLayer).status(s.currentGame) == uint(Status.ChallengerWon)) {
cancelTask(taskID);
slashOwner(taskID, s.currentChallenger);
... | 1,771,738 |
./partial_match/1/0xB588df69cbc6BE26c193C478b2226E62ef747679/sources/FolloWhale.sol | See {IERC721-approve}./ | function approve(address to, uint256 tokenId) virtual public override {
address owner = ERC721A.ownerOf(tokenId);
if (to == owner) revert ApprovalToCurrentOwner();
if (_msgSender() != owner) if(!isApprovedForAll(owner, _msgSender())) {
revert ApprovalCallerNotOwnerNorApproved();... | 11,027,203 |
./full_match/40/0x290a675668C0374A6D89Fd12f8bAA0e68529A096/sources/scripts/Generator/DeployContracts/sixandup.sol | internal function to from user address where token belongs to user address tokenId number of tokenId | function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
override
onlyAllowedOperator(from)
{
super.safeTransferFrom(from, to, tokenId, data);
}
| 9,552,277 |
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
... | See {IERC721Metadata-tokenURI}./ | function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return
bytes(baseURI).length != 0
... | 13,534,258 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be acces... | Can be used if staking in the STBZ pool | function underlyingAsset() public view returns (address) {
return address(_underlyingPriceAsset);
}
| 481,486 |
./full_match/5/0x583b09559F81656D81dD9AeC42E088Ed5b86631e/sources/project_/contracts/lib/dataHandlers/SaleDataHandler.sol | [Admin] Enables/disables one or more bundles. Disabled bundles cannot be purchased./ | function toggleBundles(uint256[] calldata bundleIds)
external
onlyRole(METAWIN_ROLE)
{
for (uint256 i = 0; i < bundleIds.length; ++i) {
require(
_existsInEnumeration(bundleIds[i]),
"Toggling not-existent bundle"
);
bool ... | 1,930,754 |
./full_match/97/0xE69A7Ee6f1e98262F54E35B563E295c50ba86d9C/sources/project_/contracts/CollectionUnlocker.sol | Returns index of collection if _addr is found in collections array. Also acts as an "isValidCollection" requirement Requiring the collection to be valid ensures that an index for collection _addr exists. | function getCollectionIndex(address _addr) public view returns (uint256) {
require(isValidCollection(_addr), "Invalid collection.");
for (uint256 i = 0; i < collections.length; i++) if (_addr == collections[i]) return i;
}
| 3,283,923 |
pragma solidity ^0.4.21;
/*
* Abstract Token Smart Contract. Copyright © 2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <<span class="__cf_email__" data-cfemail="87eaeeecefe6eeeba9f1ebe6e3eeeaeef5e8f1c7e0eae6eeeba9e4e8ea">[email protected]</span>>
*/
/**
* ERC-20 standard token interface, as defi... | Address of the owner of this smart contract./ True if tokens transfers are currently frozen, false otherwise./ Create new Ponder token smart contract, with given number of tokens issued and given to msg.sender, and make msg.sender the owner of this smart contract./ | function PonderGoldToken () public {
owner = msg.sender;
accounts [msg.sender] = totalSupply();
hasAccount [msg.sender] = true;
accountList.push(msg.sender);
}
| 10,901,607 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "../interfaces/IGauge.sol";
import "../interfaces/IVotingEscrow.sol";
/**
* @dev A utility contract that helps to claims from multiple liquidity gauges.
*/
contract Claimer ... | Updates voting power in multiple gauges. kick works only when there is a new voting event since last checkpoint./ | function kick(address[] memory _gauges) public {
for (uint256 i = 0; i < _gauges.length; i++) {
IGauge(_gauges[i]).kick(msg.sender);
}
}
| 6,408,147 |
//Address: 0x04150b740353f068950d99acbb3ccb7a60c5cfc7
//Contract name: ForgeCDN
//Balance: 0 Ether
//Verification Date: 4/4/2018
//Transacion Count: 4
// CODE STARTS HERE
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two number... | Decrease the amount of tokens that an owner allowed to a spender. _spender The address which will spend the funds. _subtractedValue The amount of tokens to decrease the allowance by./ | function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
allowed[msg.sender][_spender] = oldValue.sub(_subtract... | 2,471,534 |
pragma solidity ^0.8.11;
import {Assert} from "truffle/Assert.sol";
import {DeployedAddresses} from "truffle/DeployedAddresses.sol";
import {AnimalFeeding} from "../contracts/AnimalFeeding.sol";
contract TestAdoption {
// defined in Adoption contract
uint256 constant MAX_ANIMAL = 10; // max number of availabl... | For testAdoptAnimalAlreadyAdopted method only raise an error if called after adoption.adoptAnimal(1). | function raiseAdoptAnimalAlreadyAdopted() public {
adoption.adoptAnimal(1, "Bob");
}
| 1,816,908 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
// use single pragma version for security
import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";
contract raffleLottery is Ownable {
// Owner address of the lottery contract through OpenZepplin
// name of the lottery
string public lott... | found this new looking method for generating a somewhat random numero still uses block timestamp which could be a method of attack for a malicious miner | function generateRandomNumber(uint randNonce) private view returns(uint) {
randNonce++;
return uint(keccak256(abi.encodePacked(block.timestamp, msg.sender, randNonce))) % entryCount;
}
| 5,415,212 |
./full_match/1/0xC383372e5B69fc487374b91298D124820132c567/sources/src/token/erc721/LazyMintAdventureERC721.sol | ERC-165 interface support | function supportsInterface(bytes4 interfaceId) public view virtual override(LazyMintERC721Base, IERC165) returns (bool) {
return
interfaceId == type(IAdventurous).interfaceId ||
super.supportsInterface(interfaceId);
}
| 8,311,139 |
pragma solidity ^0.5.10;
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
... | inject NONSTANDARD NAMING | function GETCONTRIBUTORSLENGTH778() public view returns (uint) { | 13,026,309 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dea... | Returns the current implementation of `proxy`. Requirements: - This contract must be the admin of `proxy`./ We need to manually run the static call since the getter cannot be flagged as view bytes4(keccak256("implementation()")) == 0x5c60da1b | function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {
(bool success, bytes memory returndata) = address(proxy).staticcall(hex"5c60da1b");
require(success);
return abi.decode(returndata, (address));
}
| 18,597 |
// SPDX-License-Identifier: MIT
// File: Context.sol
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
... | Set the time when the tokens are released. Cannot be changed during the voting timelock./ | function setReleaseTime(uint256 newReleaseTime) public onlyOwner {
require(block.timestamp >= _releaseTime, "TrenderingDAOvoteAGAINST: current time is before release time");
_releaseTime = newReleaseTime;
}
| 10,674,637 |
./partial_match/1/0x4e9bBd716E045D2bA93a0cdf0e7aF7F34B9a4745/sources/CbmToken.sol | ํ ํฐ์ ๊ตฌ์
ํ๊ธฐ ์ํด Qtum์ ์
๊ธ๋ฐ๋๋ค. _beneficiary ํ ํฐ์ ๋ฐ๊ฒ ๋ ์ง๊ฐ์ ์ฃผ์/ ์ฃผ์ ํ์ธ ํฌ๋ผ์ฐ๋ ์ธ์ผ ์ปจํธ๋ ํธ์ ํ ํฐ ์ก๊ธ ๊ธฐ๋ฅ์ด ์ ์ง๋์ด์์ผ๋ฉด ํ๋งคํ์ง ์๋๋ค ๋ชฉํ ๊ธ์ก์ ๋์ด์์ง ๋ชปํ๋๋ก ํ๋ค ํฌ์์์ ์์ฐ์ ์
๋ฐ์ดํธํ๋ค ์ด์ก๋ค์ ์
๋ฐ์ดํธํ๋ค ํ์ดํธ๋ฆฌ์คํธ์ ๋ฑ๋ก๋์ด์์ผ๋ฉด ๋ฐ๋ก ์ถ๊ธํ๋ค ํ ํฐ ๋ฐํ ์์ฝ ์ด๋ฒคํธ ๋ฐ์ | function buyToken(address _beneficiary) onSale public payable {
require(_beneficiary != 0x0);
bool isLocked = false;
uint timeLock = 0;
(isLocked, timeLock) = tokenReward.isWalletLocked_Send(this);
require(isLocked == false);
uint25... | 2,643,897 |
pragma solidity ^0.6.6;
// SPDX-License-Identifier: MIT
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which i... | one time swap of v2 to v4 tokens amount the amount of tokens to swap/ | function swapv2v4(uint256 amount) external {
require(claimants[msg.sender] >= amount, "not enough whitelisted for u");
claimants[msg.sender] = claimants[msg.sender].sub(amount);
ERC20 b2 = ERC20(v2);
ERC20 v4 = ERC20(token);
uint256 balance = b2.balanceOf(msg.sender)... | 1,424,840 |
./full_match/1/0xdca0641e507709FFE7e1e532533aC84e2c27c4bF/sources/localhost/staking/stake/MixinStake.sol | Moves stake between statuses: 'undelegated' or 'delegated'. Delegated stake can also be moved between pools. This change comes into effect next epoch. from Status to move stake out of. to Status to move stake into. amount Amount of stake to move. Sanity check: no-op if no stake is being moved. handle deleg... | function moveStake(
IStructs.StakeInfo calldata from,
IStructs.StakeInfo calldata to,
uint256 amount
)
external
override
{
address staker = msg.sender;
if (amount == 0) {
return;
}
to.status == IStructs.StakeStatus.UND... | 3,221,303 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Math
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function... | require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to unpause"); | function unpause() onlyOwner public virtual {
_unpause();
}
| 5,951,788 |
/*
* Origin Protocol
* https://originprotocol.com
*
* Released under the MIT license
* https://github.com/OriginProtocol/origin-dollar
*
* Copyright 2020 Origin Protocol, Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files ... | 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./ If the account is non rebasing and doesn't have a set creditsPerToken then set it i.e. this is a mint from a fresh contract | function _mint(address _account, uint256 _amount) internal {
require(_account != address(0), "Mint to the zero address");
uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));
bool isNonRebasingAccount = _isNonRebasingAddress(_account);
if (isNonRebasingAccount) ... | 210,752 |
pragma solidity ^0.5.17;
// Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/math/SafeMath.sol
// Adapted to use pragma ^0.5.17 and satisfy our linter rules
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
string private constan... | Internal function to get the Court config for a given term _termId Identification number of the term querying the min active balance config of _lastEnsuredTermId Identification number of the last ensured term of the Court return Court config for the given term/ | function _getConfigFor(uint64 _termId, uint64 _lastEnsuredTermId) internal view returns (Config storage) {
uint256 id = _getConfigIdFor(_termId, _lastEnsuredTermId);
return configs[id];
}
| 91,688 |
./full_match/97/0x069e31bf7F6eC37E5DB41456B86A1664F9255ccc/sources/contracts/ERC20/Stake2.sol | return rewardAmount.sub(rewardOut); }ๅฎๆถๆดๆฐๅฅๅฑ๏ผๆฏ12ๅฐๆถๆดๆฐไธๆฌก๏ผไผ ๅ
ฅ12ๅฐๆถ็้ๆฏ้ๆ นๆฎๆ้ๅ้
ๅฅๅฑ | function updateReward(uint256 burnAmount) public {
uint256 totalRewardAmountPool0 = (burnAmount * 5) / 100;
uint256 totalRewardAmountPool1 = (burnAmount * 15) / 100;
uint256 totalRewardAmountPool2 = (burnAmount * 30) / 100;
uint256 totalRewardAmountPool3 = (burnAmount * 50) / 100;
... | 5,032,779 |
./full_match/44787/0x26c0964C568f836470691b7121f85B42f9b7dDea/sources/contracts/NEFTME.sol | console.log("BIDS", bids[_tokenId].length); | function getBids(uint256 _tokenId) public view returns (BidsData memory result) {
result.bids = new Bid[](bids[_tokenId].length);
for (uint256 i = 0; i < bids[_tokenId].length; i++) {
result.bids[i] = bids[_tokenId][i];
}
}
| 13,255,383 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
/**
* @title Crunch Multi Vesting
* @author Enzo CACERES <[emailย protected]>
* @notice Allow the vesting of multiple users using o... | Fake an ERC20-like contract allowing it to be displayed from wallets. return the crunch's decimals value./ | function decimals() external view returns (uint8) {
return crunch.decimals();
}
| 10,082,841 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.