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 |
|---|---|---|---|---|
159 | // Can be overridden to add finalization logic. The overriding functionshould call super.finalization() to ensure the chain of finalization isexecuted entirely. / | function finalization() internal {
}
| function finalization() internal {
}
| 14,889 |
21 | // Paid to partners. | uint public paidToPartners = 0;
| uint public paidToPartners = 0;
| 11,480 |
304 | // check if the function caller is not an zero account address | require(msg.sender != address(0));
| require(msg.sender != address(0));
| 2,667 |
128 | // Function to set the treasuryOneFee fee percentage newFee The new treasuryOneFee fee percentage to be set / | function setTreasuryOneFeePercent(
uint256 newFee
| function setTreasuryOneFeePercent(
uint256 newFee
| 5,266 |
25 | // Main minting logic for lootboxesThis is called via safeTransferFrom when CreatureAccessoryLootBox extendsCreatureAccessoryFactory.NOTE: prices and fees are determined by the sell order on OpenSea.WARNING: Make sure msg.sender can mint! / | function _mint(
LootBoxRandomnessState storage _state,
uint256 _optionId,
address _toAddress,
uint256 _amount,
bytes memory /* _data */,
address _owner
| function _mint(
LootBoxRandomnessState storage _state,
uint256 _optionId,
address _toAddress,
uint256 _amount,
bytes memory /* _data */,
address _owner
| 1,289 |
32 | // Standard ERC20 token / | contract StandardToken {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 internal totalSupply_;
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(... | contract StandardToken {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 internal totalSupply_;
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(... | 41,024 |
16 | // total number of tokens in existence/ | function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| 525 |
41 | // amountInvested(address) returns how much was invested into this loan by a particular address. | function amountInvested(Ledger storage ledger, address investor) view public returns (uint256 amount) {
return ledger.investorData[investor].amountInvested;
}
| function amountInvested(Ledger storage ledger, address investor) view public returns (uint256 amount) {
return ledger.investorData[investor].amountInvested;
}
| 43,865 |
34 | // Instance and Address of the RotoToken contract | RotoToken token;
address roto;
| RotoToken token;
address roto;
| 43,319 |
154 | // Reward the winner. |
reward = round.paidFees[task.ruling] > 0
? (round.contributions[_beneficiary][task.ruling] * round.feeRewards) / round.paidFees[task.ruling]
: 0;
round.contributions[_beneficiary][task.ruling] = 0;
|
reward = round.paidFees[task.ruling] > 0
? (round.contributions[_beneficiary][task.ruling] * round.feeRewards) / round.paidFees[task.ruling]
: 0;
round.contributions[_beneficiary][task.ruling] = 0;
| 1,693 |
48 | // Internal function that burns an amount of the token of a givenaccount, deducting from the sender's allowance for said account. Uses theinternal burn function. account The account whose tokens will be burnt. value The amount that will be burnt. / | function _burnFrom(address account, uint256 value) internal {
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
... | function _burnFrom(address account, uint256 value) internal {
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
... | 30,468 |
7 | // registers a new user | function register(byte[] formula_1a, byte[] flight_number, byte[] formula_3a, byte[] formula_4a, byte[] formula_4b, uint arrivaltime){
if (uint(msg.value) == 0) return; // you didn't send us any money
if (now > arrivaltime-2*24*3600){ RETURN(); return; } // refuse new insurances if arrivaltime < 2d from now
... | function register(byte[] formula_1a, byte[] flight_number, byte[] formula_3a, byte[] formula_4a, byte[] formula_4b, uint arrivaltime){
if (uint(msg.value) == 0) return; // you didn't send us any money
if (now > arrivaltime-2*24*3600){ RETURN(); return; } // refuse new insurances if arrivaltime < 2d from now
... | 36,891 |
225 | // Track the market's current interest rate model | oldInterestRateModel = interestRateModel;
| oldInterestRateModel = interestRateModel;
| 9,320 |
366 | // emits each time when creditManager takes credit account | event NewCreditAccount(address indexed account);
| event NewCreditAccount(address indexed account);
| 80,353 |
11 | // require(msg.value == multiply(_numberOfTokens, tokenPrice)); | require(tokenLeft >= _numberOfTokens, "NO MORE TOKEN TO SELL");
| require(tokenLeft >= _numberOfTokens, "NO MORE TOKEN TO SELL");
| 38,564 |
7 | // Verifies if `_address` is blacklisted before a token transfer. _address The address to be checked against the blacklist. / | function checkBlacklist(address _address) internal view returns (bool) {
return whitelist.blacklisted(_address);
}
| function checkBlacklist(address _address) internal view returns (bool) {
return whitelist.blacklisted(_address);
}
| 17,976 |
95 | // Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.Requirements:- This contract must be the admin of `proxy`. / | function upgrade(TransparentUpgradeableProxy proxy, address implementation) public onlyOwner {
proxy.upgradeTo(implementation);
}
| function upgrade(TransparentUpgradeableProxy proxy, address implementation) public onlyOwner {
proxy.upgradeTo(implementation);
}
| 30,098 |
26 | // eg. USDT - SUSHI | IERC20(sushi).safeTransfer(bar, amount1);
sushiOut = _toSUSHI(token0, amount0).add(amount1);
| IERC20(sushi).safeTransfer(bar, amount1);
sushiOut = _toSUSHI(token0, amount0).add(amount1);
| 36,551 |
491 | // Redeems the underlying amount of assets requested by _user. This function is executed by the overlying aToken contract in response to a redeem action._reserve the address of the reserve_user the address of the user performing the action_amount the underlying amount to be redeemed/ | {
uint256 currentAvailableLiquidity = core.getReserveAvailableLiquidity(_reserve);
require(
currentAvailableLiquidity >= _amount,
"There is not enough liquidity available to redeem"
);
core.updateStateOnRedeem(_reserve, _user, _amount, _aTokenBalanceAfterRede... | {
uint256 currentAvailableLiquidity = core.getReserveAvailableLiquidity(_reserve);
require(
currentAvailableLiquidity >= _amount,
"There is not enough liquidity available to redeem"
);
core.updateStateOnRedeem(_reserve, _user, _amount, _aTokenBalanceAfterRede... | 56,103 |
2 | // The price coefficient. Chosen such that at 1 token total supply the amount in reserve is 0.5 ether and token price is 1 Ether. | int constant price_coeff = 133700000000000000000;
| int constant price_coeff = 133700000000000000000;
| 15,751 |
24 | // Compute the role slot. | mstore(0x00, or(shl(96, user), _OWNER_SLOT_NOT))
let roleSlot := keccak256(0x00, 0x20)
| mstore(0x00, or(shl(96, user), _OWNER_SLOT_NOT))
let roleSlot := keccak256(0x00, 0x20)
| 5,042 |
3 | // Constructs an `Authority` contract./_owner The initial contract owner/_inputBox The input box contract/Emits a `ConsensusCreated` event. | constructor(address _owner, IInputBox _inputBox) {
| constructor(address _owner, IInputBox _inputBox) {
| 8,932 |
2 | // Used to validate if a user has been using the reserve for borrowing or as collateral self The configuration object reserveIndex The index of the reserve in the bitmapreturn True if the user has been using a reserve for borrowing or as collateral, false otherwise / | {
require(reserveIndex < 128, Errors.UL_INVALID_INDEX);
return (self.data >> (reserveIndex * 2)) & 3 != 0;
}
| {
require(reserveIndex < 128, Errors.UL_INVALID_INDEX);
return (self.data >> (reserveIndex * 2)) & 3 != 0;
}
| 8,934 |
4 | // BurnableToken | function burn(uint256 _amount) public returns (bool);
| function burn(uint256 _amount) public returns (bool);
| 15,465 |
39 | // check overflow | require(balances[msg.sender] + amount > balances[msg.sender]);
| require(balances[msg.sender] + amount > balances[msg.sender]);
| 52,054 |
369 | // Can modify account state | modifier onlyFrozenOrFluid(address account) {
Require.that(
statusOf(account) != Account.Status.Locked,
FILE,
"Not frozen or fluid"
);
_;
}
| modifier onlyFrozenOrFluid(address account) {
Require.that(
statusOf(account) != Account.Status.Locked,
FILE,
"Not frozen or fluid"
);
_;
}
| 9,280 |
80 | // Compliance and safety checks | require(from != address(0), "FROM0"); // Not a valid BSC wallet address
require(to != address(0), "TO0"); // Not a valid BSC wallet address
require(amount > 0, "AMT0"); // Amount must be greater than 0
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || (no_Fee_Transfers && ... | require(from != address(0), "FROM0"); // Not a valid BSC wallet address
require(to != address(0), "TO0"); // Not a valid BSC wallet address
require(amount > 0, "AMT0"); // Amount must be greater than 0
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || (no_Fee_Transfers && ... | 12,461 |
33 | // Counter to keep track of actual results | uint256 counter = 0;
| uint256 counter = 0;
| 21,653 |
163 | // next supply interest adjustment | function _supplyInterestRate(
uint256 assetBorrow,
uint256 assetSupply)
internal
view
returns (uint256)
| function _supplyInterestRate(
uint256 assetBorrow,
uint256 assetSupply)
internal
view
returns (uint256)
| 32,647 |
4 | // batch 3 -- 30 items | target.transferFrom(msg.sender, 0x6CE860449c423Eaa45e5E605E9630cE84C300B16, 37500000000000000000000);
target.transferFrom(msg.sender, 0xE5249DeB2cbBf6110B53f4D2e224670b580dB02B, 63630000000000000000000);
target.transferFrom(msg.sender, 0xb4b378E93007a36D42D12a1DD5f9EaD27aa43dca, 500935000000000000000000);
targe... | target.transferFrom(msg.sender, 0x6CE860449c423Eaa45e5E605E9630cE84C300B16, 37500000000000000000000);
target.transferFrom(msg.sender, 0xE5249DeB2cbBf6110B53f4D2e224670b580dB02B, 63630000000000000000000);
target.transferFrom(msg.sender, 0xb4b378E93007a36D42D12a1DD5f9EaD27aa43dca, 500935000000000000000000);
targe... | 53,703 |
24 | // finalizeRegistration sets the status to Registered, After this stage, registrations will be restricted. / | function finalizeRegistration()
public
onlyOwner
onlyAtStatus(Status.Initialized)
| function finalizeRegistration()
public
onlyOwner
onlyAtStatus(Status.Initialized)
| 13,461 |
28 | // (12) ์บ์๋ฐฑ ๊ธ์ก์ ๊ณ์ฐ(๊ฐ ๋์์ ๋น์จ์ ์ฌ์ฉ) | uint256 cashback = 0;
if(members[_to] > address(0)) {
cashback = _value / 100 * uint256(members[_to].getCashbackRate(msg.sender));
members[_to].updateHistory(msg.sender, _value);
}
| uint256 cashback = 0;
if(members[_to] > address(0)) {
cashback = _value / 100 * uint256(members[_to].getCashbackRate(msg.sender));
members[_to].updateHistory(msg.sender, _value);
}
| 27,273 |
158 | // Returns the name of the token./ | function name() external view returns (string memory);
| function name() external view returns (string memory);
| 618 |
42 | // Mark as approved, must be done by Rivetz / | function setValid(uint256 spid, bool valid) onlyOwner public {
spEntries[spid].valid = valid;
}
| function setValid(uint256 spid, bool valid) onlyOwner public {
spEntries[spid].valid = valid;
}
| 23,820 |
110 | // Returns _bmeClaimBatchSize | function bmeClaimBatchSize() public view returns (uint256) {
return _bmeClaimBatchSize;
}
| function bmeClaimBatchSize() public view returns (uint256) {
return _bmeClaimBatchSize;
}
| 21,981 |
0 | // cricket results oracle | address internal cricOracleAddr = address(0);
Oracle internal cricOracle = Oracle(cricOracleAddr);
| address internal cricOracleAddr = address(0);
Oracle internal cricOracle = Oracle(cricOracleAddr);
| 17,971 |
300 | // Store future purchase information for the item group. | for (uint256 j = 0; j < _pricePairs[i].length; j++) {
pools[poolId].itemPrices[itemKey][j] = _pricePairs[i][j];
}
| for (uint256 j = 0; j < _pricePairs[i].length; j++) {
pools[poolId].itemPrices[itemKey][j] = _pricePairs[i][j];
}
| 39,503 |
201 | // PoolTogether V4 IDrawCalculator PoolTogether Inc Team The DrawCalculator interface. / | interface IDrawCalculator {
struct PickPrize {
bool won;
uint8 tierIndex;
}
///@notice Emitted when the contract is initialized
event Deployed(
ITicket indexed ticket,
IDrawBuffer indexed drawBuffer,
IPrizeDistributionBuffer indexed prizeDistributionBuffer
);... | interface IDrawCalculator {
struct PickPrize {
bool won;
uint8 tierIndex;
}
///@notice Emitted when the contract is initialized
event Deployed(
ITicket indexed ticket,
IDrawBuffer indexed drawBuffer,
IPrizeDistributionBuffer indexed prizeDistributionBuffer
);... | 80,059 |
2 | // state variables | uint256 public previousTxHeight;
uint256 public txCounter;
int64 public oracleSequence;
mapping(uint8 => address) public channelHandlerContractMap;
mapping(address => mapping(uint8 => bool))public registeredContractChannelMap;
mapping(uint8 => uint64) public channelSendSequenceMap;
mapping(uint8 => uint64... | uint256 public previousTxHeight;
uint256 public txCounter;
int64 public oracleSequence;
mapping(uint8 => address) public channelHandlerContractMap;
mapping(address => mapping(uint8 => bool))public registeredContractChannelMap;
mapping(uint8 => uint64) public channelSendSequenceMap;
mapping(uint8 => uint64... | 38,176 |
31 | // Internal function that burns an amount of the token of a givenaccount, deducting from the sender's allowance for said account. Uses theinternal burn function.Emits an Approval event (reflecting the reduced allowance). account The account whose tokens will be burnt. value The amount that will be burnt. / | function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
| function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
| 2,460 |
18 | // Scale by 1e18^2 (ether precision) to cancel out exponentiation Scales the number by a constant to get to the level we want | return ((numEther / (1e18 * 1e18)) / SCALING);
| return ((numEther / (1e18 * 1e18)) / SCALING);
| 24,718 |
36 | // If the Stability Pool was emptied, increment the epoch, and reset the scale and product P | if (newProductFactor == 0) {
currentEpoch += 1;
emit EpochUpdated(currentEpoch);
currentScale = 0;
emit ScaleUpdated(0);
newP = DECIMAL_PRECISION;
| if (newProductFactor == 0) {
currentEpoch += 1;
emit EpochUpdated(currentEpoch);
currentScale = 0;
emit ScaleUpdated(0);
newP = DECIMAL_PRECISION;
| 18,927 |
0 | // Metatransactional varibles | mapping(bytes32 => bool) used; //Mapping of burned hashes
| mapping(bytes32 => bool) used; //Mapping of burned hashes
| 30,910 |
6 | // can we finish the game? | require(
games[playerOne].playerOneChoice > 0 &&
games[playerOne].playerTwoChoice > 0 ,
"Both players need to reveal their choice before game can be completed"
);
address playerTwo = games[playerOne].playerTwo;
uint playerOneChoice = games[playerOne].player... | require(
games[playerOne].playerOneChoice > 0 &&
games[playerOne].playerTwoChoice > 0 ,
"Both players need to reveal their choice before game can be completed"
);
address playerTwo = games[playerOne].playerTwo;
uint playerOneChoice = games[playerOne].player... | 36,029 |
10 | // reset staking balance | stakingBalance[msg.sender] = 0;
| stakingBalance[msg.sender] = 0;
| 14,981 |
20 | // To change the approve amount you first have to reduce the addresses`allowance to zero by calling `approve(_spender, 0)` if it is notalready 0 to mitigate the race condition described here:https:github.com/ethereum/EIPs/issues/20issuecomment-263524729 | require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
| require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
| 53,652 |
159 | // Swap or lock all CRV for cvxCRV/_minAmountOut - the min amount of cvxCRV expected/_lock - whether to lock or swap/ return the amount of cvxCrv obtained | function _toCvxCrv(uint256 _minAmountOut, bool _lock)
internal
returns (uint256)
| function _toCvxCrv(uint256 _minAmountOut, bool _lock)
internal
returns (uint256)
| 31,005 |
2 | // test checks if any Ante Pool's balance is less than supposed store values/ return true if contract balance is greater than or equal to stored Ante Pool values | function checkTestPasses() public view override returns (bool) {
for (uint256 i = 0; i < testedContracts.length; i++) {
IAntePool antePool = IAntePool(testedContracts[i]);
// totalPaidOut should be 0 before test fails
if (
testedContracts[i].balance <
... | function checkTestPasses() public view override returns (bool) {
for (uint256 i = 0; i < testedContracts.length; i++) {
IAntePool antePool = IAntePool(testedContracts[i]);
// totalPaidOut should be 0 before test fails
if (
testedContracts[i].balance <
... | 8,590 |
82 | // Note: First token has ID 1. | for (uint256 i = 0; i < recipients.length; i++) {
_mint(recipients[i], startingSupply + i + 1);
}
| for (uint256 i = 0; i < recipients.length; i++) {
_mint(recipients[i], startingSupply + i + 1);
}
| 45,872 |
44 | // App Registry |
function registerApp(
uint256 configWord
)
external override
|
function registerApp(
uint256 configWord
)
external override
| 26,112 |
321 | // Transfer ETH from contract to DAO member and emit event | payable(msg.sender).transfer(daoStakes[msg.sender]);
currentRaisedAmount = currentRaisedAmount.sub(daoStakes[msg.sender]);
emit PartyMemberExited(msg.sender, daoStakes[msg.sender], false); // Emit exit event
| payable(msg.sender).transfer(daoStakes[msg.sender]);
currentRaisedAmount = currentRaisedAmount.sub(daoStakes[msg.sender]);
emit PartyMemberExited(msg.sender, daoStakes[msg.sender], false); // Emit exit event
| 25,493 |
32 | // gets the state of a proposal proposalId id of the proposalreturn state of the proposal / | function getProposalState(uint256 proposalId) external view returns (State);
| function getProposalState(uint256 proposalId) external view returns (State);
| 26,724 |
9 | // This means that if the mortgage holder calls this function, the | modifier bankOnly {
if(msg.sender != loan.actorAccounts.mortgageHolder) {
throw;
}
_;
}
| modifier bankOnly {
if(msg.sender != loan.actorAccounts.mortgageHolder) {
throw;
}
_;
}
| 38,415 |
7 | // ==================================================================== // Copyright (c) 2018 The ether.online Project.All rights reserved./ // authors rickhunter.shen@gmail.com / sesunding@gmail.com/ ==================================================================== / | contract AccessAdmin {
bool public isPaused = false;
address public addrAdmin;
event AdminTransferred(address indexed preAdmin, address indexed newAdmin);
function AccessAdmin() public {
addrAdmin = msg.sender;
}
modifier onlyAdmin() {
require(msg.sender == addrAdmin);
... | contract AccessAdmin {
bool public isPaused = false;
address public addrAdmin;
event AdminTransferred(address indexed preAdmin, address indexed newAdmin);
function AccessAdmin() public {
addrAdmin = msg.sender;
}
modifier onlyAdmin() {
require(msg.sender == addrAdmin);
... | 32,370 |
4 | // Get the validator's signing key on the jurisdiction.return The account referencing the public component of the signing key. / | function getSigningKey() external view returns (address);
| function getSigningKey() external view returns (address);
| 7,313 |
19 | // report an opaque error from an upgradeable collaborator contract/ | function raiseGenericException(Reason reason, uint genericException) internal returns (uint) {
emit SwapException(uint(Exception.GENERIC_ERROR), uint(reason), genericException);
return uint(Exception.GENERIC_ERROR);
}
| function raiseGenericException(Reason reason, uint genericException) internal returns (uint) {
emit SwapException(uint(Exception.GENERIC_ERROR), uint(reason), genericException);
return uint(Exception.GENERIC_ERROR);
}
| 65,139 |
599 | // if the caller is sending the galaxy to themselves,assume it knows what it's doing and resolve right away | if (msg.sender == _target)
{
doSpawn(_galaxy, _target, true, 0x0);
}
| if (msg.sender == _target)
{
doSpawn(_galaxy, _target, true, 0x0);
}
| 52,115 |
131 | // get value for each pool share | try poolPortal.getBalancerConnectorsAmountByPoolAmount(_amount, _from)
returns(
address[] memory tokens,
uint256[] memory tokensAmount
)
{
| try poolPortal.getBalancerConnectorsAmountByPoolAmount(_amount, _from)
returns(
address[] memory tokens,
uint256[] memory tokensAmount
)
{
| 50,139 |
40 | // Returns the ERC token owner. / | function getOwner() external override view returns (address) {
return owner();
}
| function getOwner() external override view returns (address) {
return owner();
}
| 21,836 |
1 | // versions: - Flags 1.1.0: upgraded to solc 0.8, added lowering access controller- Flags 1.0.0: initial release @inheritdoc TypeAndVersionInterface / | function typeAndVersion() external pure virtual override returns (string memory) {
return "Flags 1.1.0";
}
| function typeAndVersion() external pure virtual override returns (string memory) {
return "Flags 1.1.0";
}
| 35,849 |
65 | // Transfers the same amount of tokens to up to 200 specified addresses. If the sender runs out of balance then the entire transaction fails._to The addresses to transfer to._value The amount to be transferred to each address./ | function airdrop(address[] memory _to, uint256 _value) public whenNotLocked(msg.sender)
| function airdrop(address[] memory _to, uint256 _value) public whenNotLocked(msg.sender)
| 17,552 |
167 | // Each participating currency in the XDR basket is represented as a currency key with equal weighting. There are 5 participating currencies, so we'll declare that clearly. | bytes32[5] public xdrParticipants;
| bytes32[5] public xdrParticipants;
| 22,694 |
150 | // File: contracts/HOKKDividendTracker.sol | contract HOKKDividendTracker is Ownable, DividendPayingToken {
using SafeMath for uint256;
using SafeMathInt for int256;
using IterableMapping for IterableMapping.Map;
IterableMapping.Map private tokenHoldersMap;
uint256 public lastProcessedIndex;
mapping (address => bool) public excludedFromD... | contract HOKKDividendTracker is Ownable, DividendPayingToken {
using SafeMath for uint256;
using SafeMathInt for int256;
using IterableMapping for IterableMapping.Map;
IterableMapping.Map private tokenHoldersMap;
uint256 public lastProcessedIndex;
mapping (address => bool) public excludedFromD... | 25,079 |
11 | // Check that the _characterId is within boundary: | require(_characterId >= previousNumberCharacterIds, "characterId too low");
| require(_characterId >= previousNumberCharacterIds, "characterId too low");
| 53,521 |
126 | // oods_coefficients[104]/ mload(add(context, 0x5d80)), res += c_105(f_7(x) - f_7(g^16391z)) / (x - g^16391z). | res := add(
res,
mulmod(mulmod(/*(x - g^16391 * z)^(-1)*/ mload(add(denominatorsPtr, 0x840)),
| res := add(
res,
mulmod(mulmod(/*(x - g^16391 * z)^(-1)*/ mload(add(denominatorsPtr, 0x840)),
| 47,065 |
9 | // Redeems a pair of long and short tokens equal in number to tokensToRedeem. Returns the commensurateamount of collateral to the caller for the pair of tokens, defined by the collateralPerPair value. This contract must have the `Burner` role for the `longToken` and `shortToken` in order to call `burnFrom`. The caller ... | function redeem(uint256 tokensToRedeem) public nonReentrant() returns (uint256 collateralReturned) {
require(longToken.burnFrom(msg.sender, tokensToRedeem));
require(shortToken.burnFrom(msg.sender, tokensToRedeem));
collateralReturned = FixedPoint.Unsigned(tokensToRedeem).mul(FixedPoint.Uns... | function redeem(uint256 tokensToRedeem) public nonReentrant() returns (uint256 collateralReturned) {
require(longToken.burnFrom(msg.sender, tokensToRedeem));
require(shortToken.burnFrom(msg.sender, tokensToRedeem));
collateralReturned = FixedPoint.Unsigned(tokensToRedeem).mul(FixedPoint.Uns... | 22,576 |
88 | // Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used toe.g. set automatic allowances for certain subsystems, etc. | * Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "BEP20: approve from the zero address");
... | * Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "BEP20: approve from the zero address");
... | 4,720 |
4 | // Called in a bad state | revert();
| revert();
| 11,858 |
48 | // ๆป่ดจๆผไบงๅบ | uint public totalRelaseLp;
uint public totalStaked = 0;
uint256 public constant DURATION = 30 days;
| uint public totalRelaseLp;
uint public totalStaked = 0;
uint256 public constant DURATION = 30 days;
| 48,249 |
6 | // Returns the number of elements in the list self stored linked list from contractreturn uint256 / | function range(List storage self) internal view returns (uint256) {
uint256 i;
uint256 num;
(, i) = adj(self, HEAD, NEXT);
while (i != HEAD) {
(, i) = adj(self, i, NEXT);
num++;
}
return num;
}
| function range(List storage self) internal view returns (uint256) {
uint256 i;
uint256 num;
(, i) = adj(self, HEAD, NEXT);
while (i != HEAD) {
(, i) = adj(self, i, NEXT);
num++;
}
return num;
}
| 33,429 |
35 | // SafeMath library division | function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
| function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
| 72,539 |
57 | // Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of thetotal shares and their previous withdrawals. / | function release(address payable account) public virtual {
require(_shares[account] > 0, "PaymentSplitter: account has no shares");
uint256 totalReceived = address(this).balance + _totalReleased;
uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account];
... | function release(address payable account) public virtual {
require(_shares[account] > 0, "PaymentSplitter: account has no shares");
uint256 totalReceived = address(this).balance + _totalReleased;
uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account];
... | 3,520 |
139 | // Burn the token in the sender address / | function burn(uint256 amount) external {
require(amount > 0, "BEP20: amount is zero");
require(_balances[_msgSender()] >= amount, "BEP20: insufficient balance");
_balances[_msgSender()] = _balances[_msgSender()] - amount;
_totalSupply = _totalSupply - amount;
emit Transfer(_... | function burn(uint256 amount) external {
require(amount > 0, "BEP20: amount is zero");
require(_balances[_msgSender()] >= amount, "BEP20: insufficient balance");
_balances[_msgSender()] = _balances[_msgSender()] - amount;
_totalSupply = _totalSupply - amount;
emit Transfer(_... | 2,640 |
65 | // Mint depositNFT | if (bytes(uri).length == 0) {
depositNFT.mint(sender, depositID);
} else {
| if (bytes(uri).length == 0) {
depositNFT.mint(sender, depositID);
} else {
| 19,341 |
35 | // Concatenates and hashes two inputs for merkle proving/_aThe first hash/_bThe second hash/ returnThe double-sha256 of the concatenated hashes | function _hash256MerkleStep(bytes memory _a, bytes memory _b) public pure returns (bytes32) {
return BTCUtils._hash256MerkleStep(_a, _b);
}
| function _hash256MerkleStep(bytes memory _a, bytes memory _b) public pure returns (bytes32) {
return BTCUtils._hash256MerkleStep(_a, _b);
}
| 4,357 |
380 | // function owner () external view returns ( address ); | function pause() external;
function paused() external view returns (bool);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
| function pause() external;
function paused() external view returns (bool);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
| 1,522 |
102 | // Initialize the execution context, must be initialized before we perform any gas metering or we'll throw a nuisance gas error. | _initContext(_transaction);
| _initContext(_transaction);
| 27,939 |
27 | // We are only allowed to sell after end of game | require(_value <= balances_[msg.sender] && status == 0 && gameTime == 0);
balances_[msg.sender] = balances_[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
uint256 weiAmount = price.mul(_value);
msg.sender.transfer(weiAmount);
emit Transfer(msg.sender, _... | require(_value <= balances_[msg.sender] && status == 0 && gameTime == 0);
balances_[msg.sender] = balances_[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
uint256 weiAmount = price.mul(_value);
msg.sender.transfer(weiAmount);
emit Transfer(msg.sender, _... | 41,364 |
2 | // Register a new agreement class / | function registerAgreementClass(
ISuperfluid host,
address agreementClass) external;
| function registerAgreementClass(
ISuperfluid host,
address agreementClass) external;
| 23,102 |
15 | // Transfer tokens between accounts /from The benefactor/sender account. /to The beneficiary account /value The amount to be transfered | function transferFrom(address from, address to, uint value) returns (bool success){
require(
allowance[from][msg.sender] >= value
&&balances[from] >= value
&& value > 0
);
balances[from] = balances[from].sub(value);
... | function transferFrom(address from, address to, uint value) returns (bool success){
require(
allowance[from][msg.sender] >= value
&&balances[from] >= value
&& value > 0
);
balances[from] = balances[from].sub(value);
... | 2,811 |
63 | // monetaryPolicy_ The address of the monetary policy contract to use for authentication. / | function setMonetaryPolicy(address monetaryPolicy_)
external
onlyOwner
| function setMonetaryPolicy(address monetaryPolicy_)
external
onlyOwner
| 12,689 |
4 | // A module was removed from the MapleToken.module The address the module removed. / | event ModuleRemoved(address indexed module);
| event ModuleRemoved(address indexed module);
| 7,943 |
449 | // JoetrollerCore Storage for the joetroller is at this address, while execution is delegated to the `joetrollerImplementation`.JTokens should reference this contract as their joetroller. / | contract Unitroller is UnitrollerAdminStorage, JoetrollerErrorReporter {
/**
* @notice Emitted when pendingJoetrollerImplementation is changed
*/
event NewPendingImplementation(address oldPendingImplementation, address newPendingImplementation);
/**
* @notice Emitted when pendingJoetrollerIm... | contract Unitroller is UnitrollerAdminStorage, JoetrollerErrorReporter {
/**
* @notice Emitted when pendingJoetrollerImplementation is changed
*/
event NewPendingImplementation(address oldPendingImplementation, address newPendingImplementation);
/**
* @notice Emitted when pendingJoetrollerIm... | 33,279 |
20 | // The reserved balance is the total balance outstanding on all open leaderboards. We keep track of this figure to prevent the developers from pulling out money currently pledged | uint public contractReservedBalance;
function setMinMaxDays(uint8 _minDays, uint8 _maxDays) external ;
function openLeaderboard(uint8 numDays, string message) external payable ;
function closeLeaderboard(uint16 leaderboardId) onlySERAPHIM external;
function setMedalsClaime... | uint public contractReservedBalance;
function setMinMaxDays(uint8 _minDays, uint8 _maxDays) external ;
function openLeaderboard(uint8 numDays, string message) external payable ;
function closeLeaderboard(uint16 leaderboardId) onlySERAPHIM external;
function setMedalsClaime... | 24,084 |
56 | // IUniswapV2Factory | interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, addr... | interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, addr... | 17,725 |
64 | // Tax and development fees will start at 0 so we don't have a big impact when deploying to Uniswap development wallet address is null but the method to set the address is exposed | uint256 private _taxFee = 3;
uint256 private _developmentFee = 3;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousDevelopmentFee = _developmentFee;
address payable public _developmentWalletAddress;
address payable public _marketingWalletAddress;
... | uint256 private _taxFee = 3;
uint256 private _developmentFee = 3;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousDevelopmentFee = _developmentFee;
address payable public _developmentWalletAddress;
address payable public _marketingWalletAddress;
... | 6,034 |
125 | // check items equipped on tamag | for (uint256 i = 0; i < indivEffectEquip.length(); i++){
uint256 equipId = indivEffectEquip.at(i);
if (tamag.isEquipped(tamagId, equipId)){
bonus = bonus.add(tma.bonusEffect(equipId));
}
| for (uint256 i = 0; i < indivEffectEquip.length(); i++){
uint256 equipId = indivEffectEquip.at(i);
if (tamag.isEquipped(tamagId, equipId)){
bonus = bonus.add(tma.bonusEffect(equipId));
}
| 24,979 |
199 | // Initialize the ERC20 token contract | erc20Token = IERC20(_erc20TokenAddress);
| erc20Token = IERC20(_erc20TokenAddress);
| 19,200 |
13 | // mints reputation to user according to his share in last month claims _claimer the user to distribute reputation to / | function claimReputation(address _claimer) public {
uint256 prevMonth = currentMonth - 1;
uint256 monthlyDist = months[prevMonth].monthlyDistribution;
uint256 userClaims = months[prevMonth].claims[_claimer];
if (
lastMonthClaimed[_claimer] < prevMonth &&
userClaims > 0 &&
monthlyDist > 0
) {
last... | function claimReputation(address _claimer) public {
uint256 prevMonth = currentMonth - 1;
uint256 monthlyDist = months[prevMonth].monthlyDistribution;
uint256 userClaims = months[prevMonth].claims[_claimer];
if (
lastMonthClaimed[_claimer] < prevMonth &&
userClaims > 0 &&
monthlyDist > 0
) {
last... | 24,414 |
26 | // an event emitted when someone donated ERC721 tokens to the FrAactionHub | event DonatedErc721(
address indexed contributor,
uint256 id
);
| event DonatedErc721(
address indexed contributor,
uint256 id
);
| 18,476 |
17 | // Cannot donate to deleted token/null address | require(donationBeneficiary[donationId] != address(0));
| require(donationBeneficiary[donationId] != address(0));
| 526 |
0 | // The appended data consists of a deadline, plus the [v,r,s] signature. For simplicity, we use a full 256 bit slot for each of these values, even if 'v' is typically an 8 bit value. | uint256 internal constant _EXTRA_CALLDATA_LENGTH = 4 * 32;
| uint256 internal constant _EXTRA_CALLDATA_LENGTH = 4 * 32;
| 12,216 |
31 | // Buy some put tickets | function buyPutTickets() public payable {
buyTickets(1);
}
| function buyPutTickets() public payable {
buyTickets(1);
}
| 32,342 |
326 | // Replaces an index in the withdrawal stack with another strategy./index The index in the stack to replace./replacementStrategy The strategy to override the index with./Strategies that are untrusted, duplicated, or have no balance are/ filtered out when encountered at withdrawal time, not validated upfront. | function replaceWithdrawalStackIndex(uint256 index, Strategy replacementStrategy) external requiresAuth {
// Get the (soon to be) replaced strategy.
Strategy replacedStrategy = withdrawalStack[index];
// Update the index with the replacement strategy.
withdrawalStack[index] = replac... | function replaceWithdrawalStackIndex(uint256 index, Strategy replacementStrategy) external requiresAuth {
// Get the (soon to be) replaced strategy.
Strategy replacedStrategy = withdrawalStack[index];
// Update the index with the replacement strategy.
withdrawalStack[index] = replac... | 21,497 |
66 | // checks if an account is frozen / | function isFrozen(address account) public view returns (bool) {
return _frozenAccounts.has(account);
}
| function isFrozen(address account) public view returns (bool) {
return _frozenAccounts.has(account);
}
| 17,610 |
1 | // STORAGE //The max iterations to use when this vault interacts with Morpho. | uint96 internal _maxIterations;
| uint96 internal _maxIterations;
| 41,526 |
24 | // Mints a token for a particular mint instance. mintIdThe ID of the mint instance. requestedQuantity The quantity of tokens to mint. / | function mint(
| function mint(
| 9,051 |
54 | // Indicates whether a contract implements the `ERC1155TokenReceiver` functions and so can accept ERC1155 token types.interfaceID The ERC-165 interface ID that is queried for support.s This function MUST return true if it implements the ERC1155TokenReceiver interface and ERC-165 interface. This function MUST NOT consum... | function supportsInterface(bytes4 interfaceID) external view returns (bool);
| function supportsInterface(bytes4 interfaceID) external view returns (bool);
| 15,930 |
239 | // ============ Constructor ============ //Set state variables and map asset pairs to their oracles_controller Address of controller contract / | constructor(IController _controller) public {
controller = _controller;
}
| constructor(IController _controller) public {
controller = _controller;
}
| 29,517 |
69 | // Withdraws a portion of the callers dividend earnings. / | function withdrawAmount(uint256 _amountOfP3D)
public
| function withdrawAmount(uint256 _amountOfP3D)
public
| 21,492 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.