file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0x95B835B8148f11eB3cA05C180d722ed6fEb40f61/sources/YALLA.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("YALLA", "YALLA") {
router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
_isExcludedMaxTransactionAmount[address(router)] = true;
_isExcludedMaxT... | 3,995,792 |
pragma solidity ^0.5.0;
import { UserIdentity } from './UserIdentity.sol';
import '../event/EmitsEvent.sol';
/**
* @title UserProfileManager
* @dev This contract provides us a way to store users profile
* and update them based on the permissions declared.
* 1. dApp Owner (who is also an admin) can create and upda... | Create shop owner profile/ set profile emit success event | function addShopOwnerProfile(address user, string memory firstName,
string memory lastName) private isAdmin stopInEmergency
{
profile[user] = Profile(user, true, firstName, lastName, UserType.ShopOwner);
emitActionSuccess("Shop owner profile created succesfully");
}
| 2,499,277 |
./full_match/42/0x735620c8876c4E65a4019F79b32d33500B17c1b5/sources/contracts/LightGeneralizedTCR.sol | Give a ruling for a dispute. Can only be called by the arbitrator. TRUSTED. Accounts for the situation where the winner loses a case due to paying less appeal fees than expected. _disputeID ID of the dispute in the arbitrator contract. _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Refused to... | function rule(uint256 _disputeID, uint256 _ruling) public {
require(_ruling <= RULING_OPTIONS, "Invalid ruling option");
Party resultRuling = Party(_ruling);
bytes32 itemID = arbitratorDisputeIDToItemID[msg.sender][_disputeID];
Item storage item = items[itemID];
Request stor... | 16,245,616 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerableUpgradeable is... | returns `be((b+c-e)m+en) > (b+c-e)x(b+c-e(1-n))(1-m)`/ given the restrictions above, everything below can be declared `unchecked` | function affordableSurplus(
) private pure returns (bool) {
Uint512 memory lhs = MathEx.mul512(b * e, (f * m + e * n) * M);
Uint512 memory rhs = MathEx.mul512(f * x, (f * M + e * n) * (M - m));
}
| 10,394,524 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
contract FilterArray {
function removeZerosFromArray() external view returns (uint256[] memory) {
uint256[] memory uintArray = new uint256[](5);
uintArray[0] = 1;
uintArray[1] = 0;
uintArray[2] = 3;
uintArray[3] = 0;
... | Manually truncate array | function removeZerosFromArray() external view returns (uint256[] memory) {
uint256[] memory uintArray = new uint256[](5);
uintArray[0] = 1;
uintArray[1] = 0;
uintArray[2] = 3;
uintArray[3] = 0;
uintArray[4] = 44;
uint256 currentIdx;
for (
... | 2,496,737 |
pragma solidity ^0.5.4;
import './PhoenixEscrow.sol';
import './PhoenixTokenTestnetInterface.sol';
import './IdentityRegistryInterface.sol';
import './RandomizerInterface.sol';
// Rinkeby testnet addresses
// PhoenixToken: 0x2df33c334146d3f2d9e09383605af8e3e379e180
// IdentityRegistry: 0xa7ba71305bE9b2DFEad947dc0E573... | Returns all the lottery ids return uint256[] The array of all lottery ids | function getLotteryIds() public view returns(uint256[] memory) {
return lotteryIds;
}
| 12,757,158 |
./full_match/100/0x2304b17b5E579D0f874Ff4D21177383Ba2F80d39/sources/src/alliances/AllianceRegistry.sol | console.log("p1 exhausted"); console.log("p2 exhausted"); return (alliance, joinTime); the alliance leave ensure that there is no gap TODO TODO check greater ? TODO check greater ? | function havePlayersAnAllianceInCommon(
address player1,
address player2,
uint256 timestamp
) external view returns (IAlliance alliance, uint96 joinTime) {
Alliances storage p1Alliances = _alliances[player1];
Alliances storage p2Alliances = _alliances[player2];
A... | 14,277,611 |
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import {IHushPool} from "./../Interfaces/IHushPool.sol";
import {IERCHushPool} from "./../Interfaces/IERCHushPool.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IWAToken} from "./../Tokens/WAToken.sol";
import {ProofUtil} from... | Approve tokens WRAP IT! Approve pool | function _deposit(address _pool, uint8 _deposits) internal {
address _waToken = address(IERCHushPool(_pool).token());
IERC20 _aToken = IWAToken(_waToken).aToken();
uint256 depositAmount = IERCHushPool(_pool).depositAmount();
uint256 aTokenAmount =
IWAToken(_waToken).toA... | 7,237,069 |
./full_match/80001/0xb1B79A8A5729DbBF91CBC1dc135B588e36009B17/sources/contracts/WAYSPACE.sol | Number of NFTs the user has minted per address minter to get counts for | function mintedPerAddress(address minter)
external
view
override
returns (IERC721Drop.AddressMintDetails memory)
{
return
IERC721Drop.AddressMintDetails({
presaleMints: presaleMintsByAddress[minter],
publicMints: _numberMinted(m... | 858,132 |
/**
*Submitted for verification at Etherscan.io on 2021-07-22
*/
/*
Website: uPlexa.com
$$$$$$$\ $$\
$$ __$$\ $$ |
$$\ $$\ $$ | $$ |$$ | $$$$$$\ $$\ $$\ $$$$$$\
$$ | $$ |$$$$$$$ |$$ |$$ __$$\ \$$\ $$ |\____$$\
$$ | $$ |$$ ____/ $$ |$$$$$$$$ | \$$$$ / $$$$$$$ |
$$ | $$ |$$ | ... | Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./ | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount)... | 6,678,604 |
./partial_match/1/0xB5eBf5a2fA85C7fD44966EF4F0db2404516e0E25/sources/DharmaSmartWalletImplementationV15Staging.sol | This call is no longer supported./ | function getNextEthForDaiActionID(
uint256 ethToSupply,
uint256 minimumDaiReceived,
address target,
bytes calldata data,
uint256 minimumActionGas
) external view returns (bytes32 actionID) {
revert(_revertReason(33));
}
| 3,908,785 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.1;
pragma abicoder v2;
import {RedirectAll, ISuperToken, IConstantFlowAgreementV1, ISuperfluid} from "./RedirectAll.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./TradeableC... | Register a referral, associating the address of the subscriber with a tokenId refered The address of the referred subscriber tokenId The token to associate this referral tool | function registerReferral(address referred, uint tokenId) external {
require(_ap.referrals[referred] == 0, "ref");
_ap.referrals[referred] = tokenId;
}
| 2,560,383 |
/**
//
IMPORTANT: Developer should update the ISecurityTokenRegistry.sol (Interface) if there is any change in
function signature or addition/removal of the functions from SecurityTokenRegistry & STRGetter contract.
//
*/
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/math/S... | Internal - Removes the owner of a ticker/ | function _deleteTickerOwnership(address _owner, string memory _ticker) internal {
uint256 index = uint256(getUintValue(Encoder.getKey("tickerIndex", _ticker)));
bytes32 ownerKey = Encoder.getKey("userToTickers", _owner);
bytes32[] memory tickers = getArrayBytes32(ownerKey);
assert(in... | 12,533,490 |
pragma solidity ^0.5.2 <0.6.0;
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor... | Decode an RLPItem into an address. This will not work if the RLPItem is a list. self The RLPItem. return The decoded string. | function toAddress(RLPItem memory self)
internal
pure
returns (address data)
{
(, uint256 len) = _decode(self);
require(len <= 20);
return address(toUint(self));
}
| 13,008,374 |
./partial_match/4/0x5d352608ea5dd1f2beF8D6bB31C58b13e659F21D/sources/Blacksmith.sol | Interface of COVER crypto-pumpkin@github/ | interface ICOVER is IERC20 {
function mint(address _account, uint256 _amount) external;
function setBlacksmith(address _newBlacksmith) external returns (bool);
function setMigrator(address _newMigrator) external returns (bool);
}
| 8,723,286 |
./partial_match/1/0xE4dD566b410Fe45db55BD9F5f928269290B0a674/sources/SecurityToken.sol | Stores the changes to the checkpoint objects _checkpoints is the affected checkpoint object array _newValue is the new value that needs to be stored/No checkpoints set yetNo new checkpoints since last update | function adjustCheckpoints(TokenLib.Checkpoint[] storage _checkpoints, uint256 _newValue, uint256 _currentCheckpointId) public {
if (_currentCheckpointId == 0) {
return;
}
if ((_checkpoints.length > 0) && (_checkpoints[_checkpoints.length - 1].checkpointId == _currentCheckpointId... | 4,335,523 |
//File: contracts/lib/ens/AbstractENS.sol
pragma solidity ^0.4.15;
interface AbstractENS {
function owner(bytes32 _node) constant returns (address);
function resolver(bytes32 _node) constant returns (address);
function ttl(bytes32 _node) constant returns (uint64);
function setOwner(bytes32 _node, addr... | Internal function that sets management/ | function _setPermissionManager(address _newManager, address _app, bytes32 _role) internal {
permissionManager[roleHash(_app, _role)] = _newManager;
ChangePermissionManager(_app, _role, _newManager);
}
| 1,637,536 |
// File: @openzeppelin/upgrades/contracts/Initializable.sol
pragma solidity >=0.4.24 <0.7.0;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer... | Remove an existing service type _serviceType - name of service type to remove/ | function removeServiceType(bytes32 _serviceType) external {
_requireIsInitialized();
require(msg.sender == governanceAddress, ERROR_ONLY_GOVERNANCE);
uint256 serviceIndex = 0;
bool foundService = false;
for (uint256 i = 0; i < validServiceTypes.length; i ++) {
i... | 1,231,775 |
./full_match/4/0xF0ADAc0e34A4A1cb0668791f0B81C794af3a52E8/sources/contracts/onchainpizza.sol | Mints new tokens./ | function bakePizza(uint256 _quantity) public payable {
require(msg.value >= PUBLIC_MINT_PRICE, "Payment too low, try .03");
require(totalSupply().add(_quantity) <= MAX_SUPPLY - RESERVED, "Public Sale Exceeded");
require(balanceOf(_msgSender()) <= 20,"Max mints per wallet = 20");
requ... | 682,336 |
./full_match/1/0x533C5c15E073f56860B3091d7f7414f1cf6d4aE3/sources/contracts/ommf/ommfManager.sol | Function to claim a subscription request in wrapped rwa token depositIds The depositIds to be claimed/ Get depositor Check if the depositor is valid | function claimMint_wOMMF(
bytes32[] memory depositIds
) external nonReentrant ifNotPaused(subscriptionPaused) {
uint256 cacheLength = depositIds.length;
for (uint256 i; i < cacheLength; ++i) {
Depositor memory depositor = depositIdToDepositor[depositIds[i]];
if (depositor.priceId == 0) {
... | 3,221,181 |
// File: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/interfaces/V1/IUniswapV1Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV1Factory {
function getExchange(address) external view returns (address);
}
// File: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts... | Orders the contract by its available liquidity self The slice to operate on. return The contract with possbile maximum return/ Check for truncated codepoints Invalid UTF-8 sequence | function orderContractsByLiquidity(slice memory self) internal pure returns (uint ret) {
if (self._len == 0) {
return 0;
}
uint word;
uint length;
uint divisor = 2 ** 248;
uint b = word / divisor;
if (b < 0x80) {
ret = b;
... | 1,744,180 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address spender, address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amou... | Transfer funds from this contract to the owner contract. | function recoverFunds(IERC20 token, uint256 amount) public ownerOnly returns (bool) {
return token.transfer(msg.sender, amount);
}
| 6,370,367 |
./full_match/1/0xc3f2C8F9d5F0705De706b1302B7a039e1e11aC88/sources/contracts/logic/RailgunLogic.sol | Safety check for badly behaving code/ Set safety bit Setup behavior check Execute behavior check solhint-disable-next-line no-inline-assembly | function checkSafetyVectors() external {
StorageSlot
.getBooleanSlot(0x8dea8703c3cf94703383ce38a9c894669dccd4ca8e65ddb43267aa0248711450)
.value = true;
bool result = false;
assembly {
mstore(0, caller())
mstore(32, snarkSafetyVector.slot)
let hash := keccak256(0, 64)
... | 17,076,237 |
./partial_match/1/0x2CA461E4597101cAb27ed4ac9e3f1ceAA480f6de/sources/MultipleArbitrableTransactionWithFee.sol | Appeal an appealable ruling. Transfer the funds to the arbitrator. Note that no checks are required as the checks are done by the arbitrator. _transactionID The index of the transaction./ | function appeal(uint _transactionID) public payable {
Transaction storage transaction = transactions[_transactionID];
arbitrator.appeal.value(msg.value)(transaction.disputeId, arbitratorExtraData);
}
| 2,841,767 |
./full_match/1/0xD8969609d81d4D72dc0a4cF533178Bf72788d9F3/sources/contracts/vaults/roles/Gatekeeperable.sol | solhint-disable-next-line func-name-mixedcase | function __Gatekeeperable_init(address _gatekeeper) internal {
__Context_init();
__Gatekeeperable_init_unchained(_gatekeeper);
}
| 4,964,772 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;
import {MultiRateLimited} from "./MultiRateLimited.sol";
import {IGlobalRateLimitedMinter} from "./IGlobalRateLimitedMinter.sol";
import {CoreRef} from "./../refs/CoreRef.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
/// @n... | the amount of action used before hitting limit replenishes at rateLimitPerSecond per second up to bufferCap | function buffer() public view returns (uint256) {
uint256 elapsed = block.timestamp - lastBufferUsedTime;
return
Math.min(bufferStored + (rateLimitPerSecond * elapsed), bufferCap);
}
If buffer is <= amount either
1. Does a partial mint by the amount remaining in the ... | 308,366 |
... | inject NONSTANDARD NAMING | function _BURNFROM339(address account, uint256 value) internal { | 15,873,307 |
pragma solidity ^0.4.15;
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
contract Equio {
// Store the amount of ETH deposited ... | A helper function for the default function, allowing contracts to interact. Treat near-zero ETH transactions as withdrawal requests. Disallow deposits if kill switch is active. TODO: do we care about this? Why not allow running investment? Only allow deposits if the contract hasn't already purchased the tokens. Update ... | function default_helper() payable {
if (msg.value <= 1 finney) {
withdraw(msg.sender);
require (!kill_switch);
require (!bought_tokens);
balances[msg.sender] += msg.value;
}
}
| 945,640 |
./full_match/4/0xDC87299e69c5d4ACBBa13ecE02eC20b45612c17b/sources/contracts/degendrops.sol | Returns the metadata URI/ | function tokenURI(uint256 _tokenId) public view override returns (string memory) {
}
| 723,386 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import "@openzepp... | Admin function to stake tokens used in case there's leftover tokens in the contract Function differs from adminStake in that it calculates token amounts to stake so as to have all or most of the tokens in the position, and no tokens in buffer balance ; swaps as necessary/ | function adminRebalance(
TokenDetails memory tokenDetails,
PositionDetails memory positionDetails
) public {
(uint256 token0Balance, uint256 token1Balance) =
getBufferTokenBalance(tokenDetails);
token0Balance = getToken0AmountInNativeDecimals(
token0Balanc... | 1,686,752 |
./partial_match/1/0x15E2768B99Ff8F70AA6131e6705af250511003df/sources/ConflictResolution.sol | Set Min Bankroll _minBankRoll new min bank roll./ | function setMinBankRoll(uint _minBankRoll) public onlyOwner {
MIN_BANKROLL = _minBankRoll;
}
| 4,181,623 |
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol | Reads the uint48 at `cdPtr` in calldata. | function readUint48(
CalldataPointer cdPtr
) internal pure returns (uint48 value) {
assembly ("memory-safe") {
value := calldataload(cdPtr)
}
}
| 8,451,681 |
./partial_match/1/0x806Ca46e7df33F6C6f4e28839162F8F85755116A/sources/NFTAuction.sol | Payment is accepted in the following scenarios: (1) Auction already created - can accept ETH or Specified Token --------> Cannot bid with ETH & an ERC20 Token together in any circumstance<------ (2) Auction not created - only ETH accepted (cannot early bid with an ERC20 Token (3) Cannot make a zero bid (no ETH or Toke... | ) internal view returns (bool) {
address auctionERC20Token = nftContractAuctions[_nftContractAddress][
_tokenId
].ERC20Token;
function _isASale(address _nftContractAddress, uint256 _tokenId)
internal
view
returns (bool)
}
function _isWhitelistedSale(a... | 3,894,286 |
./full_match/1/0x1d3560CB6F117c8Ab481738969E639A9820B9D84/sources/browser/HXYF.sol | freeze HXPETH LP tokens to contract, approval needed | function FreezeEthHxpLP(uint amt)
public
{
require(amt > 0, "zero input");
if(isHarvestable(msg.sender, uniETHHXP)){
uint256 interest = calcHarvestRewards(msg.sender, uniETHHXP);
if(interest > 0){
harvest(interest);
}
}
... | 17,166,230 |
// SPDX-License-Identifier: MIT
// “Copyright (c) 2019-2021 1inch
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, mod... | take fee in tokenIn | function swapSimpleMode(
IAggregationExecutor caller,
SwapDescription calldata desc,
bytes calldata data
) public returns (uint256 returnAmount) {
uint256 amount = desc.amount;
IERC20 srcToken = desc.srcToken;
IERC20 dstToken = desc.dstToken;
require(!_isE... | 9,907,408 |
./partial_match/1/0x03339F0c13a1cBd60949EC5bDA6152ddc1971DAd/sources/ProxyManager.sol | Instantiate a new logic contract implementation_id - bytes32 id of the contract to instantiate. init_data - Bytes data that is passed to the contract's constructor. salt - Salt used for the CREATE2 opcode if 0 use CREATE opcode return clone_address Address of the created clone contract./ | function create(
bytes32 implementation_id,
bytes memory init_data,
bytes32 salt
) public payable onlyOwner returns (address clone_address) {
address implementation = implementations[implementation_id];
require(implementation != address(0), "#F7DE9E64");
require(i... | 15,485,047 |
./full_match/1/0x6d39e47a5Fa7426e6AdBEA0Db707eeafe2C6E376/sources/contracts/RealityProperties.sol | Returns account balance as fractional amount/ | function fractionalBalanceOf(address account, uint256 tokenId) external view returns (uint256){
require(account != address(0), "RealityProperties: balance query for the zero address");
return _fractionalBalances[tokenId][account];
}
| 17,036,851 |
./partial_match/1/0x4b21da40Dd8d9F4363e69A9a1620D7cdb49123be/sources/StakingPools.sol | Gets addressed of referee referred by a referral _poolId The pool to get referral address referral the address of referral to find all its referees return the address array of referees | function getPoolreferee(uint256 _poolId, address referral) external view returns(address[] memory) {
return myreferees[_poolId][referral];
}
| 2,757,063 |
pragma solidity ^0.4.18;
// File: contracts/UidCheckerInterface.sol
interface UidCheckerInterface {
function isUid(
string _uid
)
public
pure returns (bool);
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an own... | Sets new manager/ | function switchManagerAndRemoveOldOne()
external
onlyOwner
{
require(newManager != address(0));
ManagerSwitch(manager, newManager);
manager = newManager;
newManager = address(0);
}
| 1,782,739 |
./full_match/8453/0xE11b93B61f6291d35c5a2beA0A9fF169080160cF/sources/contracts/Router.sol | SWAP requires the initial amount to have already been sent to the first pair | function _swap(uint[] memory amounts, route[] memory routes, address _to) internal virtual {
for (uint i = 0; i < routes.length; i++) {
(address token0,) = sortTokens(routes[i].from, routes[i].to);
uint amountOut = amounts[i + 1];
(uint amount0Out, uint amount1Out) = rout... | 11,538,830 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/ITokenRegistry.sol";
/**
* @title TokenRegistry
* @dev Registry of tokens that Eden supports as stake for voting power
* + their respective conversion formulas
*/
contract TokenRegistry is ITokenRegistry {
/// @notice Current owner... | Remove conversion formula address for token token token address to remove/ | function removeToken(address token) external override onlyOwner {
tokenFormulas[token] = address(0);
emit TokenRemoved(token);
}
| 953,401 |
pragma solidity ^0.4.23;
/**
* @title MerkleProof
* @dev Merkle proof verification based on
* https://github.com/ameensol/merkle-tree-solidity/blob/master/src/MerkleProof.sol
*/
library MerkleProof {
/**
* @dev Verifies a Merkle proof proving the existence of a leaf in a Merkle tree. Assumes that eac... | Extract balance in ETH + SNT from the contract | function retrieveFunds() public onlyController {
uint sntBalance = SNT.balanceOf(address(this));
require(SNT.transfer(msg.sender, sntBalance), "Transfer did not work");
}
| 2,521,209 |
./full_match/3/0x01789f4206bD7631af841Ddf807dae629340b674/sources/browser/GLXY.sol | to caclulate the amounts for recipient and distributer after fees have been applied | ) public view returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount) {
function calculateAmountsAfterFee(
address sender,
address recipient,
uint256 amount
if(UniSwapReciever[recipient] && UniSwapSaleEnds){
uint256 timeNow = block.time... | 8,217,023 |
./full_match/77/0x914330F413E95598FE9FA9e2F4d4472c039113ab/sources/contracts/SelectorTokenGasLimiterManager.sol | Tells the default gas limit to be used in the message execution by the AMB bridge on the other network. return the gas limit for the message execution./ | function requestGasLimit() public view returns (uint256) {
return defaultGasLimit;
}
| 5,049,326 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "./erc1363.sol";
import "./pausable.sol";
import "./managable.sol";
import "./vendorregistry.sol";
import "./imigratablewrappedasset.sol";
import "./imigratablevendorregistry.sol";
/// An ERC1363 (also ERC20) for wrapping MRX on the ethereum or BSC chai... | Pause the process of vendor minting with vendorMint(). | function pause() public isManager virtual
{
_pause();
}
| 7,309,033 |
pragma solidity ^0.4.21;
import "../zeppelin/ownership/Ownable.sol";
import "../zeppelin/token/ERC20/ERC20.sol";
import "../zeppelin/token/ERC20/SafeERC20.sol";
import "../zeppelin/math/SafeMath.sol";
/**
* @title VaultVesting
* @dev A token holder contract that can release its token balance gradually like a
* ty... | Show maximum number allowed to deposit to vault/ | function getVaultLimit() constant external returns (uint256) {
return limitTotalDeposit;
}
| 12,536,107 |
./partial_match/1/0xE672E0E0101A7F58d728751E2a5e6Da5Ff1FDa64/sources/Users/petr/ankr/aws-smart-contracts/legacy/contracts/upgrades/AETH_R21.sol | Allows to transfer any token from this contract. Only operator can call this method. token address of the token. to address that will receive the tokens from this contract./ | function claimTokens(address token, address to, uint256 amount) external onlyOperator {
require(IERC20(token).transfer(to, amount), "AETH: transfer failed");
}
| 2,644,779 |
// this contract will have all the functions required to track ownership of the 721 , this will not change ever
pragma solidity ^0.4.11;
import "./AssetBase.sol";
import "./ERC721.sol";
contract Ownership is AssetBase , ERC721 {
string public name ;
string public symbol ;
function Ownership(string _... | Grant another address the right to transfer a specific lock via transferFrom(). This is the preferred flow for transfering NFTs to contracts. _to The address to be granted transfer approval. Pass address(0) to clear all approvals. _tokenId The ID of the lock that can be transferred if this call succeeds. Required ... | function approve(
address _to,
uint256 _tokenId
) external
{
require(_owns(msg.sender, _tokenId));
_approve(_tokenId, _to);
Approval(msg.sender, _to, _tokenId);
}
| 5,521,735 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "../lendingpool/DataTypes.sol";
import "../credit/CreditSystem.sol";
import "./KyokoMath.sol";
import "./PercentageMath.sol";
import "./ReserveLogic.sol";
import "./GenericLogic.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeabl... | set the address's ccal module credit active status/set user flagset user white set | function setCCALActive(address user, bool active) public onlyCreditManager {
setCCALFlag(user, active);
if (active) {
uint256 userCCALCreditLine = getCCALCreditLine(user);
userCCALCreditLine > 0 ? ccalWhiteSet.add(user) : ccalWhiteSet.remove(user);
ccalWhiteSet.re... | 11,804,977 |
pragma solidity ^0.5.0;
/// @title A smart contract for music curation
/// @author TheGooner93
/// @notice Enables voting mechanisms for users in a single music genre
contract Curator {
/************** variables **********************/
int public genreScore ;
uint public totalTracks ;
int public avera... | Checks if the maximum vote cap for the day is reached userId Address of the user return true if the maximum vote cap for the day for the userId is reached | function _isVoteCapReached(address userId) private view returns(bool){
if(musicMapUsers[userId].dayVoteCount == UserDailyVoteCap){
return true;
return false;
}
}
| 7,237,980 |
// Dependency file: @openzeppelin/contracts/utils/Address.sol
// pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [// importANT]
* ====
* It is unsafe to assume that an a... | PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. _setToken Address of the SetToken contract to add/ | function addSet(address _setToken) external onlyIfInitialized onlyFactory {
require(!isSet[_setToken], "Set already exists");
isSet[_setToken] = true;
sets.push(_setToken);
emit SetAdded(_setToken, msg.sender);
}
| 2,343,054 |
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
import "./Math.sol";
import "./EnumerableMap.sol";
import "./ERC721Enumerable.sol";
import "./ERC1155.sol";
import "./to... | Mint a specific token./ | function mintTokenId(uint256 tokenId) public onlyOwner {
require(!_exists(tokenId), "Sorry, but this token was already minted.");
uint256 first_encounter = block.timestamp;
_safeMint(msg.sender, tokenId);
_pugForceDetails[tokenId] = PugForceDetail(first_encounter);
emit Token... | 6,917,363 |
/// GebLenderFirstResortRewardsVested.sol
// Copyright (C) 2021 Reflexer Labs, INC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your o... | @notify Returns how many descendant tokens are offered for one ancestor token/ | function descendantPerAncestor() public view returns (uint256) {
return stakedSupply == 0 ? WAD : wdivide(stakedSupply, depositedAncestor());
}
| 1,791,060 |
./full_match/80001/0xf6f8f3e1A41d8eb75468CE44BAAE1ca93D1f395c/sources/contracts/SFTMv1.sol | (bool success,) = payable(primarySaleRecipient()).call{value: entryFee - platformFees}(""); if(success) { } | function joinTournament(uint256 _tournamentId) external payable {
Tournament storage tournament = tournaments[_tournamentId];
(address platformFeeRecipient, uint16 platformFeeBps) = getPlatformFeeInfo();
uint256 entryFee = tournament.entryFee;
uint256 platformFees = (entryF... | 868,911 |
// the azimuth logic contract
// https://azimuth.network
pragma solidity 0.4.24;
////////////////////////////////////////////////////////////////////////////////
// Imports
////////////////////////////////////////////////////////////////////////////////
// OpenZeppelin's Ownable.sol
/**
* @title Ownable
* @dev... | exists(): returns true if point _tokenId is active | function exists(uint256 _tokenId)
public
view
returns (bool doesExist)
{
return ( (_tokenId < 0x100000000) &&
azimuth.isActive(uint32(_tokenId)) );
}
| 1,053,711 |
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <=0.8.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... | Get rewards for one day stakedToken Stake amount of the user tokenAddress Reward token address amount Amount to be transferred as reward/ Checks Transfer of rewards Emit state changes | function sendToken(
address userAddress,
address stakedToken,
address tokenAddress,
uint256 amount
) internal {
if (tokenAddress != address(0)) {
require(
IERC20(tokenAddress).balanceOf(address(this)) >= amount,
"SEND : Insuffic... | 92,870 |
pragma solidity ^0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return... | _value = _value.mul(1e18); | function transfer(address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(2 * 32) public returns (bool success){
require(
balances[msg.sender]>=_value
&& _value > 0
&& now > blockedTill[msg.sender]
);
balances[msg.sender] = balances[msg.sender].sub(_v... | 2,558,888 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
// import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// import "@openzeppelin/contracts/utils/Context.sol";
// import "@openzeppelin/contracts/access/Ownable.sol";
// import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
// i... | Allows the DAO to set the amount of Hotfriescoin that is claimed per token ID HotfriescoinDisplayValue The amount of Loot a user can claim. This should be input as the display value, not in raw decimals. If you want to mint 100 Loot, you should enter "100" rather than the value of 100 10^18. | function daoSetHotfriescoinPerTokenId(uint256 HotfriescoinDisplayValue)
public
onlyOwner
{
HotfriescoinDisplayValue = 1243;
HotfriescoinPerTokenId = HotfriescoinDisplayValue * (10**decimals());
}
| 1,469,100 |
pragma solidity ^0.5.0;
///@title Indeed Contract
///@author Chandler De Kock, Iggy Phiri, Juliet Magagula
///@notice the start of the contract
contract IndeedContract{
///@notice structure containing the basic information of the property user
///@param name the name of the property holder
... | a function to where a person can attest to the location and person living at a particular property _propertyOwner an address of the propeerty owner - this must be the address of the person who registered their address incrementing the attestation number of a property given the address of the property owner | function attestToProperty (address _propertyOwner) public returns (uint){
uint propToAttest = addressToProperty[_propertyOwner];
publicProperties[propToAttest].attestation++;
return publicProperties[propToAttest].attestation;
}
| 6,382,967 |
// SPDX-License-Identifier: GPL-3.0
// Amended by HashLips
/**
!Disclaimer!
These contracts have been used to create tutorials,
and was created for the purpose to teach people
how to create smart contracts on the blockchain.
please review this code on your own before using any of
the following ... | Initiate a weekly drop | function newDrop(string memory _newBaseURI, uint256 _newMaxSupply, bool _onlyWhitelisted, address[] calldata _whitelist) external onlyOwner { | 1,457,089 |
/**
*Submitted for verification at Etherscan.io on 2021-07-08
*/
// Sources flattened with hardhat v2.3.0 https://hardhat.org
// File contracts/libraries/Context.sol
// SPDX-License-Identifier: MIT;
pragma solidity >=0.6.0 <=0.8.0;
/*
* @dev Provides information about the current execution context, including the... | Get rewards for one day stakedToken Stake amount of the user tokenAddress Reward token address amount Amount to be transferred as reward/ Checks Transfer of rewards Emit state changes | function sendToken(
address userAddress,
address stakedToken,
address tokenAddress,
uint256 amount
) internal {
if (tokenAddress != address(0)) {
require(
rewardCap[tokenAddress] >= amount,
"SEND : Insufficient Reward Balance"
);
rewardCap[tokenAddress] = rewar... | 1,996,411 |
./partial_match/1/0xeEFe0487f16082cABef73974aD689D3F55544240/sources/PitchHero.sol | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(address from, address to, uint256 tokenId) public virtual {
safeTransferFrom(from, to, tokenId, "");
}
| 2,649,826 |
//Address: 0x61f30fd17eb78e9d65bac0ad0ac79f6e9aa51594
//Contract name: Crowdsale
//Balance: 0 Ether
//Verification Date: 11/10/2017
//Transacion Count: 8
// CODE STARTS HERE
/**
* @title METTA platform token & preICO crowdsale implementasion
* @author Maxim Akimov - <devstylesoftware@gmail.com>
* @author Dmitrii ... | convert bytes to address/ | function bytesToAddress(bytes source) internal returns(address) {
uint result;
uint mul = 1;
for(uint i = 20; i > 0; i--) {
result += uint8(source[i-1])*mul;
mul = mul*256;
}
return address(result);
}
| 12,702,093 |
./full_match/5/0xdC16455c0822cECCd4DD72a259351812262F0cBA/sources/contracts/UniCertify.sol | Adds a new document hash with the given IPFS hash and links it to the student information. This function can only be called by an authorized admin and can only be called once per document hash. | function uploadCertificate(
bytes32 hash,
uint _id,
string calldata _name,
string calldata _image,
string calldata _ipfsHash
) public canAddCert {
assert(
students[hash].blockNumber == 0 && students[hash].timestamp == 0
);
StudentRecord... | 7,039,568 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/math/SafeMath.sol';
contract LunchRestaurant {
using SafeMath for uint256;
event Enter(address indexed user, uint256 amount);
event Leave(address indexed... | Leave the restaurant. Claim back your LUNCHs. | function leave(uint256 _amount) public {
cleanup();
safeLunchTransfer(msg.sender, getPendingReward(msg.sender));
UserInfo storage user = userInfo[msg.sender];
uint256 lessShare = user.share.mul(_amount).div(user.amount);
user.amount = user.amount.sub(_amount);
totalShares = totalShares.sub(les... | 6,402,756 |
./full_match/137/0x458AB744e4557331c0921AF2aBfaf37FD92c68e7/sources/_manifoldxyz/creator-core-solidity/contracts/core/IERC1155CreatorCore.sol | Core ERC1155 creator interface/ | interface IERC1155CreatorCore is ICreatorCore {
function mintBaseNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory);
function mintBaseExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external;
function... | 4,789,732 |
./full_match/97/0x1613b8cc98b200CbD3d43DF3830ff0e043628B51/sources/contracts/AaveTokenV2.sol | returns the delegated power of a user at a certain block user the user/ | function getPowerAtBlock(
address user,
uint256 blockNumber,
DelegationType delegationType
) external override view returns (uint256) {
(
mapping(address => mapping(uint256 => Snapshot)) storage snapshots,
mapping(address => uint256) storage snapshotsCounts,
) = _getDelegationDataBy... | 5,045,837 |
./full_match/1/0xEC7099Fac43e17373CB1178d03F45Bea6d03dBBA/sources/KAPES.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("King Of Apes", "KAPES") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair =... | 9,672,822 |
./full_match/1/0xdca0641e507709FFE7e1e532533aC84e2c27c4bF/sources/localhost/staking/sys/MixinScheduler.sol | Moves to the next epoch, given the current epoch period has ended. Time intervals that are measured in epochs (like timeLocks) are also incremented, given their periods have ended. get current timestamp solhint-disable-next-line not-rely-on-time validate that we can increment the current epoch | function _goToNextEpoch()
internal
{
uint256 currentBlockTimestamp = block.timestamp;
uint256 epochEndTime = getCurrentEpochEarliestEndTimeInSeconds();
if (epochEndTime > currentBlockTimestamp) {
LibRichErrors.rrevert(LibStakingRichErrors.BlockTimestampTooLowError(
... | 3,221,217 |
./partial_match/1/0x0429D0A028D6A8a6Ea50eAaCfe1137bB30156E9d/sources/TradeAccounting.sol | Called indirectly by `xSNX.mint` and `xSNX.mintWithSnx` Calculates token price on issuance, including value of escrowed SNX weiPerOneSnx: SNX price in ETH terms snxBalanceBefore: SNX balance pre-mint nonSnxAssetValue: Non-SNX slice of fund totalSupply: xSNX.totalSupply()/ | function calculateIssueTokenPrice(
uint256 weiPerOneSnx,
uint256 snxBalanceBefore,
uint256 nonSnxAssetValue,
uint256 totalSupply
) public view returns (uint256 pricePerToken) {
pricePerToken = calculateNetAssetValueOnMint(
weiPerOneSnx,
snxBalanceB... | 2,670,679 |
pragma solidity 0.4.24;
import "../../../apps/AragonApp.sol";
contract AppStubScriptRunner is AragonApp {
event ReturnedBytes(bytes returnedBytes);
// Initialization is required to access any of the real executors
function initialize() public {
initialized();
}
function runScript(bytes ... | Fill in new bytes array with some dummy data to let us check it doesn't corrupt the script's returned bytes | function runScriptWithNewBytesAllocation(bytes script) public returns (bytes) {
bytes memory returnedBytes = runScript(script, new bytes(0), new address[](0));
bytes memory newBytes = new bytes(64);
uint256 first = uint256(keccak256("test"));
uint256 second = uint256(keccak256("mock... | 5,499,023 |
./partial_match/1/0xC4b79183fc5EDA5AAA794E9324cCAa6035F7aabE/sources/Azaza.sol | Release the gains on every accounts/ | function releaseAll() external {
for (uint256 i = 0; i < _teamLength; i++) {
release(payable(payee(i)));
}
}
| 4,278,613 |
pragma solidity ^0.5.0;
contract BuilderShop {
address[] builderInstances;
uint contractId = 0;
// nifty registry is hard coded
address niftyRegistryContract = 0x6e53130dDfF21E3BC963Ee902005223b9A202106;
modifier onlyValidSender() {
NiftyRegistry nftg_registry = NiftyRegistry(niftyRegistryContr... | Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. This function is deprecated. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of th... | function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
internal returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes4 retval = IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data);
return (retval ==... | 502,774 |
pragma solidity >=0.5.0 <0.7.0;
import "./CheckERC165.sol";
import "./standard/IERC721.sol";
import "./standard/IERC721TokenReceiver.sol";
import "./libraries/SafeMath.sol";
contract TokenERC721 is ERC721, CheckERC165{
using SafeMath for uint256;
//Tokens with owners of 0x0 revert to contract creator, makes ... | Doing the two below manually instead of referring to the external methods saves gasHave to emit an event when a token is burnt | function burnToken(uint256 _tokenId) external{
address owner = ownerOf(_tokenId);
);
burned[_tokenId] = true;
balances[owner]--;
emit Transfer(owner, 0x0, _tokenId);
}
| 952,328 |
pragma solidity ^0.5.0;
contract MultiSig {
/*
*Constant determining the maximum number of wallet owners.
*/
uint constant public MAX_OWNER_COUNT = 3;
/*
* Events
*/
event Submission(uint indexed transactionId);
event Confirmation(address indexed sender, uint indexed transactionId);... | Allows an owner to submit and confirm a transaction. destination Transaction target address. value Transaction ether value. data Transaction data payload. return Returns transaction ID. | function submitTransaction(address destination, uint value, bytes memory data)
public
returns (uint transactionId)
{
require(isOwner[msg.sender]);
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
| 15,803,267 |
./partial_match/4/0x9d3937C6972ef1eA4524Ab75B577abF4a18d9DF7/sources/SoviBattleGround.sol | updateExtraWeight(pid, 2); | function retreatHero(uint256 pid, uint256 tokenId) public checkStart updateReward(msg.sender, pid) {
require(tokenId > 0, "SOVI: heroId error");
UserInfo storage player = _userInfo[pid][msg.sender];
require(player.stakedHeroId == tokenId, "SOVI: unsent hero");
_battleUnit.transferF... | 8,713,431 |
./partial_match/1/0x6944d3e38973C4831dA24E954fbD790c7E688bDd/sources/IzeToken.sol | Adds two numbers, throws on overflow./ | function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a);
return c;
}
| 4,007,523 |
./partial_match/1/0x39dCCA7984B22cCB0347DeEAeEaaEE6e6Ce9ba9F/sources/yBXTBToken.sol | Change Settlement Admin for daily settlements | function changeSettlementAdmin(address _newAddress) external {
require((msg.sender == settlementAdmin) || (msg.sender == owner), "Caller not authorized");
settlementAdmin = _newAddress;
}
| 4,084,342 |
pragma solidity ^0.4.24;
/// @title SafeMath library
/// @dev Math operations with safety checks that throw on error
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(ui... | Issue tokens to account and these tokens will be frozen for a period of time Issue '_value' tokens to the address '_to' and these tokens will be frozen for a period of '_freezePeriod' minutes _to Receiving address _value The amount of frozen token to be issued _freezePeriod Freeze Period(minutes) | function issueAndFreeze(address _to, uint _value, uint _freezePeriod) onlyOwner public {
_transfer(msg.sender, _to, _value);
freezeAccount[_to] = FreezeAccountInfo({
freezeStartTime : now,
freezePeriod : _freezePeriod,
freezeTotal : _value
});
em... | 75,871 |
./full_match/8453/0x1a920B29eBD437074225cAeE44f78FC700B27a5d/sources/contracts/deposit-service/AxelarDepositService.sol | Generates a deposit address for sending an ERC20 token cross-chain | function addressForTokenDeposit(
bytes32 salt,
address refundAddress,
string calldata destinationChain,
string calldata destinationAddress,
string calldata tokenSymbol
) external view returns (address) {
return
_depositAddress(
salt,
... | 11,536,312 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
/// @title MixDAO Alpha Pass
/// @author MilkyTaste @ Ao Collaboration Ltd.
/// https://mixdao.club
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./Payable.sol";
contrac... | Update the URI. newuri The new URI for the collection/ | function setURI(string memory newuri) external onlyOwner {
_setURI(newuri);
}
| 1,615,571 |
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 i... | return true if the transaction can buy tokens | function validPurchase() internal view returns (bool) {
bool withinPeriod = (now >= startTimeSale) || ((now >= startTimePresale) && (now < endTimePresale));
bool nonZeroPurchase = msg.value > 0;
return withinPeriod && nonZeroPurchase && !soldOut;
}
| 1,000,420 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
contract ZKTRWhiteListUpgradeableProxy is TransparentUpgradeableProxy {
constructor(address logic, address admin, bytes memory data) TransparentUpgradeableProxy(logic, admin... | Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}./ | function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {
_upgradeToAndCall(newImplementation, data, true);
}
| 49,279 |
pragma solidity ^0.4.19;
/**
* @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) {
if (a == 0) {
return 0;
}
ui... | Add more money to the contract. channelId Identifier of the channel. | function deposit(bytes32 channelId) public payable {
require(canDeposit(channelId, msg.sender));
channels[channelId].value += msg.value;
DidDeposit(channelId, msg.value);
}
| 7,780,602 |
/*
Copyright 2017-2018 RigoBlock, Rigo Investment Sagl.
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 a... | Allows rigoblock dao to change minter _newAddress Address of the new minter | function changeMintingAddress(address _newAddress) external onlyRigoblock {
minter = _newAddress;
}
| 12,657,178 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
/*
CAT BRICKS CLUBHOUSE
@INVADERETH - DEV
@OOFFSETT - ART
@ITSFUJIFUJI - FINANCE
@HUMZAH_ETH - COMMUNITY
@SHARK_IDK - COMMUNITY
@DAKL__ - MARKETING
@1KIWEE - MARKETING
This contract has been insanely gas ... | Withdraw funds for team expenses and payment | function withdraw() external onlyOwner {
require(success, "Failed to send to vault.");
}
| 1,210,794 |
pragma solidity ^0.4.24;
contract F3Devents {
// fired whenever a player registers a name
event onNewName
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
... | distribute share to affiliate 10% distribute share to affiliate 3% | {
uint256 _aff = _eth / 10;
uint256 _affUp = _eth.mul(3) / 100;
function affsend(uint256 _affID, uint256 _pID, uint256 _rID, uint256 _eth, uint256 _p3d)
private
returns(uint256)
if (_affID != _pID && plyr_[_affID].name != '') {
ply... | 11,990,566 |
./full_match/80001/0xdCdf0B3d68A4E11eF2703b87020dC5a9c66babf7/sources/@superfluid-finance/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol | Approves a subscription to an index. The subscriber's real time balance will not update until the subscription is approved, but once approved, the balance will be updated with prior distributions. token Super Token used with the index. publisher Publisher of the index. indexId ID of the index./ | function approveSubscription(
ISuperToken token,
address publisher,
uint32 indexId
) internal returns (bool) {
return approveSubscription(token, publisher, indexId, new bytes(0));
}
| 855,995 |
pragma solidity ^0.5.12;
import "mix-item-store/MixItemStoreRegistry.sol";
import "./MixTokenItemRegistry.sol";
import "./MixTokenInterface.sol";
/**
* @title MixTokenBase
* @author Jonathan Brown <jbrown@mix-blockchain.org>
* @dev Base contract for building MIX tokens.
*/
contract MixTokenBase is MixTokenInterf... | Authorize account to transfer tokens from sender. account Address of account to authorize./ | function authorize(address account) external {
accountAuthorized[msg.sender][account] = true;
emit Authorize(msg.sender, account);
}
| 12,881,029 |
... | inject NONSTANDARD NAMING | function FUNCTIONCALL10(address target, bytes memory data) internal returns (bytes memory) { | 6,417,980 |
// 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 deposits the acceptedToken, and receive vault tokens in return./ | function depositTokens(uint256 _amount, address _vaultPipe) public {
_mint(_vaultPipe, _amount);
}
| 12,983,048 |
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/access/roles/WhitelistedRole.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "../token/ERC1400Raw/IERC1400TokensChecker.sol";
import "erc1820/contracts/ERC1820Clien... | Know the reason on success or failure based on the EIP-1066 application-specific status codes. functionSig ID of the function that needs to be called. partition Name of the partition. operator The address performing the transfer. from Token holder. to Token recipient. value Number of tokens to transfer. data Inf... | function _canTransferByPartition(bytes4 functionSig, bytes32 partition, address operator, address from, address to, uint256 value, bytes memory data, bytes memory operatorData)
internal
view
returns (byte, bytes32, bytes32)
{
if(!IERC1400Partition(msg.sender).isOperatorForPartition(partition, ... | 7,313,914 |
./full_match/4/0x3E6783F36434ea784658C257cf68F8618c11bee3/sources/saitamask/v1-periphery/libraries/SaitamaskV1Library.sol | given some amount of an asset and pair reserves, returns an equivalent amount of the other asset | function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'SaitamaskV1Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'SaitamaskV1Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
... | 12,509,448 |
// SPDX-License-Identifier: MIT
/**
∩~~~~∩
ξ ・×・ ξ
ξ ~ ξ
ξ ξ
ξ “~~~~〇
ξ ξ
ξ ξ ξ~~~ξ ξ ξ
ξ_ξξ_ξ ξ_ξξ_ξ
Alpaca Fin Corporation
*/
pragma solidity 0.6.6;
import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol";
import "@openzeppelin/contracts-ethereum-package/contr... | Set beneficial vault related data including beneficialVaultBountyBps, beneficialVaultAddress, and rewardPath _beneficialVaultBountyBps - The bounty value to update. _beneficialVault - beneficialVaultAddress _rewardPath - reward token path from rewardToken to beneficialVaultToken | function setBeneficialVaultConfig(
uint256 _beneficialVaultBountyBps,
IVault _beneficialVault,
address[] calldata _rewardPath
) external onlyOwner {
require(
_beneficialVaultBountyBps <= 10000,
"WaultSwapWorker02::setBeneficialVaultConfig:: _beneficialVaultBountyBps exceeds 100%"
);
... | 12,640,279 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import './BaseCase.sol';
import './GameBoard.sol';
import 'hardhat/console.sol';
contract CrimeLab is BaseCase {
event GameCreated(uint256 gameId, string name, address creator);
event PlayerJoined(uint256 gameId, address player);
event DieRolled(u... | TODO gameId might not be required for suggestions and accusations | function makeSuggestion(
uint256 _gameId,
uint256 _suspect,
uint256 _weapon
) public returns (bool) {
require(_gameId < games.length, 'Game does not exist');
uint256 numPlayers = game_to_players[_gameId].length;
uint256 activePlayerIndex = (games[_gameId].turn) % numPlayers;
require(gam... | 14,091,568 |
./partial_match/1/0x14cd3e228c96c1b2C1e38633fF4D6575485b17F9/sources/BIT.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("BIT", "BIT") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludedFromMaxWallet(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Fact... | 4,334,409 |
./full_match/56/0xaA04322F2ba8DA3B529aE5816c729Cb6f3058EbB/sources/project_/contracts/TYON.sol | this method is responsible for taking all fee, if takeFee is true | function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) internal {
if (_isLP[sender] || _isLP[recipient]) {
require(
amount >= _minBuysellAmount,
"transfer amount should be greater than minBuys... | 3,248,360 |
pragma solidity ^0.4.19;
/**
* ERC 20 token
* https://github.com/ethereum/EIPs/issues/20
*/
interface Token {
/// @return total amount of tokens
/// function totalSupply() public constant returns (uint256 supply);
/// do not declare totalSupply() here, see https://github.com/OpenZeppelin/zeppelin-solid... | Launch and retire the founder/ | function launch() public onlyFounder {
launched = block.timestamp;
founder = 0x0;
}
| 10,930,313 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgrad... | If we want general proposal where everybody can vote. | function propose(
address[] memory targets,
uint256[] memory values,
bytes32[] memory roles,
string[] memory signatures,
bytes[] memory calldatas,
string memory description
) public virtual returns (uint256) {
for (uint256 i = 0; i < roles.length; ++i) {
... | 13,080,287 |
./partial_match/42/0x017Ad135DCf4A1933d107B334a068cAb9704FA12/sources/HedgeyCallsV1.sol | function to purchase a new call that hasn't changed hands yetlet's make sure we have the right price and the right call isn't already expiredonce all these requirements are met the long can buy the call then | function buyNewCall(uint _c) payable public {
require(call.short != address(0x0));
require(call.expiry > now, "This call is already expired");
require(!call.exercised, "This has already been exercised");
require(call.tradeable, "This isnt tradeable yet");
uint feePymt = (call... | 8,886,665 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.