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
16
// Update the product
products[_id] = _product;
products[_id] = _product;
41,440
138
// Create event
eventContract = new CategoricalEvent( collateralToken, oracle, outcomeCount ); categoricalEvents[eventHash] = eventContract; CategoricalEventCreation(msg.sender, eventContract, collateralToken, oracle, outcomeCount);
eventContract = new CategoricalEvent( collateralToken, oracle, outcomeCount ); categoricalEvents[eventHash] = eventContract; CategoricalEventCreation(msg.sender, eventContract, collateralToken, oracle, outcomeCount);
42,646
2
// Setting the version as a function so that it can be overriden
function version() public pure virtual returns(string memory) { return "1"; } /** * @dev See {IERC2612-permit}. * * In cases where the free option is not a concern, deadline can simply be * set to uint(-1), so it should be seen as an optional parameter */ function permit( a...
function version() public pure virtual returns(string memory) { return "1"; } /** * @dev See {IERC2612-permit}. * * In cases where the free option is not a concern, deadline can simply be * set to uint(-1), so it should be seen as an optional parameter */ function permit( a...
11,334
12
// Reset the staking end time
delete stakers[msg.sender]; userStakedCounter--;
delete stakers[msg.sender]; userStakedCounter--;
26,062
30
// BlokkoContracts takes Smartys token in escrow from client and supplier./Both can claim the tokens if they send a valid signed message.
contract BlokkoOrder is IERC777Recipient, IERC777Sender, ERC1820Implementer { IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH = keccak256("ERC777TokensRecipient"); bytes32 constant public TOKENS_SENDE...
contract BlokkoOrder is IERC777Recipient, IERC777Sender, ERC1820Implementer { IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH = keccak256("ERC777TokensRecipient"); bytes32 constant public TOKENS_SENDE...
42,216
22
// map requestId to Selection
mapping (uint256 => Selection) public _selections;
mapping (uint256 => Selection) public _selections;
15,917
262
// This method can be used by the controller to extract mistakenly/sent tokens to this contract.
function claimTokens(address _tokenAddr) public onlyController { ERC20Basic some_token = ERC20Basic(_tokenAddr); uint256 balance = some_token.balanceOf(this); some_token.transfer(controller, balance); ClaimedTokens(_tokenAddr, controller, balance); }
function claimTokens(address _tokenAddr) public onlyController { ERC20Basic some_token = ERC20Basic(_tokenAddr); uint256 balance = some_token.balanceOf(this); some_token.transfer(controller, balance); ClaimedTokens(_tokenAddr, controller, balance); }
18,560
489
// Callback loanManager and cosign
require(_loanManager.cosign(_debtId, 0), "collateral: error during cosign");
require(_loanManager.cosign(_debtId, 0), "collateral: error during cosign");
25,731
18
// add the ambassadors here. rackoo - lead solidity dev & lead web dev.
ambassadors_[0xbe3569068562218c792cf25b98dbf1418aff2455] = true;
ambassadors_[0xbe3569068562218c792cf25b98dbf1418aff2455] = true;
53,014
23
// sender needs to approve this contract to fund the claim
require(_beneficiary != address(0), "Beneficiary is required"); require(_amount > 0, "Amount is required"); require(_vesting >= _cliff, "Vesting period should be equal or longer to the cliff"); ERC20 token = ERC20(_token); require(token.balanceOf(msg.sender) >= _amount, "Insufficient balan...
require(_beneficiary != address(0), "Beneficiary is required"); require(_amount > 0, "Amount is required"); require(_vesting >= _cliff, "Vesting period should be equal or longer to the cliff"); ERC20 token = ERC20(_token); require(token.balanceOf(msg.sender) >= _amount, "Insufficient balan...
41,153
0
// struct to add matchoutcomes
struct Match { string name; uint winner; }
struct Match { string name; uint winner; }
9,393
39
// Ropsten
IUniswapFactory uniFactory = IUniswapFactory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); IMasterChef masterChef = IMasterChef(0xFF281cEF43111A83f09C656734Fa03E6375d432A); ISushiToken sushi = ISushiToken(0x81DB9C598b3ebbdC92426422fc0A1d06E77195ec); address WETH = 0x078A84ee7991699DD198B7b95055AEd0C782A6...
IUniswapFactory uniFactory = IUniswapFactory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); IMasterChef masterChef = IMasterChef(0xFF281cEF43111A83f09C656734Fa03E6375d432A); ISushiToken sushi = ISushiToken(0x81DB9C598b3ebbdC92426422fc0A1d06E77195ec); address WETH = 0x078A84ee7991699DD198B7b95055AEd0C782A6...
10,646
176
// Internal call to borrow tokens from the bank on behalf of the current executor./token The token to borrow from the bank./amount The amount to borrow./Do not use `amount` input argument to handle the received amount.
function doBorrow(address token, uint amount) internal { if (amount > 0) { bank.borrow(token, amount); } }
function doBorrow(address token, uint amount) internal { if (amount > 0) { bank.borrow(token, amount); } }
33,112
5
// Multiplies two wad, rounding half up to the nearest wad a Wad b Wadreturn The result of ab, in wad /
function wadMul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 0) { return 0; } require(a <= (type(uint256).max - halfWAD) / b, 'Errors.MATH_MULTIPLICATION_OVERFLOW'); return (a * b + halfWAD) / WAD; }
function wadMul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 0) { return 0; } require(a <= (type(uint256).max - halfWAD) / b, 'Errors.MATH_MULTIPLICATION_OVERFLOW'); return (a * b + halfWAD) / WAD; }
12,334
31
// Child contract can enable to provide the condition when the upgrade can begun./
function canUpgrade() public view returns(bool) { return true; }
function canUpgrade() public view returns(bool) { return true; }
16,926
465
// -- Accounts --
function getNumAccounts() external view returns (uint)
function getNumAccounts() external view returns (uint)
26,568
277
// Clock auction modified for sale of kitties/We omit a fallback function to prevent accidental sends to this contract.
contract SaleClockAuction is ClockAuction { // @dev Sanity check that allows us to ensure that we are pointing to the // right auction in our setSaleAuctionAddress() call. bool public isSaleClockAuction = true; // Tracks last 5 sale price of gen0 kitty sales uint256 public gen0SaleCount; uint...
contract SaleClockAuction is ClockAuction { // @dev Sanity check that allows us to ensure that we are pointing to the // right auction in our setSaleAuctionAddress() call. bool public isSaleClockAuction = true; // Tracks last 5 sale price of gen0 kitty sales uint256 public gen0SaleCount; uint...
14,709
117
// Returns total collateral locked via this strategy
function totalLocked() public view virtual override returns (uint256) { return convertFrom18(cm.getVaultBalance(vaultNum)); }
function totalLocked() public view virtual override returns (uint256) { return convertFrom18(cm.getVaultBalance(vaultNum)); }
24,828
8
// 10% bonus for every 1% of the company that you own .. total jobs owned must be > 1 returns a percent
uint _result = 0; if (_numOwned > 1) _result = (_numOwned * 100 / _capacity) * 10; return Math.min(_result, MAX_TEAMWORK_BONUS);
uint _result = 0; if (_numOwned > 1) _result = (_numOwned * 100 / _capacity) * 10; return Math.min(_result, MAX_TEAMWORK_BONUS);
29,797
18
// wallet who has control on the extension and treasury
address internal _host; address internal _treasury;
address internal _host; address internal _treasury;
22,789
73
// I'm just a man who loves "default variables"
function reinvestPartial(uint256 ethToReinvest) public returns(uint256) { return reinvestPartial(ethToReinvest, true); }
function reinvestPartial(uint256 ethToReinvest) public returns(uint256) { return reinvestPartial(ethToReinvest, true); }
21,484
135
// require(_msgSender() == owner() || _msgSender() == _rebaser, "Sender not authorized");
_epoch = _epoch.add(1); if (supplyDelta == 0) { emit LogRebase(_epoch, _totalSupply); return _totalSupply; }
_epoch = _epoch.add(1); if (supplyDelta == 0) { emit LogRebase(_epoch, _totalSupply); return _totalSupply; }
11,205
17
// A mapping from CryptonIDs to the price of the token.
mapping (uint256 => uint256) private cryptonIndexToPrice;
mapping (uint256 => uint256) private cryptonIndexToPrice;
39,902
96
// Bet bear position epoch: epoch /
function betBear(uint256 epoch) external payable whenNotPaused nonReentrant notContract { require(epoch == currentEpoch, "Bet is too early/late"); require(_bettable(epoch), "Round not bettable"); require(msg.value >= minBetAmount, "Bet amount must be greater than minBetAmount"); requ...
function betBear(uint256 epoch) external payable whenNotPaused nonReentrant notContract { require(epoch == currentEpoch, "Bet is too early/late"); require(_bettable(epoch), "Round not bettable"); require(msg.value >= minBetAmount, "Bet amount must be greater than minBetAmount"); requ...
3,485
248
// ========== PUBLIC FUNCTIONS ========== /
function locked__of(address _addr) external view returns (uint256) { return locked[_addr].amount; }
function locked__of(address _addr) external view returns (uint256) { return locked[_addr].amount; }
23,009
0
// Deposit VAI to VAIVault for XVS allocation _amount The amount to deposit to vault /
function deposit(uint256 _amount) external;
function deposit(uint256 _amount) external;
28,937
42
// Error Codes
enum Errors { ORDER_EXPIRED, // Order has already expired ORDER_FULLY_FILLED_OR_CANCELLED, // Order has already been fully filled or cancelled ROUNDING_ERROR_TOO_LARGE, // Rounding error too large INSUFFICIENT_BALANCE_OR_ALLOWANCE // Insufficient balance o...
enum Errors { ORDER_EXPIRED, // Order has already expired ORDER_FULLY_FILLED_OR_CANCELLED, // Order has already been fully filled or cancelled ROUNDING_ERROR_TOO_LARGE, // Rounding error too large INSUFFICIENT_BALANCE_OR_ALLOWANCE // Insufficient balance o...
30,502
110
// curRSalt SAFE, CHECKED
uint256 _seed = getSeed(keyBlockNr) + curRSalt; uint256 onePercent = grandPot / 100;
uint256 _seed = getSeed(keyBlockNr) + curRSalt; uint256 onePercent = grandPot / 100;
19,029
3
// mapping user addresses to an array of lockups name for that user
mapping (address => bytes32[]) internal userToLockups;
mapping (address => bytes32[]) internal userToLockups;
54,509
68
// Fill Order Exposes functions to fill an order on the book /
contract FillOrder is Initializable, ReentrancyGuard, IFillOrder { using SafeERC20 for IERC20; using SafeMathUint256 for uint256; using Trade for Trade.Data; IAugur public augur; IAugurTrading public augurTrading; address public zeroXTrade; address public trade; Trade.StoredContracts p...
contract FillOrder is Initializable, ReentrancyGuard, IFillOrder { using SafeERC20 for IERC20; using SafeMathUint256 for uint256; using Trade for Trade.Data; IAugur public augur; IAugurTrading public augurTrading; address public zeroXTrade; address public trade; Trade.StoredContracts p...
45,872
117
// SteakToken with Governance.
contract SteakToken is ERC20("SteakToken", "STEAK"), Ownable { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); ...
contract SteakToken is ERC20("SteakToken", "STEAK"), Ownable { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); ...
17,741
73
// Returns a token ID at a given `index` of all the tokens stored by the contract.Use along with {totalSupply} to enumerate all tokens. /
function tokenByIndex(uint256 index) external view returns (uint256);
function tokenByIndex(uint256 index) external view returns (uint256);
856
1
// Staking period timestamp (Debatable on timestamp vs blocknumber - went with timestamp)
struct StakePeriod { uint256 startPeriod; uint256 submissionEndPeriod; uint256 endPeriod; uint256 maxStake; uint256 windowRewardAmount; uint256 windowMaxAmount; }
struct StakePeriod { uint256 startPeriod; uint256 submissionEndPeriod; uint256 endPeriod; uint256 maxStake; uint256 windowRewardAmount; uint256 windowMaxAmount; }
40,291
196
// Emitted by Ownable when ownership is transferred./previousOwner The previous owner of the contract./newOwner The new owner of the contract.
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
14,953
141
// Extracts the outpoint tx id from an input/32-byte tx id/_inputThe input/ returnThe tx id (little-endian bytes)
function extractInputTxIdLE(bytes memory _input) internal pure returns (bytes32) { return _input.slice(0, 32).toBytes32(); }
function extractInputTxIdLE(bytes memory _input) internal pure returns (bytes32) { return _input.slice(0, 32).toBytes32(); }
31,577
19
// Mint token ID 0 / don't allow any user mints
_setupNewToken(newContractURI, 0);
_setupNewToken(newContractURI, 0);
6,333
35
// 0 Means "No Cap"
if (activeCollateralUSDCap == 0) { return uint(Error.NO_ERROR); }
if (activeCollateralUSDCap == 0) { return uint(Error.NO_ERROR); }
26,229
4
// Interest rate model
InterestModel public interestModel;
InterestModel public interestModel;
23,525
74
// 1 byte for the length prefix
require(item.len == 21); return address(toUint(item));
require(item.len == 21); return address(toUint(item));
30,925
2
// Init V3
registrar.init(ZMM); ZPFS.init(address(ZMM), address(0));
registrar.init(ZMM); ZPFS.init(address(ZMM), address(0));
43,786
336
// burn tokens. Can only be called by token owner or approved address.On burn, calls back to the registered manager's onBurn method /
function burn(
function burn(
74,255
1
// mytestcontractCreature - a contract for my non-fungible creatures. /
contract mytestcontract is ERC721Tradable { constructor (string memory name, string memory symbol, address _proxyRegistryAddress) ERC721Tradable(name, symbol, _proxyRegistryAddress) {} function baseTokenURI() public virtual pure override returns (string memory) { return "https://4e63jvjk6fhvmbw5fvv...
contract mytestcontract is ERC721Tradable { constructor (string memory name, string memory symbol, address _proxyRegistryAddress) ERC721Tradable(name, symbol, _proxyRegistryAddress) {} function baseTokenURI() public virtual pure override returns (string memory) { return "https://4e63jvjk6fhvmbw5fvv...
9,822
7
// import files from common directory
import { TokenInterface , MemoryInterface } from "../common/interfaces.sol"; import { Stores } from "../common/stores.sol"; import { DSMath } from "../common/math.sol"; interface SoloMarginContract { struct Info { address owner; uint256 number; } enum ActionType { Deposit, ...
import { TokenInterface , MemoryInterface } from "../common/interfaces.sol"; import { Stores } from "../common/stores.sol"; import { DSMath } from "../common/math.sol"; interface SoloMarginContract { struct Info { address owner; uint256 number; } enum ActionType { Deposit, ...
1,755
873
// (timeSinceLastClaimINTERNAL_TOKEN_PRECISION) / YEAR
uint256 proRataYears = timeSinceLastClaim.mul(uint256(Constants.INTERNAL_TOKEN_PRECISION)).div(Constants.YEAR); return proRataYears.mul(emissionRatePerYear);
uint256 proRataYears = timeSinceLastClaim.mul(uint256(Constants.INTERNAL_TOKEN_PRECISION)).div(Constants.YEAR); return proRataYears.mul(emissionRatePerYear);
65,228
41
// Policy Hooks // Checks if the account should be allowed to mint tokens in the given market slToken The market to verify the mint against minter The account which would get the minted tokens mintAmount The amount of underlying being supplied to the market in exchange for tokensreturn 0 if the mint is allowed, otherwi...
function mintAllowed(address slToken, address minter, uint mintAmount) external returns (uint) { // Pausing is a very serious situation - we revert to sound the alarms require(!mintGuardianPaused[slToken], "mint is paused"); // Shh - currently unused minter; mintAmount; ...
function mintAllowed(address slToken, address minter, uint mintAmount) external returns (uint) { // Pausing is a very serious situation - we revert to sound the alarms require(!mintGuardianPaused[slToken], "mint is paused"); // Shh - currently unused minter; mintAmount; ...
7,502
1
// set up permissions
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
29,754
104
// This allows you to buy tokens by sending Ether directly to the smart contract without including any transaction data (useful for, say, mobile wallet apps).
function () payable public { // msg.value is the amount of Ether sent by the transaction. if (msg.value > 0) { fund(); } else { withdrawOld(msg.sender); } }
function () payable public { // msg.value is the amount of Ether sent by the transaction. if (msg.value > 0) { fund(); } else { withdrawOld(msg.sender); } }
10,178
7
// The address of the Governor Guardian
address public guardian;
address public guardian;
14,699
149
// loop through every element in bytes32
for (uint256 _bytesCounter = 0; _bytesCounter < 32; _bytesCounter++) { bytes1 _char = bytes1(bytes32(uint256(_data) * 2 ** (8 * _bytesCounter))); if (_char != 0) { _bytesContainer[_charCount] = _char; _charCount++; }
for (uint256 _bytesCounter = 0; _bytesCounter < 32; _bytesCounter++) { bytes1 _char = bytes1(bytes32(uint256(_data) * 2 ** (8 * _bytesCounter))); if (_char != 0) { _bytesContainer[_charCount] = _char; _charCount++; }
33,835
19
// Execution of antiwhale./
function limitAmount(uint256 _rId, uint256 _sId) private returns(uint256)
function limitAmount(uint256 _rId, uint256 _sId) private returns(uint256)
21,607
22
// returns PolicyBook reward per block multiplied by 1025
function getPolicyBookRewardPerBlock(address policyBookAddress) external view override returns (uint256)
function getPolicyBookRewardPerBlock(address policyBookAddress) external view override returns (uint256)
51,835
5
// Get the chain ID of the current chain
function chainId() external view returns (uint16);
function chainId() external view returns (uint16);
18,695
44
// getBattleStatereturn current state string of the game to web app /
function getBattleState() external view returns (string memory) { if (battleState == BATTLE_STATE.STANDBY) { return 'STANDBY'; } if (battleState == BATTLE_STATE.RUNNING) { return 'RUNNING'; } if (battleState == BATTLE_STATE.ENDED) { return 'ENDED'; } }
function getBattleState() external view returns (string memory) { if (battleState == BATTLE_STATE.STANDBY) { return 'STANDBY'; } if (battleState == BATTLE_STATE.RUNNING) { return 'RUNNING'; } if (battleState == BATTLE_STATE.ENDED) { return 'ENDED'; } }
20,326
313
// Validate adapter
require(_join.vat() == vat, "IlkRegistry/invalid-join-adapter-vat"); require(vat.wards(address(_join)) == 1, "IlkRegistry/adapter-not-authorized");
require(_join.vat() == vat, "IlkRegistry/invalid-join-adapter-vat"); require(vat.wards(address(_join)) == 1, "IlkRegistry/adapter-not-authorized");
7,963
44
// obtains the information about if this token in unique
bool is_unique = token_unique[token_hash].unique;
bool is_unique = token_unique[token_hash].unique;
11,454
68
// function cancelIco()
onlyTrivial() { currentState = State.IcoCancelled; IcoCancelled(); }
onlyTrivial() { currentState = State.IcoCancelled; IcoCancelled(); }
53,831
23
// ZCVestingUsed to hold tokens and release once configured amount has been released to consumers. 10% of initial tokens in contract can be claimed for every 15 million tokens that are distributed to consumers.After 150 million tokens are distributed consumer the full balanceof the vesting contract is transferable. (c)...
contract ZCVesting { using SafeMath for uint256; // Total amount of tokens released uint256 public releasedAmount = 0; // Address of the Token ERC20Basic public token; // Address of the Distribution Contract IZCDistribution public dist; // Release to Address address public releaseA...
contract ZCVesting { using SafeMath for uint256; // Total amount of tokens released uint256 public releasedAmount = 0; // Address of the Token ERC20Basic public token; // Address of the Distribution Contract IZCDistribution public dist; // Release to Address address public releaseA...
17,192
129
// reverse-for-loops with unsigned integer/ solium-disable-next-line security/no-modify-for-iter-var / find the last non-zero byte in order to determine the length
if (result[i] != 0) { uint256 length = i + 1;
if (result[i] != 0) { uint256 length = i + 1;
4,631
713
// Checks if voting of a claim should be closed or not.Internally called by checkVoteClosing methodfor Claims whose status number is 0 or status number lie between 2 and 6. claimId Claim Id. status Current status of claim.return close 1 if voting should be closed,0 in case voting should not be closed,-1 if voting has a...
function _checkVoteClosingFinal(uint claimId, uint status) internal view returns(int8 close) { close = 0; uint coverId; (, coverId) = cd.getClaimCoverId(claimId); bytes4 curr = qd.getCurrencyOfCover(coverId); uint tokenx1e18 = m1.calculateTokenPrice(curr); uint accept...
function _checkVoteClosingFinal(uint claimId, uint status) internal view returns(int8 close) { close = 0; uint coverId; (, coverId) = cd.getClaimCoverId(claimId); bytes4 curr = qd.getCurrencyOfCover(coverId); uint tokenx1e18 = m1.calculateTokenPrice(curr); uint accept...
22,551
19
// how to calculate doubleUnit:specify how much percent increase you want per yeare.g. 130% -> 2.3 multiplier every yearnow divide (1 years) by LOG(2.3) where LOG is the natural logarithm (not LOG10) in this case LOG(2.3) is 0.83290912293 hence multiplying by 1/0.83290912293 is the same31536000 = 1 years (to prevent de...
uint256 doubleUnit = (31536000) * 1.2; event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber); constructor() public onlyOwner()
uint256 doubleUnit = (31536000) * 1.2; event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber); constructor() public onlyOwner()
68,726
56
// Showsnumber of tokens available for PRE-ICO
uint256 public availablePreICO;
uint256 public availablePreICO;
60,263
34
// Get number of blocks to multiply by
uint256 multiplier = latestRewardBlock - pool.lastRewardBlock;
uint256 multiplier = latestRewardBlock - pool.lastRewardBlock;
21,826
19
// Data kept in EVM-storage for every Request posted to the Witnet Request Board.
struct Request { IWitnetRequest addr; // The contract containing the Data Request which execution has been requested. address requester; // Address from which the request was posted. bytes32 hash; // Hash of the Data Request whose execution has been requested. uint2...
struct Request { IWitnetRequest addr; // The contract containing the Data Request which execution has been requested. address requester; // Address from which the request was posted. bytes32 hash; // Hash of the Data Request whose execution has been requested. uint2...
17,997
215
// Cannot redeem collateral/collateralToken Collateral token used to redeem./newTotalCollateral New total collateral, which is lower than minimum collateral./minimumCollateral Minimum collateral required to complete redeem
error TotalCollateralCannotBeLowerThanMinCollateral( IERC20 collateralToken, uint256 newTotalCollateral, uint256 minimumCollateral );
error TotalCollateralCannotBeLowerThanMinCollateral( IERC20 collateralToken, uint256 newTotalCollateral, uint256 minimumCollateral );
9,603
20
// Update the user
user.total = total; updateDebt(addr, poolId);
user.total = total; updateDebt(addr, poolId);
16,874
25
// monthlyAllocation(lastDepositTime,stakeTime[_stakeholder],percentageShare,time_mins);monthlyAllocation(time_days, stakeTime[_stakeholder], percentageShare, time_mins); return SafeMath.div(rewards[_stakeholder], 100);
return time_days;
return time_days;
6,754
16
// LP token given to LPs of a specific L1 token.
address lpToken;
address lpToken;
33,413
229
// _hatchingMultiplierCoolDown base birthing /
function setHatchingMultiplierCoolDown(uint256 _hatchingMultiplierCoolDown) external onlyOwner
function setHatchingMultiplierCoolDown(uint256 _hatchingMultiplierCoolDown) external onlyOwner
70,553
4
// Number of unique hashes submitted
uint256 public nSubmittedHashes = 0; uint256 public nInvalidatedHashes = 0;
uint256 public nSubmittedHashes = 0; uint256 public nInvalidatedHashes = 0;
15,340
44
// require(debtTx.baseTx.status == TxStatus.Locked, "Status is not locked");
require(debtTx.baseTx.status == status, "Status is not locked"); require(now < debtTx.baseTx.beginLockedTime.add(debtTx.baseTx.lockedTime), "Redeem timeout"); debtTx.baseTx.status = TxStatus.Redeemed; return xHash;
require(debtTx.baseTx.status == status, "Status is not locked"); require(now < debtTx.baseTx.beginLockedTime.add(debtTx.baseTx.lockedTime), "Redeem timeout"); debtTx.baseTx.status = TxStatus.Redeemed; return xHash;
66,124
123
// We usually don't need tend, but if there are positions that need active maintainence, overriding this function is how you would signal for that.
return false;
return false;
1,489
106
// Computes the price and transfers winnings./ Does NOT transfer ownership of token.
function _bid(uint256 _tokenId, uint256 _bidAmount) internal returns (uint256) {
function _bid(uint256 _tokenId, uint256 _bidAmount) internal returns (uint256) {
16,167
201
// Return this in acceptRelayedCall to impede execution of a relayed call. No fees will be charged. /
function _rejectRelayedCall(uint256 errorCode) internal pure returns (uint256, bytes memory) { return (_RELAYED_CALL_REJECTED + errorCode, ""); }
function _rejectRelayedCall(uint256 errorCode) internal pure returns (uint256, bytes memory) { return (_RELAYED_CALL_REJECTED + errorCode, ""); }
5,487
505
// _oracle address of chainlink data provider/_jobid job id/_fee maximum fee paid to chainlink data provider/_currentMonth current month's inflation data/_previousMonth previous month's inflation data
constructor( address _oracle, bytes32 _jobid, uint256 _fee, uint128 _currentMonth, uint128 _previousMonth
constructor( address _oracle, bytes32 _jobid, uint256 _fee, uint128 _currentMonth, uint128 _previousMonth
59,488
1
// Deposit tokens. _token The deposited token address. _amount The amount to deposit. /
function deposit(address _token, uint256 _amount) external nonReentrant whenNotPaused onlyOwner { IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount); emit Deposited(msg.sender, _token, _amount); }
function deposit(address _token, uint256 _amount) external nonReentrant whenNotPaused onlyOwner { IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount); emit Deposited(msg.sender, _token, _amount); }
5,203
36
// Current Token to csToken exchange rate.
uint256 public exchangeRate;
uint256 public exchangeRate;
34,044
75
// Get a CalldataPointer from Order.obj The Order object. return ptr The CalldataPointer. /
function toCalldataPointer( Order calldata obj
function toCalldataPointer( Order calldata obj
20,135
2
// The multiplier of utilization rate that gives the slope of the interest rate /
uint public multiplierPerBlock;
uint public multiplierPerBlock;
21,918
105
// - Releases a set of teams if the contest has passed its endingtime (or has been canceled). This method can be called by the general/ public, but should called by our scoring oracle automatically./_contestId - The ID of the contest the teams belong to/_teamIds - TeamIds of the teams we want to release. Array should/ ...
function releaseTeams(uint32 _contestId, uint32[] _teamIds) public { require((_contestId < contests.length) && (_contestId > 0)); Contest storage c = contests[_contestId]; // Teams can only be released for canceled contests or contests that have // passed their end times. require ((c.status == Co...
function releaseTeams(uint32 _contestId, uint32[] _teamIds) public { require((_contestId < contests.length) && (_contestId > 0)); Contest storage c = contests[_contestId]; // Teams can only be released for canceled contests or contests that have // passed their end times. require ((c.status == Co...
17,905
365
// Time elapsed before auction reset [seconds]
uint256 maxAuctionDuration;
uint256 maxAuctionDuration;
43,535
6
// pay out last winner
if (lastPayoutBlock < currentBlock) { payOut(currWinner);
if (lastPayoutBlock < currentBlock) { payOut(currWinner);
5,573
36
// Returns the NFT details
function getNFT( uint256 nftId
function getNFT( uint256 nftId
11,540
0
// This modifier requires a certain fee being associated with a function call. If the caller sent too much, he or she is refunded, but only after the function body. This was dangerous before Solidity version 0.4.0, where it was possible to skip the part after `_;`.
modifier costs(uint _amount) { require(msg.value >= _amount); _; if (msg.value > _amount) msg.sender.transfer(msg.value - _amount); }
modifier costs(uint _amount) { require(msg.value >= _amount); _; if (msg.value > _amount) msg.sender.transfer(msg.value - _amount); }
48,253
169
// - Superblock status
enum Status { Unitialized, New, InBattle, SemiApproved, Approved, Invalid }
enum Status { Unitialized, New, InBattle, SemiApproved, Approved, Invalid }
3,054
80
// Emitted when user claim pending rewards/_owner The owner of the pool share./_recipient The address of recipient who will receive the rewards./_token The token claimed/_amount The amount of pending rewards claimed.
event Claim(address indexed _owner, address indexed _recipient, address indexed _token, uint256 _amount);
event Claim(address indexed _owner, address indexed _recipient, address indexed _token, uint256 _amount);
12,311
18
// The remaining unclaimed tokens from a particular auction in a particular era.
mapping(uint => mapping(uint => uint)) public mapEraAuction_EmissionRemaining;
mapping(uint => mapping(uint => uint)) public mapEraAuction_EmissionRemaining;
40,780
27
// Calculates a signature over provided digest by the keep./Only one signing process can be in progress at a time./_digest Digest to be signed.
function sign(bytes32 _digest) external onlyOwner onlyWhenActive { require(publicKey.length != 0, "Public key was not set yet"); require(!isSigningInProgress(), "Signer is busy"); /* solium-disable-next-line */ signingStartTimestamp = block.timestamp; digests[_digest] = blo...
function sign(bytes32 _digest) external onlyOwner onlyWhenActive { require(publicKey.length != 0, "Public key was not set yet"); require(!isSigningInProgress(), "Signer is busy"); /* solium-disable-next-line */ signingStartTimestamp = block.timestamp; digests[_digest] = blo...
37,965
0
// address of the the contract with vault parameters
VaultParameters public vaultParameters;
VaultParameters public vaultParameters;
3,277
19
// Agreement account state updated event agreementClass Contract address of the agreement account Account of the agrement state Agreement state of the account /
event AgreementAccountStateUpdated(
event AgreementAccountStateUpdated(
21,751
2
// Initializes the contract setting the deployer as the initial governance. /
constructor(address governance_) { if (governance_ == address(0)) revert ZeroAddress(); _governance = governance_; emit GovernanceChanged(address(0), governance_); }
constructor(address governance_) { if (governance_ == address(0)) revert ZeroAddress(); _governance = governance_; emit GovernanceChanged(address(0), governance_); }
11,731
8
// Contract which oversees inter-kToken operations /
KineControllerInterface public controller;
KineControllerInterface public controller;
6,689
388
// Allows to get approved using a permit and transfer in the same call/this supposes that the permit is for msg.sender/from current owner/to recipient/tokenId the token id/_data optional data to add/deadline the deadline for the permit to be used/signature of permit
function safeTransferFromWithPermit( address from, address to, uint256 tokenId, bytes memory _data, uint256 deadline, bytes memory signature
function safeTransferFromWithPermit( address from, address to, uint256 tokenId, bytes memory _data, uint256 deadline, bytes memory signature
44,420
2
// structures
struct AccountData
struct AccountData
5,545
112
// Reverts if the request is already pending requestId The request ID for fulfillment /
modifier notPendingRequest( bytes32 requestId )
modifier notPendingRequest( bytes32 requestId )
14,555
201
// We must query this separately, since the wstETH contract doesn't return how much wstETH is minted.
uint256 result = _wstETH.getWstETHByStETH(amount);
uint256 result = _wstETH.getWstETHByStETH(amount);
52,867
24
// time stamp of the starting time of the ico, must return 0 if it depends on the block number/Start time (as required by Eidoo's ICOEngineInterface)/ return Block (Unix) timestamp of mainsale start time
function startTime() public view returns (uint) { return openingTime; }
function startTime() public view returns (uint) { return openingTime; }
46,220
21
// Internal function for reducing onlyIfUpgradeabilityOwner modifier bytecode overhead. /
function _onlyIfUpgradeabilityOwner() internal view { require(msg.sender == IUpgradeabilityOwnerStorage(address(this)).upgradeabilityOwner()); }
function _onlyIfUpgradeabilityOwner() internal view { require(msg.sender == IUpgradeabilityOwnerStorage(address(this)).upgradeabilityOwner()); }
16,501
569
// Claims all rewards from a pool and then withdraws all staked tokens.//_poolId the pool to exit from.
function exit(uint256 _poolId) external nonReentrant { Pool.Data storage _pool = _pools.get(_poolId); _pool.update(_ctx); Stake.Data storage _stake = _stakes[msg.sender][_poolId]; _stake.update(_pool, _ctx); _claim(_poolId); _withdraw(_poolId, _stake.totalDeposited); }
function exit(uint256 _poolId) external nonReentrant { Pool.Data storage _pool = _pools.get(_poolId); _pool.update(_ctx); Stake.Data storage _stake = _stakes[msg.sender][_poolId]; _stake.update(_pool, _ctx); _claim(_poolId); _withdraw(_poolId, _stake.totalDeposited); }
53,707
142
// ---- Function that adds pending rewards, called by the CORE token. ----
uint256 private coreBalance;
uint256 private coreBalance;
29,423
93
// Remove all fees
function removeAllFee() private { if(_TotalFee == 0 && _buyFee == 0 && _sellFee == 0) return; _previousBuyFee = _buyFee; _previousSellFee = _sellFee; _previousTotalFee = _TotalFee; _buyFee = 0; _sellFee = 0; _TotalFee = 0; }
function removeAllFee() private { if(_TotalFee == 0 && _buyFee == 0 && _sellFee == 0) return; _previousBuyFee = _buyFee; _previousSellFee = _sellFee; _previousTotalFee = _TotalFee; _buyFee = 0; _sellFee = 0; _TotalFee = 0; }
29,430