Unnamed: 0 int64 0 7.36k | comments stringlengths 3 35.2k | code_string stringlengths 1 527k | code stringlengths 1 527k | __index_level_0__ int64 0 88.6k |
|---|---|---|---|---|
126 | // Calculate now if inflation has begun | if(_inflationLastCalcTime > 0) {
return (block.timestamp).sub(_inflationLastCalcTime).div(inflationInterval);
}else{
| if(_inflationLastCalcTime > 0) {
return (block.timestamp).sub(_inflationLastCalcTime).div(inflationInterval);
}else{
| 16,388 |
38 | // Public: signs up the caller as a soulliber/ | function individualSoulliberSignUp(address referee) public whenNotPaused isNotSoulliber(_msgSender()) returns (bool) {
if (referee == zero()) {
referee = router;
}
//Perform check
profs[_msgSender()].referee = referee;
profs[_msgSender()].status[Share.SOULLIBER] = true;
_complete(Categ.IN... | function individualSoulliberSignUp(address referee) public whenNotPaused isNotSoulliber(_msgSender()) returns (bool) {
if (referee == zero()) {
referee = router;
}
//Perform check
profs[_msgSender()].referee = referee;
profs[_msgSender()].status[Share.SOULLIBER] = true;
_complete(Categ.IN... | 45,386 |
1 | // Getters | constructor(
address _want,
uint256 _poolId,
address _pairRouter,
address _governance,
address _strategist,
address _controller,
address _timelock
)
public
| constructor(
address _want,
uint256 _poolId,
address _pairRouter,
address _governance,
address _strategist,
address _controller,
address _timelock
)
public
| 26,037 |
15 | // |
function PPBC_API() { // Constructor: ToDo: obfuscate
|
function PPBC_API() { // Constructor: ToDo: obfuscate
| 11,338 |
94 | // See {IERC721Enumerable-tokenOfOwnerByIndex}.This read function is O(collectionSize). If calling from a separate contract, be sure to test gas first.It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. / | function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
override
returns (uint256)
{
require(index < balanceOf(owner), "ERC721B: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
| function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
override
returns (uint256)
{
require(index < balanceOf(owner), "ERC721B: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
| 48,176 |
2 | // send eth to the depositFunds() function | etherStore.depositFunds{value: 1 ether}();
| etherStore.depositFunds{value: 1 ether}();
| 23,711 |
163 | // 用户剩余未提取BDK,TRX分红 | users[user].bSurplus += users[user].dayMine;
users[user].tSurplus += users[user].dayFund;
| users[user].bSurplus += users[user].dayMine;
users[user].tSurplus += users[user].dayFund;
| 15,100 |
32 | // Allows the upgradeability owner to upgrade the current version of the proxy and call the new implementation to initialize whatever is needed through a low level call._newVersion representing the version name of the new implementation to be set._newImplementation representing the address of the new implementation to ... | function upgradeToAndCall(string calldata _newVersion, address _newImplementation, bytes calldata _data) external payable ifOwner {
_upgradeToAndCall(_newVersion, _newImplementation, _data);
}
| function upgradeToAndCall(string calldata _newVersion, address _newImplementation, bytes calldata _data) external payable ifOwner {
_upgradeToAndCall(_newVersion, _newImplementation, _data);
}
| 46,718 |
11 | // Balances for each account | mapping (address => uint256) balances;
| mapping (address => uint256) balances;
| 6,805 |
113 | // Set start time and end time for Ico. _startTimeIco The Ico start time. _endTimeIco The Ico end time. / | function setStartTimeIco(uint256 _startTimeIco, uint256 _endTimeIco) onlyOwner public {
require(_startTimeIco >= now && _endTimeIco > _startTimeIco && _startTimeIco > preIcoFinishTime);
icoStartTime = _startTimeIco;
icoFinishTime = _endTimeIco;
icoInstalled = true;
}
| function setStartTimeIco(uint256 _startTimeIco, uint256 _endTimeIco) onlyOwner public {
require(_startTimeIco >= now && _endTimeIco > _startTimeIco && _startTimeIco > preIcoFinishTime);
icoStartTime = _startTimeIco;
icoFinishTime = _endTimeIco;
icoInstalled = true;
}
| 2,822 |
41 | // Peterson's Law Protection | event logTokenTransfer(address token, address to, uint amount);
| event logTokenTransfer(address token, address to, uint amount);
| 44,455 |
11 | // ONLY OWNER: Updates redemption fee on IssuanceModule._setToken Instance of the SetToken to update redeem fee for _newFee New redeem fee percentage in precise units (1% = 1e16, 100% = 1e18) / | function updateRedeemFee(ISetToken _setToken, uint256 _newFee)
external
onlyOwner(_setToken)
| function updateRedeemFee(ISetToken _setToken, uint256 _newFee)
external
onlyOwner(_setToken)
| 12,784 |
72 | // Begins iterating over resource records.self The byte string to read from.offset The offset to start reading at. return An iterator object./ | function iterateRRs(bytes memory self, uint offset) internal pure returns (RRIterator memory ret) {
ret.data = self;
ret.nextOffset = offset;
next(ret);
}
| function iterateRRs(bytes memory self, uint offset) internal pure returns (RRIterator memory ret) {
ret.data = self;
ret.nextOffset = offset;
next(ret);
}
| 26,942 |
222 | // ScaleFactor (10e18) - fee | uint256 b = CommonMath.scaleFactor().sub(_feePercentage);
return a.div(b);
| uint256 b = CommonMath.scaleFactor().sub(_feePercentage);
return a.div(b);
| 33,703 |
12 | // Governance may withdraw any amount to any address. _to Address to send funds to. _amount Amount of funds (in Ether) to send. / | function withdraw(address payable _to, uint256 _amount) external onlyGov {
_to.transfer(_amount);
}
| function withdraw(address payable _to, uint256 _amount) external onlyGov {
_to.transfer(_amount);
}
| 67,451 |
0 | // Initializes the contract setting the deployer as the initial registryRegistryAdmin. / | constructor () internal {
address msgSender = _msgSender();
_registryAdmin = msgSender;
emit RegistryManagementTransferred(address(0), msgSender);
}
| constructor () internal {
address msgSender = _msgSender();
_registryAdmin = msgSender;
emit RegistryManagementTransferred(address(0), msgSender);
}
| 14,297 |
6 | // See `UniswapV2Library.sol` | function getReserves(
address pair,
address tokenA,
address tokenB
| function getReserves(
address pair,
address tokenA,
address tokenB
| 16,617 |
209 | // Calculate the shares to mint, new price per share, and currentShareSupply is the total supply of shares currentBalance is the total balance of the vault vaultParams is the struct with vault general data vaultState is the struct with vault accounting statereturn newLockedAmount is the amount of funds to allocate for ... | function rollover(
uint256 currentShareSupply,
uint256 currentBalance,
Vault.VaultParams calldata vaultParams,
Vault.VaultState calldata vaultState
)
external
pure
returns (
uint256 newLockedAmount,
| function rollover(
uint256 currentShareSupply,
uint256 currentBalance,
Vault.VaultParams calldata vaultParams,
Vault.VaultState calldata vaultState
)
external
pure
returns (
uint256 newLockedAmount,
| 71,147 |
17 | // empty fallback payable to allow ETH deposits to the contract | function() public payable{
}
| function() public payable{
}
| 9,632 |
5 | // Allocate space for the buffer data | buf.capacity = capacity;
assembly {
let ptr := mload(0x40)
mstore(buf, ptr)
mstore(0x40, add(ptr, capacity))
}
| buf.capacity = capacity;
assembly {
let ptr := mload(0x40)
mstore(buf, ptr)
mstore(0x40, add(ptr, capacity))
}
| 13,067 |
58 | // disable ico phase in case if that was not disabled yet | icoPhase = false;
regularPhase = true;
| icoPhase = false;
regularPhase = true;
| 16,547 |
9 | // Deploy a new conduit using a supplied conduit key and assigningan initial owner for the deployed conduit. Note that the firsttwenty bytes of the supplied conduit key must match the callerand that a new conduit cannot be created if one has already beendeployed using the same conduit key.conduitKey The conduit key use... | function createConduit(bytes32 conduitKey, address initialOwner)
external
override
returns (address conduit)
| function createConduit(bytes32 conduitKey, address initialOwner)
external
override
returns (address conduit)
| 15,894 |
154 | // Sets the `debtAuction` parameter on Aer after the `delay` has passed./Can only be called by the guardian. After `delay` has passed it can be `execute`'d./debtAuction See. Aer | function setDebtAuction(address debtAuction) external isDelayed {
aer.setParam("debtAuction", debtAuction);
}
| function setDebtAuction(address debtAuction) external isDelayed {
aer.setParam("debtAuction", debtAuction);
}
| 58,164 |
27 | // Fallback function allows to buy ether. | function()
public
| function()
public
| 7,611 |
7 | // The SIX_DAY_EARLY for paying the subscription fee - 6 days in unix timestamp | uint public constant SIX_DAY_EARLY = 518400;
| uint public constant SIX_DAY_EARLY = 518400;
| 1,279 |
72 | // / | uint chance = uint(keccak256(abi.encodePacked(blockhash(block.number - 1), now)));
if(chance % 200 == 0) {// once in 200 times
uint prize = rnd.airdropPot / 2;// win half of the pot, regardless of how much you paid
rnd.airdropPot = rnd.airdropPot / 2;
... | uint chance = uint(keccak256(abi.encodePacked(blockhash(block.number - 1), now)));
if(chance % 200 == 0) {// once in 200 times
uint prize = rnd.airdropPot / 2;// win half of the pot, regardless of how much you paid
rnd.airdropPot = rnd.airdropPot / 2;
... | 46,591 |
67 | // Any wallet owed value that's recorded under `addressToFailedOldOwnerTransferAmount`/ can use this function to withdraw that value. | function withdrawFailedOldOwnerTransferAmount() external whenNotPaused {
uint256 failedTransferAmount = addressToFailedOldOwnerTransferAmount[msg.sender];
require(failedTransferAmount > 0);
addressToFailedOldOwnerTransferAmount[msg.sender] = 0;
totalFailedOldOwnerTransferAmounts -= failedTra... | function withdrawFailedOldOwnerTransferAmount() external whenNotPaused {
uint256 failedTransferAmount = addressToFailedOldOwnerTransferAmount[msg.sender];
require(failedTransferAmount > 0);
addressToFailedOldOwnerTransferAmount[msg.sender] = 0;
totalFailedOldOwnerTransferAmounts -= failedTra... | 4,887 |
13 | // return {[type]} [description] / | function getCurrentMilestone() private constant returns (Milestone) {
uint i;
uint price;
for(i=0; i<milestones.length; i++) {
if(now < milestones[i].time) {
return milestones[i-1];
}
| function getCurrentMilestone() private constant returns (Milestone) {
uint i;
uint price;
for(i=0; i<milestones.length; i++) {
if(now < milestones[i].time) {
return milestones[i-1];
}
| 4,754 |
379 | // Returns number of stages. / | function getNumberStages() external view override returns (uint256) {
return _mintStages.length;
}
| function getNumberStages() external view override returns (uint256) {
return _mintStages.length;
}
| 36,492 |
0 | // Creates a new FCNVault that is owned by the FCNProduct _asset is the address of the underlying asset _tokenName is the name of the token _tokenSymbol is the name of the token symbol / | constructor(address _asset, string memory _tokenName, string memory _tokenSymbol) ERC20(_tokenName, _tokenSymbol) {
asset = _asset;
fcnProduct = FCNProduct(owner());
}
| constructor(address _asset, string memory _tokenName, string memory _tokenSymbol) ERC20(_tokenName, _tokenSymbol) {
asset = _asset;
fcnProduct = FCNProduct(owner());
}
| 42,384 |
21 | // because we want to know how much was received, reentrancy-events is low-risk slither-disable-next-line reentrancy-events | emit Deposited(
asset,
msg.sender,
amount,
amountReceived,
block.timestamp,
initialPenaltyPercent,
commitPeriod,
tokenId
);
| emit Deposited(
asset,
msg.sender,
amount,
amountReceived,
block.timestamp,
initialPenaltyPercent,
commitPeriod,
tokenId
);
| 24,318 |
362 | // Calculates how much token1 is entitled for a particular user | function _fee1Earned(address account, uint256 fee1PerShare_) internal view returns (uint256) {
UserInfo memory user = userInfo[account];
return
balanceOf(account)
.mul(fee1PerShare_.sub(user.token1PerSharePaid))
.unsafeDiv(1e18)
.add(user.token1Rewards... | function _fee1Earned(address account, uint256 fee1PerShare_) internal view returns (uint256) {
UserInfo memory user = userInfo[account];
return
balanceOf(account)
.mul(fee1PerShare_.sub(user.token1PerSharePaid))
.unsafeDiv(1e18)
.add(user.token1Rewards... | 21,670 |
5 | // add owner to whitelist | _addToWhitelist(msg.sender);
| _addToWhitelist(msg.sender);
| 21,333 |
1 | // Event fired whenever a wallet address is added or removed from the list of KYCED wallet | event KYCed(address indexed _user, bool indexed _isValid);
| event KYCed(address indexed _user, bool indexed _isValid);
| 24,587 |
19 | // Emits a {Transfer} event.Requirements: - `sender` cannot be the zero address.- `recipient` cannot be the zero address.- `sender` must have a balance of at least `amount`. / | function _transfer(
address sender,
address recipient,
uint256 amount
)
internal
virtual
{
require(
sender != address(0x0)
| function _transfer(
address sender,
address recipient,
uint256 amount
)
internal
virtual
{
require(
sender != address(0x0)
| 7,876 |
354 | // Aphra Vault (avToken)/Transmissions11 and JetJadeja/Flexible, minimalist, and gas-optimized yield/ aggregator for earning interest on any ERC20 token./changes from original are to rename Rari -> Aphra tokens and any usage of rvToken => avToken | contract Vault is ERC20, Auth {
using SafeCastLib for uint256;
using SafeTransferLib for ERC20;
using FixedPointMathLib for uint256;
/* //////////////////////////////////////////////////////////////
CONSTANTS
/////////////////////////////////////////////////////////... | contract Vault is ERC20, Auth {
using SafeCastLib for uint256;
using SafeTransferLib for ERC20;
using FixedPointMathLib for uint256;
/* //////////////////////////////////////////////////////////////
CONSTANTS
/////////////////////////////////////////////////////////... | 26,000 |
21 | // UPDATE uGOV multiplier | function _updateUGOVMultiplier() internal {
// (1.05/(1+abs(1-TWAP_PRICE)))
uint256 currentPrice = _getTwapPrice();
bool isPriceDiffEnough = false;
// a minimum price variation is needed to update the multiplier
if (currentPrice > lastPrice) {
isPriceDiffEnough =... | function _updateUGOVMultiplier() internal {
// (1.05/(1+abs(1-TWAP_PRICE)))
uint256 currentPrice = _getTwapPrice();
bool isPriceDiffEnough = false;
// a minimum price variation is needed to update the multiplier
if (currentPrice > lastPrice) {
isPriceDiffEnough =... | 13,393 |
117 | // Test function to add shared funds and resources to a tile./ Any ether paid to this function will be added to the shared funds/ of the tile./x X coordinate of tile./y Y coordinate of tile./y Y Resources to add. | function __fundTileAt(
int32 x,
int32 y,
| function __fundTileAt(
int32 x,
int32 y,
| 15,500 |
5 | // check the collection exists | require((collection > 0 && collection <= _collectionCount.current()), "Nonexistant Collection ID");
uint256 id = _tokenIds.current();
artwork[id] = Artwork(hash, collection);
_safeMint(msg.sender, id);
_tokenIds.increment();
collections[collection].count++;
_setTo... | require((collection > 0 && collection <= _collectionCount.current()), "Nonexistant Collection ID");
uint256 id = _tokenIds.current();
artwork[id] = Artwork(hash, collection);
_safeMint(msg.sender, id);
_tokenIds.increment();
collections[collection].count++;
_setTo... | 6,919 |
94 | // Generates an SVG <linearGradient> element based on a points array and stop colors/id The id of the linear gradient/points The encoded points array/stop1 The first stop attribute/stop2 The second stop attribute/ return A <linearGradient> element as bytes | function linearGradient(bytes memory id, bytes memory points, bytes memory stop1, bytes memory stop2) external view returns (bytes memory);
| function linearGradient(bytes memory id, bytes memory points, bytes memory stop1, bytes memory stop2) external view returns (bytes memory);
| 32,976 |
32 | // Sort numerators | uint256 numMax = _numB;
uint256 numMin = _numA;
if (_numA > _numB) {
numMax = _numA;
numMin = _numB;
}
| uint256 numMax = _numB;
uint256 numMin = _numA;
if (_numA > _numB) {
numMax = _numA;
numMin = _numB;
}
| 15,843 |
60 | // Guarantees that _tokenId is a valid Token. _tokenId ID of the NFT to validate. / | modifier validNFToken(
uint256 _tokenId
)
| modifier validNFToken(
uint256 _tokenId
)
| 3,782 |
50 | // Create a new role identifier for the controller role | bytes32 public constant CONTROLLER_ROLE = keccak256("CONTROLLER_ROLE");
| bytes32 public constant CONTROLLER_ROLE = keccak256("CONTROLLER_ROLE");
| 3,026 |
10 | // Add the length of _postBytes to the current length of tempBytes and store it as the new length in the first 32 bytes of the tempBytes memory. | length := mload(_postBytes)
mstore(tempBytes, add(length, mload(tempBytes)))
| length := mload(_postBytes)
mstore(tempBytes, add(length, mload(tempBytes)))
| 19,875 |
33 | // `creationBlock` is the block number that the Clone Token was created | uint public creationBlock;
| uint public creationBlock;
| 19,870 |
29 | // Transfers xTokens in the event of a borrow being liquidated, in case the liquidators reclaims the xToken- Only callable by the MarginPool from The address getting liquidated, current owner of the xTokens to The recipient value The amount of tokens getting transferred / | ) external override onlyMarginPool updateReward(from) updateReward(to) {
// Being a normal transfer, the Transfer() and BalanceTransfer() are emitted
// so no need to emit a specific event here
_transfer(from, to, value, false);
emit Transfer(from, to, value);
}
| ) external override onlyMarginPool updateReward(from) updateReward(to) {
// Being a normal transfer, the Transfer() and BalanceTransfer() are emitted
// so no need to emit a specific event here
_transfer(from, to, value, false);
emit Transfer(from, to, value);
}
| 69,207 |
27 | // Removes given addresses from the active reporters control list./Can only be called from the owner address./Emits the `ReportersUnset` event. /_exReporters List of addresses to be added to the active reporters control list. | function unsetReporters(address[] memory _exReporters)
public
override
onlyOwner
| function unsetReporters(address[] memory _exReporters)
public
override
onlyOwner
| 26,416 |
151 | // Create an instance of Bekk NFT contract / | constructor(
string memory _baseURI,
address[] memory payees,
uint256[] memory shares_
| constructor(
string memory _baseURI,
address[] memory payees,
uint256[] memory shares_
| 45,103 |
3 | // closeRoundBlock to close it. |
LOCKED, // @dev Round is locked, not accepting new bids, waiting to
|
LOCKED, // @dev Round is locked, not accepting new bids, waiting to
| 20,799 |
54 | // Signal the completion of a round and the start of the next by moving RoundId forward one.As clean-up before the round change occurs, join all unclaimed player bonuses together and move themforward one round. Just-in-time initialize the next round's state once RoundId is pointing to it becausean unknown number of rou... | function advanceRound() private {
if (RoundId > 1) {
// Take all of the previous rounds unclaimed bonuses and roll them forward.
Round storage previousRound = Rounds[RoundId.sub(1)];
// If the active player of the previous round didn't claim their refund then they lose the ability to claim... | function advanceRound() private {
if (RoundId > 1) {
// Take all of the previous rounds unclaimed bonuses and roll them forward.
Round storage previousRound = Rounds[RoundId.sub(1)];
// If the active player of the previous round didn't claim their refund then they lose the ability to claim... | 13,887 |
91 | // Verify the canonical block header using the computed sha3Uncles. | assembly {
blobLength := and(calldataload(sub(offset, 30)), 0xffff)
shift := and(calldataload(sub(offset, 28)), 0xffff)
}
| assembly {
blobLength := and(calldataload(sub(offset, 30)), 0xffff)
shift := and(calldataload(sub(offset, 28)), 0xffff)
}
| 38,482 |
90 | // Submit a reference to evidence. EVENT._claimID The index of the claim._evidence A link to an evidence using its URI. / | function submitEvidence(uint256 _claimID, string memory _evidence) public {
Claim storage claim = claims[_claimID];
Transaction storage transaction = transactions[claim.transactionID];
require(claim.status < Status.Resolved, "Must not send evidence if the dispute is resolved.");
em... | function submitEvidence(uint256 _claimID, string memory _evidence) public {
Claim storage claim = claims[_claimID];
Transaction storage transaction = transactions[claim.transactionID];
require(claim.status < Status.Resolved, "Must not send evidence if the dispute is resolved.");
em... | 18,236 |
52 | // proof.PI_Z | mstore(mload(add(proof_ptr, 0x320)), mod(calldataload(add(data_ptr, 0x460)), q))
mstore(add(mload(add(proof_ptr, 0x320)), 0x20), mod(calldataload(add(data_ptr, 0x440)), q))
| mstore(mload(add(proof_ptr, 0x320)), mod(calldataload(add(data_ptr, 0x460)), q))
mstore(add(mload(add(proof_ptr, 0x320)), 0x20), mod(calldataload(add(data_ptr, 0x440)), q))
| 18,195 |
4 | // list of Bitcoin addresses | string[] private bitcoinAddresses;
| string[] private bitcoinAddresses;
| 45,512 |
1 | // These 3 variables below are hard coded for testing purposes only. Can be removed for generic usage. _svg = "<svg xmlns='http:www.w3.org/2000/svg' aria-label='Plex' role='img' viewBox='0 0 512 512'><rect width='512' height='512' rx='15%' fill='282a2d'/><path d='m256 70h-108l108 186-108 186h108l108-186z' fill='e5a00d'... | 3,017 | ||
96 | // add to previous rewards | return (s.rewards + userNewReward);
| return (s.rewards + userNewReward);
| 11,817 |
53 | // Returns the keccak-256 hash of the slice. self The slice to hash.return The hash of the slice. / | function keccak(slice self) internal returns (bytes32 ret) {
assembly {
ret := sha3(mload(add(self, 32)), mload(self))
}
}
| function keccak(slice self) internal returns (bytes32 ret) {
assembly {
ret := sha3(mload(add(self, 32)), mload(self))
}
}
| 3,008 |
106 | // contracts/MplRewards.sol/ pragma solidity 0.6.11; // import "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; // import "lib/openzeppelin-contracts/contracts/math/Math.sol"; // import "lib/openzeppelin-contracts/contracts/math/SafeMath.sol"; // import "lib/openzeppelin-contracts/contracts/token/ERC20/SafeER... | contract MplRewards is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public immutable rewardsToken;
IERC2258 public immutable stakingToken;
uint256 public periodFinish;
uint256 public rewardRate;
uint256 public rewardsDuration;
uint256 public lastUpdate... | contract MplRewards is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public immutable rewardsToken;
IERC2258 public immutable stakingToken;
uint256 public periodFinish;
uint256 public rewardRate;
uint256 public rewardsDuration;
uint256 public lastUpdate... | 11,569 |
169 | // Executes a set of actions and allows composability (contract calls) to other contracts./actions An array with a sequence of actions to execute (see ACTION_ declarations)./values A one-to-one mapped array to `actions`. ETH amounts to send along with the actions./ Only applicable to `ACTION_CALL`, `ACTION_BENTO_DEPOSI... | function cook(
uint8[] calldata actions,
uint256[] calldata values,
bytes[] calldata datas
| function cook(
uint8[] calldata actions,
uint256[] calldata values,
bytes[] calldata datas
| 5,430 |
23 | // Thrown when trying to call as an unauthorized account./ return HN:Common/unauthorized-caller | string public constant UNAUTHORIZED_CALLER =
"HN:Common/unauthorized-caller";
| string public constant UNAUTHORIZED_CALLER =
"HN:Common/unauthorized-caller";
| 21,285 |
61 | // check how many tokens were received after trade execution | uint256 tradeReturn = viewBalance(to, address(this));
require(tradeReturn >= limitAmount, 'Trade returned less than the minimum amount');
| uint256 tradeReturn = viewBalance(to, address(this));
require(tradeReturn >= limitAmount, 'Trade returned less than the minimum amount');
| 2,864 |
96 | // bolean bonus switcher, only called when tokens bonus availability is exhuated terminate bonus | function setBonustoFalse() private returns (string) {
require (bidderBonus == true,"no more bonuses");
bidderBonus = false;
return "tokens exhausted";
}
| function setBonustoFalse() private returns (string) {
require (bidderBonus == true,"no more bonuses");
bidderBonus = false;
return "tokens exhausted";
}
| 11,830 |
24 | // 3Crv Metapools | address pool,
uint256[4] calldata amounts,
uint256 min_mint_amount
) external;
function add_liquidity(
| address pool,
uint256[4] calldata amounts,
uint256 min_mint_amount
) external;
function add_liquidity(
| 40,226 |
23 | // Increase the amount of tokens that an owner allowed to a spender.approve should be called when allowed_[_spender] == 0. To incrementallowed value is better to use this function to avoid 2 calls (and wait untilthe first transaction is mined)From MonolithDAO Token.solEmits an Approval event. spender The address which ... | function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
... | function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
... | 14,136 |
121 | // Accumulated DUCKs per share, times 1e18. See below. | uint public accDuckPerShare;
| uint public accDuckPerShare;
| 30,321 |
5 | // save bytecode by removing implementation of unused method | function _baseURI() internal view virtual override returns (string memory) {}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
return IYokaiChainDescriptor(_tokenDescriptor).to... | function _baseURI() internal view virtual override returns (string memory) {}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
return IYokaiChainDescriptor(_tokenDescriptor).to... | 51,935 |
349 | // If it's not the collateral currency, send the entire balance. | amount = balance;
| amount = balance;
| 5,447 |
33 | // Returns the amount of tokens owned by `account`. / | function balanceOf(address account) external view returns (uint256);
| function balanceOf(address account) external view returns (uint256);
| 3,019 |
55 | // Project Marketing Wallet | Updateable at a later point if necessary | marketingWallet = address(0x94E709272FA55BB86e61C1Ec829Ba04f61128578);
| marketingWallet = address(0x94E709272FA55BB86e61C1Ec829Ba04f61128578);
| 46,615 |
13 | // Cancel a listing. _listingId The ID of the listing to cancel. / | function cancelListing(uint256 _listingId) external;
| function cancelListing(uint256 _listingId) external;
| 27,236 |
123 | // !!!In updates to contracts set new variables strictly below this line!!!----------------------------------------------------------------------------------- | string public codeVersion = "ESW v1.0-137-g7fd1d69";
uint256 public constant MAXIMUM_SUPPLY = 200_000_000e18;
bool public isFirstMinter = true;
address public constant firstMinter =
0xdeb5A983AdC9b25b8A96ae43a65953Ded3939de6; // set to Oracle
address public constant secondMinter =
0x303... | string public codeVersion = "ESW v1.0-137-g7fd1d69";
uint256 public constant MAXIMUM_SUPPLY = 200_000_000e18;
bool public isFirstMinter = true;
address public constant firstMinter =
0xdeb5A983AdC9b25b8A96ae43a65953Ded3939de6; // set to Oracle
address public constant secondMinter =
0x303... | 13,681 |
15 | // mappings/ |
mapping(address => bool) private _isExcludedFromFees; // manage excluding of address from fee
mapping(address => bool) public _isExcludedFromRewardPool; // managing the excluding of user from reward pool
mapping(address => bool) public isEligible; // true if user is in list, false if not
mapping(addres... |
mapping(address => bool) private _isExcludedFromFees; // manage excluding of address from fee
mapping(address => bool) public _isExcludedFromRewardPool; // managing the excluding of user from reward pool
mapping(address => bool) public isEligible; // true if user is in list, false if not
mapping(addres... | 28,922 |
270 | // GrafitiCoin | address private _nctAddress;
event Purchase(uint256 ID, address purchaser);
| address private _nctAddress;
event Purchase(uint256 ID, address purchaser);
| 27,839 |
43 | // The slam-the-button escape hatch. Sells the callers tokens for Ether, then immediately invokes the withdraw() function, sending the resulting Ether to the callers address. | function getMeOutOfHere() public {
sellMyTokens();
withdraw();
}
| function getMeOutOfHere() public {
sellMyTokens();
withdraw();
}
| 10,145 |
1 | // public override | function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
if(block.timestamp < timeByTokenId[tokenId] + 365 days) {
return bytes(yearOneURI).length > 0 ? string(abi.encodePacked(yearOne... | function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
if(block.timestamp < timeByTokenId[tokenId] + 365 days) {
return bytes(yearOneURI).length > 0 ? string(abi.encodePacked(yearOne... | 16,592 |
135 | // burn destroys tokens after taking a fee for the `_feeRecipient`,/ allowing the associated assets to be released on their native/ chain.//_to The address to receive the un-bridged asset. The format of/this address should be of the destination chain./For example, when burning to Bitcoin, _to should be a/Bitcoin addres... | function burn(bytes memory _to, uint256 _amount) public returns (uint256) {
// The recipient must not be empty. Better validation is possible,
// but would need to be customized for each destination ledger.
require(_to.length != 0, "MintGateway: to address is empty");
// Calculate f... | function burn(bytes memory _to, uint256 _amount) public returns (uint256) {
// The recipient must not be empty. Better validation is possible,
// but would need to be customized for each destination ledger.
require(_to.length != 0, "MintGateway: to address is empty");
// Calculate f... | 41,340 |
15 | // ------------------------------------------------------------------------ Claim tokens sent using signatures supplied to the other chain ------------------------------------------------------------------------ |
function verifySigData(bytes memory sigData)
private
returns (TransferData memory)
|
function verifySigData(bytes memory sigData)
private
returns (TransferData memory)
| 12,559 |
54 | // End sale / | function endSale()
external
| function endSale()
external
| 50,004 |
25 | // burn remaining tokens | token.burn(token.balanceOf(this));
FinalizeSale();
| token.burn(token.balanceOf(this));
FinalizeSale();
| 43,585 |
259 | // Calculate the fees a user will have to pay to mint tokens with their collateral collateralAmount Amount of collateral on which fees are calculatedreturn fee Amount of fee that must be paid by the user / | function calculateFee(uint256 collateralAmount)
| function calculateFee(uint256 collateralAmount)
| 51,976 |
3 | // Will return true if oracle already initialized, if oracle has successfully been initialized by this call, or if oracle does not need to be initialized | function initializeOracle(address asset, address compareTo) external returns (bool);
| function initializeOracle(address asset, address compareTo) external returns (bool);
| 42,653 |
12 | // Assert that the given domain has a xApp Router registered and return its address _domain The domain of the chain for which to get the xApp Routerreturn _remote The address of the remote xApp Router on _domain / | function _mustHaveRemote(uint32 _domain)
internal
view
returns (bytes32 _remote)
| function _mustHaveRemote(uint32 _domain)
internal
view
returns (bytes32 _remote)
| 42,574 |
20 | // ``` / | library EnumSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// ... | library EnumSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// ... | 11,975 |
76 | // credit: https:github.com/flamincome/contracts/blob/bfbee3877aa7524408363516ceb2aab0d4527352/implementations/strategy/StrategyBaselineCarbonUniswapBTC.solL57 | address weth = IUniswapV2Router02(uniswapRouterV2).WETH();
| address weth = IUniswapV2Router02(uniswapRouterV2).WETH();
| 30,187 |
87 | // Withdraws the beneficiary&39;s funds. / | function beneficiaryWithdraw() public {
require(state == State.Closed);
beneficiary.transfer(address(this).balance);
}
| function beneficiaryWithdraw() public {
require(state == State.Closed);
beneficiary.transfer(address(this).balance);
}
| 38,645 |
80 | // exclude from max transaction amount | mapping (address => bool) public isExcludedFromTxLimit;
| mapping (address => bool) public isExcludedFromTxLimit;
| 9,417 |
73 | // {IERC165} interfaces can also be queried via the registry./ Sets `newManager` as the manager for `account`. A manager of anaccount is able to set interface implementers for it. By default, each account is its own manager. Passing a value of `0x0` in`newManager` will reset the manager to this initial state. Emits a {... | function setManager(address account, address newManager) external;
| function setManager(address account, address newManager) external;
| 9,460 |
11 | // (8) 종료 | function close() public onlyOwner {
// 토큰을 소유자에게 전송
token.transfer(owner, token.balanceOf(this));
// 계약을 파기 (해당 계약이 보유하고 있는 Ehter는 소유자에게 전송)
selfdestruct(owner);
}
| function close() public onlyOwner {
// 토큰을 소유자에게 전송
token.transfer(owner, token.balanceOf(this));
// 계약을 파기 (해당 계약이 보유하고 있는 Ehter는 소유자에게 전송)
selfdestruct(owner);
}
| 10,781 |
12 | // Informs callers that this contract supports ERC2981 | function supportsInterface(bytes4 interfaceId)
public
view
override(ERC1155Upgradeable)
returns (bool)
| function supportsInterface(bytes4 interfaceId)
public
view
override(ERC1155Upgradeable)
returns (bool)
| 49,484 |
176 | // Sets new reserve ratio. | reserveRatio = _newReserveRatio;
emit NewReserveRatio(_oldReserveRatio, _newReserveRatio);
| reserveRatio = _newReserveRatio;
emit NewReserveRatio(_oldReserveRatio, _newReserveRatio);
| 71,462 |
15 | // in case someone sends Eth to this contract, this function gets it out again | function withdrawAll() public whenNotPaused onlyOwner {
(bool success,) = _msgSender().call{ value: address(this).balance }("");
require(success, "transfer failed");
}
| function withdrawAll() public whenNotPaused onlyOwner {
(bool success,) = _msgSender().call{ value: address(this).balance }("");
require(success, "transfer failed");
}
| 30,495 |
22 | // Eccentricity can vary by up to 12.5% | node = _seed.derive("eccentricity");
uint ecc = uint(node.getNormalIntBetween(0, 125));
| node = _seed.derive("eccentricity");
uint ecc = uint(node.getNormalIntBetween(0, 125));
| 15,295 |
1 | // Initial Dex Router | IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);
| IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);
| 60,042 |
19 | // The consumer actively confirms the delivered chunks and keys are received | function received() public {
require(now < timeout_receive);
require(round == state.initiated);
inState(state.received);
}
| function received() public {
require(now < timeout_receive);
require(round == state.initiated);
inState(state.received);
}
| 10,161 |
46 | // Returns the total number of pixels currently in existence./Required for ERC-721 compliance. | function totalSupply() public view returns (uint) {
return WIDTH * HEIGHT;
}
| function totalSupply() public view returns (uint) {
return WIDTH * HEIGHT;
}
| 52,165 |
4 | // Calculate and mint the amount of xSushi the Sushi is worth. The ratio will change overtime, as xSushi is burned/minted and Sushi deposited + gained from fees / withdrawn. | else {
uint256 what = _amount.mul(totalShares).div(totalSushi);
_mint(msg.sender, what);
}
| else {
uint256 what = _amount.mul(totalShares).div(totalSushi);
_mint(msg.sender, what);
}
| 7,312 |
55 | // change the minimum amount of tokens to swap | function updateSwapTokensAmount(uint256 newAmount) external onlyOwner {
require(newAmount >= totalSupply * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply.");
require(newAmount <= totalSupply * 1 / 1000, "Swap amount cannot be higher than 0.1% total supply.");
swapTokensAtA... | function updateSwapTokensAmount(uint256 newAmount) external onlyOwner {
require(newAmount >= totalSupply * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply.");
require(newAmount <= totalSupply * 1 / 1000, "Swap amount cannot be higher than 0.1% total supply.");
swapTokensAtA... | 34,925 |
76 | // compute token qty | qty = getTokenQty(token, rate, qty);
imbalanceQty = int(qty);
totalImbalance += imbalanceQty;
| qty = getTokenQty(token, rate, qty);
imbalanceQty = int(qty);
totalImbalance += imbalanceQty;
| 17,814 |
28 | // Allow users to route calls to a contract, to be used with batch | function route(address integration, bytes calldata data)
external payable
returns (bytes memory result)
| function route(address integration, bytes calldata data)
external payable
returns (bytes memory result)
| 79,605 |
39 | // Reverts if value is 0. | modifier notZero(uint256 _value) {
require(_value != 0, "VaultHandler::notZero: value can't be 0");
_;
}
| modifier notZero(uint256 _value) {
require(_value != 0, "VaultHandler::notZero: value can't be 0");
_;
}
| 9,368 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.