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 |
|---|---|---|---|---|
24 | // Ensure the sale is ongoing. | modifier when_active { if (isActive()) _; else throw; }
| modifier when_active { if (isActive()) _; else throw; }
| 38,195 |
4 | // RaffleAutomatable Implements keepers interface for automation Steps to include this extension into a simple Raffle 1. Include RaffleAutomatable and RaffleRandomPick into a simple Raffle contract 2. Implement _runRaffleAutomation to call _randomPickWinner 3. Add _setInterval to the Raffle constructor with an interval... | abstract contract RaffleAutomatable is Raffle, KeeperCompatibleInterface {
uint256 public interval; // the interval at which this contract should run
uint256 public lastRafflePick; // the last time stamp a winner was picked
/**
* @notice method that is simulated by the keepers to see if any work ... | abstract contract RaffleAutomatable is Raffle, KeeperCompatibleInterface {
uint256 public interval; // the interval at which this contract should run
uint256 public lastRafflePick; // the last time stamp a winner was picked
/**
* @notice method that is simulated by the keepers to see if any work ... | 3,484 |
41 | // Use 1% to buy | uint256 amountBuy = chargePrice.div(100);
address[] memory path = new address[](3);
path[0] = chargeToken;
path[1] = WETH;
path[2] = prefToken;
| uint256 amountBuy = chargePrice.div(100);
address[] memory path = new address[](3);
path[0] = chargeToken;
path[1] = WETH;
path[2] = prefToken;
| 59,404 |
8 | // Returns the highest bond posted so far for a question/question_id The ID of the question | function getBond(bytes32 question_id) external view returns (uint256);
| function getBond(bytes32 question_id) external view returns (uint256);
| 23,665 |
35 | // sync local max invocations if not initially populatedif local max invocations and maxHasBeenInvoked are both initial values, we know they have not been populated. | if (
_projectConfig.maxInvocations == 0 &&
_projectConfig.maxHasBeenInvoked == false
) {
setProjectMaxInvocations(_projectId);
}
| if (
_projectConfig.maxInvocations == 0 &&
_projectConfig.maxHasBeenInvoked == false
) {
setProjectMaxInvocations(_projectId);
}
| 29,306 |
194 | // Return Token value and debt of the given position. Be careful of unaccrued interests./id The position ID to query. | function positionInfo(uint256 id) public view returns (uint256, uint256) {
Position storage pos = positions[id];
return (IWorker(pos.worker).health(id), debtShareToVal(pos.debtShare));
}
| function positionInfo(uint256 id) public view returns (uint256, uint256) {
Position storage pos = positions[id];
return (IWorker(pos.worker).health(id), debtShareToVal(pos.debtShare));
}
| 12,953 |
19 | // Withdraw ROSE collateral from a vault | function withdrawColl(uint _collWithdrawal, address _upperHint, address _lowerHint) external override {
_adjustVault(msg.sender, _collWithdrawal, 0, false, _upperHint, _lowerHint, 0);
}
| function withdrawColl(uint _collWithdrawal, address _upperHint, address _lowerHint) external override {
_adjustVault(msg.sender, _collWithdrawal, 0, false, _upperHint, _lowerHint, 0);
}
| 31,261 |
11 | // catToCharacter[uint] = oracle get cat id value | ownerCharacterCount[msg.sender]++;
| ownerCharacterCount[msg.sender]++;
| 37,030 |
10 | // To check weather the person is voting for the first time | require(!request.approvals[msg.sender], "You have already voted!");
request.approvals[msg.sender] = true;
request.approvalCount++;
| require(!request.approvals[msg.sender], "You have already voted!");
request.approvals[msg.sender] = true;
request.approvalCount++;
| 22,206 |
22 | // import "./TrancheWallet.sol" : end //import "../token/IERC20Token.sol" : start / | contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public constant returns (string _name) { _name; }
function symbol() public constant returns (string _symbol) { _symbol; }
function decimals() ... | contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public constant returns (string _name) { _name; }
function symbol() public constant returns (string _symbol) { _symbol; }
function decimals() ... | 40,249 |
27 | // Cancels an auction unconditionally. | function _cancelAuction(uint256 _tokenId, address _seller) internal {
_removeAuction(_tokenId);
_transfer(_seller, _tokenId);
AuctionCancelled(_tokenId);
}
| function _cancelAuction(uint256 _tokenId, address _seller) internal {
_removeAuction(_tokenId);
_transfer(_seller, _tokenId);
AuctionCancelled(_tokenId);
}
| 70,351 |
198 | // The `amount` argument is already written to the memory word at 0x34. | amount := mload(0x34)
| amount := mload(0x34)
| 28,090 |
34 | // Define a modifier that checks if an item.state of a upc is Offered | modifier offered(uint _upc) {
require(items[_upc].itemState == State.Offered);
_;
}
| modifier offered(uint _upc) {
require(items[_upc].itemState == State.Offered);
_;
}
| 44,754 |
11 | // safeApprove should only be called when setting an initial allowance, or when resetting it to zero. | require((_value == 0) || (IERC20(_erc20Addr).allowance(address(this), _spender) == 0));
(bool success, bytes memory returnValue) =
| require((_value == 0) || (IERC20(_erc20Addr).allowance(address(this), _spender) == 0));
(bool success, bytes memory returnValue) =
| 10,412 |
69 | // ERC20 tokenSLT / | contract SocialLendingToken is Pausable, BurnableToken, MintableToken, FrozenToken {
string public name;
string public symbol;
uint public decimals;
function SocialLendingToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
totalSupply_ = _initialSupply;
n... | contract SocialLendingToken is Pausable, BurnableToken, MintableToken, FrozenToken {
string public name;
string public symbol;
uint public decimals;
function SocialLendingToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
totalSupply_ = _initialSupply;
n... | 66,414 |
35 | // Return the log in base 256, rounded down, of a positive value.Returns 0 if given 0. Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. / | function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8... | function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8... | 289 |
148 | // update the internal list of purchases / | function _updateBalance(uint256 ethAmount, uint256 vPUREAmount) private {
_vCrowdsaleBalance[msg.sender].ethAmount = _vCrowdsaleBalance[msg
.sender]
.ethAmount
.add(ethAmount);
// safetly check for the total amount of ETH bought by a single user
// it shou... | function _updateBalance(uint256 ethAmount, uint256 vPUREAmount) private {
_vCrowdsaleBalance[msg.sender].ethAmount = _vCrowdsaleBalance[msg
.sender]
.ethAmount
.add(ethAmount);
// safetly check for the total amount of ETH bought by a single user
// it shou... | 85,007 |
195 | // The mintAuthority is an address that can sign mint requests. | address public mintAuthority;
| address public mintAuthority;
| 31,528 |
21 | // Time that passed since the last exection/ return seconds from last execution in a range of 900 seconds | function timeFromLastExecution() public view returns (uint256) {
// lastWorkTime will be zero before first execution
return block.timestamp - lastWorkTime; // solhint-disable-line not-rely-on-time
}
| function timeFromLastExecution() public view returns (uint256) {
// lastWorkTime will be zero before first execution
return block.timestamp - lastWorkTime; // solhint-disable-line not-rely-on-time
}
| 10,366 |
1 | // Address that this module will pass transactions to. | address public target;
| address public target;
| 31,007 |
166 | // 100-0% | penalty =
(riskAmount * (stake.lockedForXDays - howManyDaysServed)) / (stake.lockedForXDays - settings.MINIMUM_DAYS_FOR_HIGH_PENALTY);
| penalty =
(riskAmount * (stake.lockedForXDays - howManyDaysServed)) / (stake.lockedForXDays - settings.MINIMUM_DAYS_FOR_HIGH_PENALTY);
| 15,969 |
27 | // Allows the current functionalOwner to set the pendingOwner address. newFunctionalOwner The address to transfer functionalOwnership to. / | function transferFunctionalOwnership(address newFunctionalOwner) public onlyFunctionalOwner {
pendingFunctionalOwner = newFunctionalOwner; //inject NONPUBLIC VAR ACCESSD BY PUBLIC FUNC
}
| function transferFunctionalOwnership(address newFunctionalOwner) public onlyFunctionalOwner {
pendingFunctionalOwner = newFunctionalOwner; //inject NONPUBLIC VAR ACCESSD BY PUBLIC FUNC
}
| 11,883 |
771 | // withdraw the weth | (
uint256 owedTokenAmount,
uint256 heldTokenAmount
) = BucketLender(bucketLender).withdraw(
buckets,
maxWeights,
msg.sender
);
| (
uint256 owedTokenAmount,
uint256 heldTokenAmount
) = BucketLender(bucketLender).withdraw(
buckets,
maxWeights,
msg.sender
);
| 39,158 |
15 | // Mint the Masset | _mint(_recipient, mintOutput);
emit Minted(msg.sender, _recipient, mintOutput, _input, _inputQuantity);
| _mint(_recipient, mintOutput);
emit Minted(msg.sender, _recipient, mintOutput, _input, _inputQuantity);
| 32,077 |
28 | // Releases funds credited to the sender to a given account account param will, in most cases, be the sender's address nonReentrant modifier used to prevent double spends account address the account to send the eth to amount uint256 the amount of eth to send to the account / | function releaseTo(address payable account, uint256 amount)
public
nonReentrant
whenNotPaused
greaterThanOrEqual(_balances[msg.sender], amount)
| function releaseTo(address payable account, uint256 amount)
public
nonReentrant
whenNotPaused
greaterThanOrEqual(_balances[msg.sender], amount)
| 17,727 |
4 | // Below, you can also see I added some special identifier symbols for our NFT. This is the name and symbol for our token, ex Ethereum and ETH. I just call mine Heroes and HERO. Remember, an NFT is just a token! | )
ERC721("Heroes", "HERO")
| )
ERC721("Heroes", "HERO")
| 17,224 |
76 | // DECIMALPERCENT is the representation of 100% using (2) decimal places100.00 = percentage accuracy (2) to 100% / | uint256 public constant DECIMALPERCENT = 10000;
IERC20 public token;
uint256 public totalFeeReceivedBridge; // fee received per Bridge, not for transaction in other blockchain
| uint256 public constant DECIMALPERCENT = 10000;
IERC20 public token;
uint256 public totalFeeReceivedBridge; // fee received per Bridge, not for transaction in other blockchain
| 60,613 |
63 | // clean out account | slot.owner = 0;
slot.signer = 0;
slot.tendermint = 0x0;
slot.stake = 0;
| slot.owner = 0;
slot.signer = 0;
slot.tendermint = 0x0;
slot.stake = 0;
| 34,707 |
8 | // Rewards per hour per token deposited in wei. | uint256 private rewardsPerHour = 1000000000000000000;
| uint256 private rewardsPerHour = 1000000000000000000;
| 32,867 |
40 | // The treasury address; where all the Ether goes. | address public treasury;
| address public treasury;
| 38,209 |
305 | // ./contracts/token/UniswapIncentive.sol/ pragma solidity ^0.6.0; // pragma experimental ABIEncoderV2; // import "/home/brock/git_pkgs/fei-protocol-core/contracts/openzeppelin/contracts/math/Math.sol"; // import "./IUniswapIncentive.sol"; // import "../utils/SafeMath32.sol"; // import "../refs/UniRef.sol"; //Uniswap t... | contract UniswapIncentive is IUniswapIncentive, UniRef {
using Decimal for Decimal.D256;
using SafeMath32 for uint32;
using SafeMathCopy for uint256;
struct TimeWeightInfo {
uint32 blockNo;
uint32 weight;
uint32 growthRate;
bool active;
}
TimeWeightInfo private ... | contract UniswapIncentive is IUniswapIncentive, UniRef {
using Decimal for Decimal.D256;
using SafeMath32 for uint32;
using SafeMathCopy for uint256;
struct TimeWeightInfo {
uint32 blockNo;
uint32 weight;
uint32 growthRate;
bool active;
}
TimeWeightInfo private ... | 82,402 |
59 | // Enables token holders to transfer their tokens freely if true _transfersEnabled True if transfers are allowed in the clone / | function enableTransfers(bool _transfersEnabled) public;
| function enableTransfers(bool _transfersEnabled) public;
| 54,654 |
250 | // Mapping of token -> lockedAmount | mapping(address => uint256) public lockedBalances;
| mapping(address => uint256) public lockedBalances;
| 11,816 |
10 | // Contract module which allows children to implement an emergency stopmechanism that can be triggered by an authorized account. This is a stripped down version of Open zeppelin's Pausable contract./ | contract Pausable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract i... | contract Pausable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract i... | 22,250 |
78 | // Move the last value to the index where the value to delete is | set._values[toDeleteIndex] = lastvalue;
| set._values[toDeleteIndex] = lastvalue;
| 1,554 |
979 | // Removes delegation of an address. _add address to undelegate. / | function removeDelegation(address _add) external onlyInternal {
_unDelegate(_add);
}
| function removeDelegation(address _add) external onlyInternal {
_unDelegate(_add);
}
| 33,736 |
15 | // Emitted when the manager withdrawns a share of the raised funds/amount The amount of ETH withdrawn | event Withdrawn(uint256 amount);
| event Withdrawn(uint256 amount);
| 34,786 |
2 | // signer | address public signer;
address public rewardPaymentRec =0x25B51E42c54592048c78a7e3383F06B99839Db7e;
address public nonRewardPaymentRec =0xBE4478202984f2DD6ED235a944E12eA324D21E5A;
uint256 public minimumUSD = 300;
uint256 public immutable communityMintingPer;
address[] public futureDistribution... | address public signer;
address public rewardPaymentRec =0x25B51E42c54592048c78a7e3383F06B99839Db7e;
address public nonRewardPaymentRec =0xBE4478202984f2DD6ED235a944E12eA324D21E5A;
uint256 public minimumUSD = 300;
uint256 public immutable communityMintingPer;
address[] public futureDistribution... | 18,393 |
40 | // Used to directly approve a token for transfers by the current _msgSender() / | function _directApproveMsgSenderFor(uint256 tokenId) internal virtual {
assembly {
mstore(0x00, tokenId)
mstore(0x20, 6) // '_tokenApprovals' is at slot 6.
sstore(keccak256(0x00, 0x40), caller())
}
}
| function _directApproveMsgSenderFor(uint256 tokenId) internal virtual {
assembly {
mstore(0x00, tokenId)
mstore(0x20, 6) // '_tokenApprovals' is at slot 6.
sstore(keccak256(0x00, 0x40), caller())
}
}
| 15,587 |
11 | // Description of the credit. | bytes32 description;
| bytes32 description;
| 44,026 |
20 | // Check if this bounty has been initialized | require(bountiesByGuid[bountyGuid].author != address(0), "Bounty has not been initialized");
| require(bountiesByGuid[bountyGuid].author != address(0), "Bounty has not been initialized");
| 41,172 |
6 | // Emitted when the reserve price is updated/reservePrice The new reserve price | event ReservePriceUpdated(uint256 reservePrice);
| event ReservePriceUpdated(uint256 reservePrice);
| 29,969 |
59 | // Tetherswap ETH/YFTE LP token contract address | address public immutable LPtokenAddress;
| address public immutable LPtokenAddress;
| 30,119 |
173 | // Burns `amount` of agToken on behalf of another account without redeeming collateral back/account Account to burn on behalf of/amount Amount to burn/poolManager Reference to the `PoolManager` contract for which the `stocksUsers` will need to be updated | function burnFromNoRedeem(
address account,
uint256 amount,
address poolManager
| function burnFromNoRedeem(
address account,
uint256 amount,
address poolManager
| 59,569 |
334 | // Returns the downcasted uint56 from uint256, reverting onoverflow (when the input is greater than largest uint56). Counterpart to Solidity's `uint56` operator. Requirements: - input must fit into 56 bits _Available since v4.7._ / | function toUint56(uint256 value) internal pure returns (uint56) {
require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
return uint56(value);
}
| function toUint56(uint256 value) internal pure returns (uint56) {
require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
return uint56(value);
}
| 7,550 |
191 | // add addresses to Babyccino PreSale | function addToPresale(address[] calldata addresses) external onlyOwner {
for (uint256 i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0), "Cannot add null address");
_presaleEligible[addresses[i]] = true;
_totalClaimed[addresses[i]] > 0 ? _totalClaim... | function addToPresale(address[] calldata addresses) external onlyOwner {
for (uint256 i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0), "Cannot add null address");
_presaleEligible[addresses[i]] = true;
_totalClaimed[addresses[i]] > 0 ? _totalClaim... | 66,660 |
102 | // Last Period | uint256 public period;
| uint256 public period;
| 25,949 |
24 | // ------------------------------------------------------------------------ 10,000 RGP Tokens per 1 ETH ------------------------------------------------------------------------ | function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 12000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
... | function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 12000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
... | 33,533 |
20 | // Allows a member to vote on a revoke membership proposal If the proposal reaches quorum, the last voter will burn the membership andoptionally add the owner to the deny list if it was defined in the proposal Reverts if:- the proposal doesn't exist- the proposal has ended- `msg.sender` has already votedid The ID of th... | function vote(uint256 id, bool inFavor) external onlyDefMember {
VotingConfig memory config = votingConfig;
Proposal storage proposal = proposals[id];
if (proposal.initiator == address(0)) revert ProposalNotFound();
if (proposal.approvalCount == config.minQuorum || proposal.voters.l... | function vote(uint256 id, bool inFavor) external onlyDefMember {
VotingConfig memory config = votingConfig;
Proposal storage proposal = proposals[id];
if (proposal.initiator == address(0)) revert ProposalNotFound();
if (proposal.approvalCount == config.minQuorum || proposal.voters.l... | 2,359 |
89 | // this is the exercise alternative for ppl who want to receive payment currency instead of the underlying assetthe trick is using the uniswap conversion, but if the amount received back (after slippage and uni fees)is not sufficient to cover the total purchase, then the transaction will fail | function cashCloseCall(uint _c) public {
Call storage call = calls[_c]; //grab the call
require(call.open, "This isnt open");
require(call.expiry >= now, "This call is already expired");
require(call.exercised == false, "This has already been exercised!");
require(msg.sender ... | function cashCloseCall(uint _c) public {
Call storage call = calls[_c]; //grab the call
require(call.open, "This isnt open");
require(call.expiry >= now, "This call is already expired");
require(call.exercised == false, "This has already been exercised!");
require(msg.sender ... | 14,744 |
74 | // Sets whether thirds parties are allowed or not to execute derivative's on msg.sender's behalf/_allow bool Flag for execution allowance | function allowThirdpartyExecution(bool _allow) public;
| function allowThirdpartyExecution(bool _allow) public;
| 29,307 |
9 | // Allows the company to tokenize shares and transfer them e.g to the draggable contract and wrap them.If these shares are newly created, setTotalShares must be called first in order to adjust the total number of shares. / | function mintAndCall(address shareholder, address callee, uint256 amount, bytes calldata data) external {
mint(callee, amount);
require(IERC677Receiver(callee).onTokenTransfer(shareholder, amount, data));
}
| function mintAndCall(address shareholder, address callee, uint256 amount, bytes calldata data) external {
mint(callee, amount);
require(IERC677Receiver(callee).onTokenTransfer(shareholder, amount, data));
}
| 32,050 |
3 | // All token amounts are upscaled. | balanceTokenIn = _upscale(balanceTokenIn, scalingFactorTokenIn);
balanceTokenOut = _upscale(balanceTokenOut, scalingFactorTokenOut);
request.amount = _upscale(request.amount, scalingFactorTokenIn);
uint256 amountOut = _onSwapGivenIn(request, balanceTokenIn, balanceTokenO... | balanceTokenIn = _upscale(balanceTokenIn, scalingFactorTokenIn);
balanceTokenOut = _upscale(balanceTokenOut, scalingFactorTokenOut);
request.amount = _upscale(request.amount, scalingFactorTokenIn);
uint256 amountOut = _onSwapGivenIn(request, balanceTokenIn, balanceTokenO... | 22,008 |
445 | // permit the amount the caller is trying to stake. Please note, that if the base token doesn't support EIP2612 permit - either this call or the inner transferFrom will revert | p.poolToken.permit(msg.sender, address(this), poolTokenAmount, deadline, v, r, s);
_join(msg.sender, p, poolTokenAmount, msg.sender);
| p.poolToken.permit(msg.sender, address(this), poolTokenAmount, deadline, v, r, s);
_join(msg.sender, p, poolTokenAmount, msg.sender);
| 65,584 |
450 | // Mapping from an account address to account context | function getAccountStorage() internal pure
returns (mapping(address => AccountContext) storage store)
| function getAccountStorage() internal pure
returns (mapping(address => AccountContext) storage store)
| 10,942 |
149 | // Ensure that sufficient tokens were returned to the user. | require(
receivedAmountAfterTransferFee >= quotedTokenAmountAfterTransferFee,
"Received token amount after transfer fee is less than quoted amount."
);
| require(
receivedAmountAfterTransferFee >= quotedTokenAmountAfterTransferFee,
"Received token amount after transfer fee is less than quoted amount."
);
| 41,991 |
75 | // intervalDays for reward calculation x days. | uint256[] public intervalDays = [1, 8, 15, 22, 29, 36];
| uint256[] public intervalDays = [1, 8, 15, 22, 29, 36];
| 43,473 |
45 | // Only calculate with fixed apr after the Soft Launch | if (block.number >= startBlock + SOFT_LAUNCH_DURATION) {
boogiePerBlock = ((pool.apr * 1e18 * totalLiquidityValue / _boogiePrice) / APPROX_BLOCKS_PER_YEAR) / 100;
} else {
| if (block.number >= startBlock + SOFT_LAUNCH_DURATION) {
boogiePerBlock = ((pool.apr * 1e18 * totalLiquidityValue / _boogiePrice) / APPROX_BLOCKS_PER_YEAR) / 100;
} else {
| 26,843 |
113 | // Claims reward for the sender account | function getReward() public nonReentrant updateReward(msg.sender) {
uint256 reward = rewards[msg.sender];
if (reward > 0) {
rewards[msg.sender] = 0;
uint256 contractBalance = rewardToken.balanceOf(address(this));
if (contractBalance < reward) {
rew... | function getReward() public nonReentrant updateReward(msg.sender) {
uint256 reward = rewards[msg.sender];
if (reward > 0) {
rewards[msg.sender] = 0;
uint256 contractBalance = rewardToken.balanceOf(address(this));
if (contractBalance < reward) {
rew... | 70,374 |
111 | // Private function that sets a new implementation address on anupgrade beacon contract. controller address of controller to call into that will trigger theupdate to the specified upgrade beacon. beacon address of upgrade beacon to set the new implementation on. implementation the address of the new implementation. / | function _upgrade(
address controller, address beacon, address implementation
| function _upgrade(
address controller, address beacon, address implementation
| 39,518 |
11 | // epoch => campaignID for network fee campaigns | mapping(uint256 => uint256) public networkFeeCampaigns;
| mapping(uint256 => uint256) public networkFeeCampaigns;
| 33,620 |
81 | // Fetch the collateral median address from the collateral FSM | address collateralMedian;
| address collateralMedian;
| 22,013 |
47 | // Forward ERC20 methods to upgraded contract if this one is deprecated | function transfer(address _to, uint _value) public whenNotPaused {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
... | function transfer(address _to, uint _value) public whenNotPaused {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
... | 10,244 |
141 | // insufficient liquidity swapfor a given currency and a given balance. / | function _internalInsufficientLiquiditySwap(bytes4 _curr, uint _baseMin, uint _varMin, uint _caBalance) internal {
bytes4 maxIACurr;
uint amount;
(maxIACurr, , , ) = pd.getIARankDetailsByDate(pd.getLastDate());
if (_curr == maxIACurr) {
amount =... | function _internalInsufficientLiquiditySwap(bytes4 _curr, uint _baseMin, uint _varMin, uint _caBalance) internal {
bytes4 maxIACurr;
uint amount;
(maxIACurr, , , ) = pd.getIARankDetailsByDate(pd.getLastDate());
if (_curr == maxIACurr) {
amount =... | 12,786 |
228 | // Limits need to be at least target, to avoid setting value to 0(avoid potential Honeypot) | function TeamUpdateLimits(uint256 newBalanceLimit, uint256 newSellLimit) public onlyOwner{
//SellLimit needs to be below 1% to avoid a Large Price impact when generating auto LP
require(newSellLimit<_circulatingSupply/100);
//Adds decimals to limits
newBalanceLimit=newBalanceLimit*10... | function TeamUpdateLimits(uint256 newBalanceLimit, uint256 newSellLimit) public onlyOwner{
//SellLimit needs to be below 1% to avoid a Large Price impact when generating auto LP
require(newSellLimit<_circulatingSupply/100);
//Adds decimals to limits
newBalanceLimit=newBalanceLimit*10... | 34,726 |
138 | // To make sure that governance cannot come in and take away the coins | require(!unsalvagableTokens[token], "token is defined as not salvageable");
IERC20(token).safeTransfer(recipient, amount);
| require(!unsalvagableTokens[token], "token is defined as not salvageable");
IERC20(token).safeTransfer(recipient, amount);
| 9,485 |
568 | // ========== ADDRESS RESOLVER CONFIGURATION ========== // ========== CONSTRUCTOR ========== / | {
require(_proxy != address(0), "_proxy cannot be 0");
require(_owner != address(0), "_owner cannot be 0");
currencyKey = _currencyKey;
}
| {
require(_proxy != address(0), "_proxy cannot be 0");
require(_owner != address(0), "_owner cannot be 0");
currencyKey = _currencyKey;
}
| 29,517 |
70 | // Interface to access FlightSuretyData contract // Just external contract are visible from here / | contract FlightSuretyData {
function isOperational() public view returns(bool);
function isAirlineCompletelyRegistered(address _airlineAddress) public view returns(bool);
function setOperatingStatus(bool _mode) external;
function setConsensus(bool _consensus) external;
function registerAirline(strin... | contract FlightSuretyData {
function isOperational() public view returns(bool);
function isAirlineCompletelyRegistered(address _airlineAddress) public view returns(bool);
function setOperatingStatus(bool _mode) external;
function setConsensus(bool _consensus) external;
function registerAirline(strin... | 27,825 |
0 | // wallets for exclude fee | address[] public excludes;
uint256 transferPercentFee = 25; // 0.25%
| address[] public excludes;
uint256 transferPercentFee = 25; // 0.25%
| 10,414 |
230 | // Gets the balance of a particular addressERC20 `function balanceOf(address _owner) public view returns (uint256 balance)`_owner the address to query the the balance forreturn balance an amount of tokens owned by the address specified / | function balanceOf(address _owner) public view returns (uint256 balance) {
// read the balance and return
return tokenBalances[_owner];
}
| function balanceOf(address _owner) public view returns (uint256 balance) {
// read the balance and return
return tokenBalances[_owner];
}
| 49,821 |
0 | // Maps an account to their fingerprint. Used to naievly filter out attempts at self reference | mapping (address => bytes32) public fingerprints;
| mapping (address => bytes32) public fingerprints;
| 5,897 |
8 | // fee share rate in 1/FEE_DENOMINATOR | uint256 private _feeShareRate;
| uint256 private _feeShareRate;
| 11,270 |
10 | // Set the base url path to the json metadata used by opensea | function setBaseURI(string memory _baseTokenURI) external onlyAdmin {
require(freezeURI == false, "Builder: uri is frozen");
baseURI = _baseTokenURI;
}
| function setBaseURI(string memory _baseTokenURI) external onlyAdmin {
require(freezeURI == false, "Builder: uri is frozen");
baseURI = _baseTokenURI;
}
| 11,899 |
1 | // feedVault address / | address public feedVault;
| address public feedVault;
| 15,295 |
68 | // Claim Staked NFT rewards in ODDX. Also resets general holding/ timestamp so users can't double-claim for holding/staking./genzeeIds list of genzee ids to claim rewards for. | function claimStakedNftRewards(uint256[] calldata genzeeIds) external whenNotPaused {
if (genzeeIds.length == 0) revert InvalidInput();
// total rewards amount to claim (all genzees)
uint256 totalRewards;
// loop variables
// rewards for current genzee in the loop below
... | function claimStakedNftRewards(uint256[] calldata genzeeIds) external whenNotPaused {
if (genzeeIds.length == 0) revert InvalidInput();
// total rewards amount to claim (all genzees)
uint256 totalRewards;
// loop variables
// rewards for current genzee in the loop below
... | 276 |
114 | // If not yet initialized | require(!isInitialized);
begin();
| require(!isInitialized);
begin();
| 58,745 |
5 | // How many land owners can pool money together at once in order to bid | uint8 public MAX_LAND_OWNERS;
| uint8 public MAX_LAND_OWNERS;
| 9,110 |
8 | // Transfer "_value" tokens from "_from" to "_to" if "msg.sender" is allowed./Allows for an approved third party to transfer tokens from one/ address to another. Returns success./_from Address from where tokens are withdrawn./_to Address to where tokens are sent./_value Number of tokens to transfer./ return Returns suc... | function transferFrom(address _from, address _to, uint256 _value) public returns (bool)
| function transferFrom(address _from, address _to, uint256 _value) public returns (bool)
| 50,439 |
3 | // Additional token functions | function burn(uint256 _amount) returns (bool success); // Burns (removes from circulation) unindexed pieces of art or tokens.
| function burn(uint256 _amount) returns (bool success); // Burns (removes from circulation) unindexed pieces of art or tokens.
| 34,918 |
147 | // Internal function to invoke `onApprovalReceived` on a target address The call is not executed if the target address is not a contract spender address The address which will spend the funds value uint256 The amount of tokens to be spent data bytes Optional data to send along with the callreturn whether the call corre... | function _checkAndCallApprove(address spender, uint256 value, bytes memory data) internal returns (bool) {
if (!spender.isContract()) {
return false;
}
bytes4 retval = IERC1363Spender(spender).onApprovalReceived(
_msgSender(), value, data
);
return (re... | function _checkAndCallApprove(address spender, uint256 value, bytes memory data) internal returns (bool) {
if (!spender.isContract()) {
return false;
}
bytes4 retval = IERC1363Spender(spender).onApprovalReceived(
_msgSender(), value, data
);
return (re... | 5,156 |
343 | // If they don't have any debt ownership and they never minted, they don't have any fees. User ownership can reduce to 0 if user burns all synths, however they could have fees applicable for periods they had minted in before so we check debtEntryIndex. | if (debtEntryIndex == 0 && userOwnershipPercentage == 0) {
uint[2][FEE_PERIOD_LENGTH] memory nullResults;
return nullResults;
}
| if (debtEntryIndex == 0 && userOwnershipPercentage == 0) {
uint[2][FEE_PERIOD_LENGTH] memory nullResults;
return nullResults;
}
| 20,704 |
66 | // ticket not claimed (includes the ones that cannot be claimed) | ticketStatuses[i] = false;
| ticketStatuses[i] = false;
| 17,732 |
0 | // already used conversion signature from authorizer in order to prevent replay attack | mapping (bytes32 => bool) public usedSignatures;
| mapping (bytes32 => bool) public usedSignatures;
| 50,285 |
26 | // TOOD DECIDE FATALITY | function fatality(uint256 _deadId, uint256 _tokenId) external {
require(
!isPetSafe(_deadId) &&
tx.gasprice <= gas && //inspired by NFT GAS by 0Xmons
petDead[_deadId] == false,
"The PET has to be starved or gas below ${gas} to claim his points"
... | function fatality(uint256 _deadId, uint256 _tokenId) external {
require(
!isPetSafe(_deadId) &&
tx.gasprice <= gas && //inspired by NFT GAS by 0Xmons
petDead[_deadId] == false,
"The PET has to be starved or gas below ${gas} to claim his points"
... | 10,913 |
4 | // mapping (string => uint8) memory candidates;mapping (address => string) memory votes; |
VoteData storage voteData = votations[counterVotationsForIds];
voteData.nameVotation = _voteName;
voteData.created = true;
voteData.addresOwnerVotation = votingOwner;
voteData.maxVotes = _maxVotes;
voteData.currentVotes = 0;
voteData.typeVote = ... |
VoteData storage voteData = votations[counterVotationsForIds];
voteData.nameVotation = _voteName;
voteData.created = true;
voteData.addresOwnerVotation = votingOwner;
voteData.maxVotes = _maxVotes;
voteData.currentVotes = 0;
voteData.typeVote = ... | 39,212 |
50 | // For querying owner of token/_tokenId The tokenID for owner inquiry/Required for ERC-721 compliance. | function ownerOf(uint256 _tokenId)
public
view
returns (address owner)
| function ownerOf(uint256 _tokenId)
public
view
returns (address owner)
| 10,040 |
6 | // ========================================/Mints tokens from Root to a target Wallet;//amount - Amount of tokens to mint;/targetOwnerAddress - Receiver Wallet owner address to calculate Wallet address;/notifyAddress- "iFTNotify" contract address to receive a notification about minting (may be zero);/body - Custom body... | function mint(uint128 amount, address targetOwnerAddress, address notifyAddress, TvmCell body) external;
| function mint(uint128 amount, address targetOwnerAddress, address notifyAddress, TvmCell body) external;
| 7,069 |
79 | // set the new price | celeb.price = _price;
PriceUpdated(_identifier, _price);
| celeb.price = _price;
PriceUpdated(_identifier, _price);
| 6,388 |
174 | // Transcoder must have missed verification for the segment | require(!claim.segmentVerifications[_segmentNumber]);
refundBroadcaster(_jobId);
| require(!claim.segmentVerifications[_segmentNumber]);
refundBroadcaster(_jobId);
| 30,478 |
9 | // Owner can pause or unpause. / | function OWNER_FlipPause() public onlyOwner {
pause = !pause;
}
| function OWNER_FlipPause() public onlyOwner {
pause = !pause;
}
| 18,535 |
1 | // Emitted when an bNFT is initialized underlyingAsset_ The address of the underlying asset // Emitted when the ownership is transferred oldOwner The address of the old owner newOwner The address of the new owner // Emitted when the claim admin is updated oldAdmin The address of the old admin newAdmin The address of th... | function initialize(
address underlyingAsset_,
string calldata bNftName,
string calldata bNftSymbol,
address owner_,
address claimAdmin_
) external;
| function initialize(
address underlyingAsset_,
string calldata bNftName,
string calldata bNftSymbol,
address owner_,
address claimAdmin_
) external;
| 8,774 |
38 | // eturns if the current account is upgrader. | function isUpgrader(address account) external view returns (bool) {
return _isUpgrader(account);
}
| function isUpgrader(address account) external view returns (bool) {
return _isUpgrader(account);
}
| 33,316 |
3 | // returns the total amount of funds held by this pool in terms of underlying | function totalUnderlying() external view returns (uint256);
function getTotalAndPerPoolUnderlying()
external
view
returns (
uint256 totalUnderlying_,
uint256 totalAllocated_,
uint256[] memory perPoolUnderlying_
);
| function totalUnderlying() external view returns (uint256);
function getTotalAndPerPoolUnderlying()
external
view
returns (
uint256 totalUnderlying_,
uint256 totalAllocated_,
uint256[] memory perPoolUnderlying_
);
| 43,405 |
67 | // Put ids length on the stack to save MLOADs. | uint256 idsLength = ids.length;
for (uint256 i = 0; i < idsLength; ) {
| uint256 idsLength = ids.length;
for (uint256 i = 0; i < idsLength; ) {
| 14,961 |
37 | // Burns a specific amount of tokens._value The amount of token to be burned./ | function burn(
uint256 _value
)
public
| function burn(
uint256 _value
)
public
| 4,939 |
30 | // Checks to see if it is the `governor` or `guardian` calling this contract/There is no Access Control here, because it can be handled cheaply through this modifier/In this contract, the `governor` and the `guardian` address have exactly similar rights | modifier onlyGovernorOrGuardian() {
require(msg.sender == governor || msg.sender == guardian, "115");
_;
}
| modifier onlyGovernorOrGuardian() {
require(msg.sender == governor || msg.sender == guardian, "115");
_;
}
| 49,232 |
18 | // require( campaigns[campaignIndex].amountRaised == 0, "No funds to withdraw" ); | // (bool callSuccess, ) = _owner.call{
// value:
// }("");
| // (bool callSuccess, ) = _owner.call{
// value:
// }("");
| 15,355 |
133 | // Return the LP tokens to the launcher | IERC20(_lpToken).safeTransfer(launcher, currentBalance);
| IERC20(_lpToken).safeTransfer(launcher, currentBalance);
| 23,498 |
949 | // MCRethC / (3V1 ^3) | uint nextTotalAssetValue = currentTotalAssetValue.add(ethAmount);
uint point1 = calculateIntegralAtPoint(nextTotalAssetValue, mcrEth);
uint adjustedTokenAmount = point0.sub(point1);
| uint nextTotalAssetValue = currentTotalAssetValue.add(ethAmount);
uint point1 = calculateIntegralAtPoint(nextTotalAssetValue, mcrEth);
uint adjustedTokenAmount = point0.sub(point1);
| 35,094 |
77 | // Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} iscalled. NOTE: This information is only used for _display_ purposes: it inno way affects any of the arithmetic of the contract, including{IERC20-balanceOf} and {IERC20-transfer}. / Present in ERC777 | function decimals() public view returns (uint8) {
return _decimals;
}
| function decimals() public view returns (uint8) {
return _decimals;
}
| 29,530 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.