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 |
|---|---|---|---|---|
130 | // id => fees | mapping (uint256 => Fee[]) public fees;
| mapping (uint256 => Fee[]) public fees;
| 16,638 |
14 | // enough balance, tokens can be sent immediately | finished = true;
| finished = true;
| 18,085 |
151 | // underflow attempts BTFO |
SafeMath.sub(
(sqrt
(
|
SafeMath.sub(
(sqrt
(
| 5,607 |
39 | // Remove an account from a linked list addr address of the account to remove from the linked list This is necessary to iterate over for listing purposes / | function removeFromAccountList(address addr) internal {
require(!readOnly, "Read only mode engaged");
uint16 i = 0;
bool found = false;
address parent;
address current = addressLinkedList[0];
while (true) {
if (addressLinkedList[current] == addr) {
parent = current;
found = true;
break;
}
current = addressLinkedList[current];
if (i++ > accountCount) break;
}
require(found, "Account was not found to remove.");
addressLinkedList[parent] = addressLinkedList[addressLinkedList[parent]];
delete addressLinkedList[addr];
if (balances[addr] > 0) {
balances[address(0)] += balances[addr];
}
delete balances[addr];
accountCount--;
}
| function removeFromAccountList(address addr) internal {
require(!readOnly, "Read only mode engaged");
uint16 i = 0;
bool found = false;
address parent;
address current = addressLinkedList[0];
while (true) {
if (addressLinkedList[current] == addr) {
parent = current;
found = true;
break;
}
current = addressLinkedList[current];
if (i++ > accountCount) break;
}
require(found, "Account was not found to remove.");
addressLinkedList[parent] = addressLinkedList[addressLinkedList[parent]];
delete addressLinkedList[addr];
if (balances[addr] > 0) {
balances[address(0)] += balances[addr];
}
delete balances[addr];
accountCount--;
}
| 34,653 |
228 | // ServiceProvider.recoverERC20: Only admin | require(StakingRewards(controller).hasAdminRole(_msgSender()), "OA");
IERC20(_erc20).transfer(_recipient, _amount);
| require(StakingRewards(controller).hasAdminRole(_msgSender()), "OA");
IERC20(_erc20).transfer(_recipient, _amount);
| 26,641 |
0 | // Interface to represent asset pool interactions | interface IHolyValor {
// safe amount of funds in base asset (USDC) that is possible to reclaim from this HolyValor without fee/penalty
function safeReclaimAmount() external view returns(uint256);
// total amount of funds in base asset (USDC) that is possible to reclaim from this HolyValor
function totalReclaimAmount() external view returns(uint256);
// callable only by a HolyPool, retrieve a portion of invested funds, return (just in case) amount transferred
function reclaimFunds(uint256 amount, bool _safeExecution) external returns(uint256);
}
| interface IHolyValor {
// safe amount of funds in base asset (USDC) that is possible to reclaim from this HolyValor without fee/penalty
function safeReclaimAmount() external view returns(uint256);
// total amount of funds in base asset (USDC) that is possible to reclaim from this HolyValor
function totalReclaimAmount() external view returns(uint256);
// callable only by a HolyPool, retrieve a portion of invested funds, return (just in case) amount transferred
function reclaimFunds(uint256 amount, bool _safeExecution) external returns(uint256);
}
| 45,871 |
4 | // Collateral Features | struct CollateralSettings {
bool isExist; // Collateral is exist or not
bool isActive; // Collateral is open for deposit or not
uint256 valueToLoanRate;
uint256 VTLUpdateTime;
uint256 penaltyRate;
uint256 penaltyUpdateTime;
uint256 bonusRate;
}
| struct CollateralSettings {
bool isExist; // Collateral is exist or not
bool isActive; // Collateral is open for deposit or not
uint256 valueToLoanRate;
uint256 VTLUpdateTime;
uint256 penaltyRate;
uint256 penaltyUpdateTime;
uint256 bonusRate;
}
| 80,541 |
10 | // _amountA: 8000 ether, _amountB: 0.000000008 ether | address DAI = address(0x6B175474E89094C44Da98b954EedeAC495271d0F);
address USDC = address(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
address UNIV2 = address(0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5);
this.createLiquidity(DAI, USDC, _amountA, _amountB);
this.retrieveFullToken(UNIV2);
| address DAI = address(0x6B175474E89094C44Da98b954EedeAC495271d0F);
address USDC = address(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
address UNIV2 = address(0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5);
this.createLiquidity(DAI, USDC, _amountA, _amountB);
this.retrieveFullToken(UNIV2);
| 8,819 |
1 | // A basic token for testing the HashedTimelockERC20. / | contract AliceERC20 is ERC20 {
string public constant name = "Alice Token";
string public constant symbol = "AliceToken";
uint8 public constant decimals = 18;
constructor(uint256 _initialBalance) public {
_mint(msg.sender, _initialBalance);
}
}
| contract AliceERC20 is ERC20 {
string public constant name = "Alice Token";
string public constant symbol = "AliceToken";
uint8 public constant decimals = 18;
constructor(uint256 _initialBalance) public {
_mint(msg.sender, _initialBalance);
}
}
| 15,322 |
8 | // Get the flag. Only the address flag equals to config.normalFlag can the price be called/addr Destination address/ return Address flag | function getAddressFlag(address addr) external view returns(uint);
| function getAddressFlag(address addr) external view returns(uint);
| 37,231 |
265 | // Exit position A | (uint128 liquidity, , , , ) = _position(a);
require(liquidity != 0, "Aloe: Expected liquidity");
(a0, a1, aEarned0, aEarned1) = _uniswapExit(a, liquidity);
| (uint128 liquidity, , , , ) = _position(a);
require(liquidity != 0, "Aloe: Expected liquidity");
(a0, a1, aEarned0, aEarned1) = _uniswapExit(a, liquidity);
| 64,596 |
5 | // If there is any excess money left, send it back | if (address(this).balance > 0) {
(bool success, ) = msg.sender.call{value: address(this).balance}("");
| if (address(this).balance > 0) {
(bool success, ) = msg.sender.call{value: address(this).balance}("");
| 8,171 |
273 | // Revert on overflow / Store reserves[n+1] = reserves[n] + actualAddAmount | totalReserves = totalReservesNew;
| totalReserves = totalReservesNew;
| 1,574 |
113 | // Emitted when the state of a reserve is updated asset The address of the underlying asset of the reserve liquidityRate The new liquidity rate stableBorrowRate The new stable borrow rate variableBorrowRate The new variable borrow rate liquidityIndex The new liquidity index variableBorrowIndex The new variable borrow index // Returns the ongoing normalized income for the reserveA value of 1e27 means there is no income. As time passes, the income is accruedA value of 21e27 means for each unit of asset one unit of income has been accrued reserve The reserve objectreturn the normalized income. expressed in ray /solium-disable-next-line | if (timestamp == uint40(block.timestamp)) {
| if (timestamp == uint40(block.timestamp)) {
| 53,254 |
243 | // Initialization methodvoteFactory Voting contract address/ | constructor (address voteFactory) public {
Nest_3_VoteFactory voteFactoryMap = Nest_3_VoteFactory(address(voteFactory));
_voteFactory = voteFactoryMap;
_nestContract = ERC20(address(voteFactoryMap.checkAddress("nest")));
_tokenSave = Nest_3_TokenSave(address(voteFactoryMap.checkAddress("nest.v3.tokenSave")));
address payable addr = address(voteFactoryMap.checkAddress("nest.v3.abonus")).make_payable();
_abonusContract = Nest_3_Abonus(addr);
address payable levelingAddr = address(voteFactoryMap.checkAddress("nest.v3.leveling")).make_payable();
_nestLeveling = Nest_3_Leveling(levelingAddr);
_destructionAddress = address(voteFactoryMap.checkAddress("nest.v3.destruction"));
}
| constructor (address voteFactory) public {
Nest_3_VoteFactory voteFactoryMap = Nest_3_VoteFactory(address(voteFactory));
_voteFactory = voteFactoryMap;
_nestContract = ERC20(address(voteFactoryMap.checkAddress("nest")));
_tokenSave = Nest_3_TokenSave(address(voteFactoryMap.checkAddress("nest.v3.tokenSave")));
address payable addr = address(voteFactoryMap.checkAddress("nest.v3.abonus")).make_payable();
_abonusContract = Nest_3_Abonus(addr);
address payable levelingAddr = address(voteFactoryMap.checkAddress("nest.v3.leveling")).make_payable();
_nestLeveling = Nest_3_Leveling(levelingAddr);
_destructionAddress = address(voteFactoryMap.checkAddress("nest.v3.destruction"));
}
| 24,945 |
66 | // NOTE: Auto-lock LP when creating the pair Create a uniswap pair for this new token | uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
| uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
| 4,561 |
135 | // Allow pre-approved user to take ownership of a token/_tokenId The ID of the Token that can be transferred if this call succeeds./Required for ERC-721 compliance. | function takeOwnership(uint256 _tokenId) public;
| function takeOwnership(uint256 _tokenId) public;
| 29,850 |
71 | // Restore memory | mstore(sub(_domain, 32), temp1)
mstore(add(_domain, 0), temp2)
mstore(add(_domain, 32), temp3)
| mstore(sub(_domain, 32), temp1)
mstore(add(_domain, 0), temp2)
mstore(add(_domain, 32), temp3)
| 45,294 |
299 | // repay required amount | _leverDownTo(newBorrow, borrows);
return balanceOfWant();
| _leverDownTo(newBorrow, borrows);
return balanceOfWant();
| 18,370 |
278 | // set airdrop happened bool to true | _eventData_.compressedData += 10000000000000000000000000000000;
| _eventData_.compressedData += 10000000000000000000000000000000;
| 54,001 |
163 | // Allows governance to change the K33prNetworkHelper for max spend _kprh new helper address to set / | function setHelper(IHelper _kprh) external {
require(msg.sender == governance, "setHelper: !gov");
KPRH = _kprh;
}
| function setHelper(IHelper _kprh) external {
require(msg.sender == governance, "setHelper: !gov");
KPRH = _kprh;
}
| 3,379 |
4 | // copy data into the free memory slot | calldatacopy(ptr, 0, calldatasize())
| calldatacopy(ptr, 0, calldatasize())
| 20,419 |
22 | // onlyOwner modifier for swap | modifier onlyOwner() {
require(msg.sender == owner, "Only owner");
_;
}
| modifier onlyOwner() {
require(msg.sender == owner, "Only owner");
_;
}
| 12,211 |
179 | // Get the total BP of the player. | function getTotalBPOfAddress(address _address)
external view
returns (uint32)
| function getTotalBPOfAddress(address _address)
external view
returns (uint32)
| 38,570 |
68 | // Change or reaffirm the approved address for an NFT/The zero address indicates there is no approved address./Throws unless `msg.sender` is the current NFT owner, or an authorized/operator of the current owner./_approved The new approved NFT controller/_tokenId The NFT to approve | function approve(address _approved, uint256 _tokenId) external payable;
| function approve(address _approved, uint256 _tokenId) external payable;
| 33,044 |
1 | // Store value in variable / | function post() public {
posts.push(Post({
op: msg.sender
}));
}
| function post() public {
posts.push(Post({
op: msg.sender
}));
}
| 7,712 |
13 | // Transfer position (i.e. locked and boosted amounts) between accounts Revert if caller isn't the esVSP721 contract tokenId_ The position (NFT) to transfer to_ The recipient / | function transferPosition(uint256 tokenId_, address to_) external override {
require(_msgSender() == address(esVSP721), "not-esvsp721");
address _from = esVSP721.ownerOf(tokenId_);
_updateReward(_from);
_updateReward(to_);
LockPosition memory _position = positions[tokenId_];
uint256 _locked = _position.lockedAmount;
uint256 _boosted = _position.boostedAmount;
locked[_from] -= _locked;
boosted[_from] -= _boosted;
locked[to_] += _locked;
boosted[to_] += _boosted;
_moveVotingPower(_delegates[_from], _delegates[to_], _locked + _boosted);
emit Transfer(_from, to_, _boosted);
}
| function transferPosition(uint256 tokenId_, address to_) external override {
require(_msgSender() == address(esVSP721), "not-esvsp721");
address _from = esVSP721.ownerOf(tokenId_);
_updateReward(_from);
_updateReward(to_);
LockPosition memory _position = positions[tokenId_];
uint256 _locked = _position.lockedAmount;
uint256 _boosted = _position.boostedAmount;
locked[_from] -= _locked;
boosted[_from] -= _boosted;
locked[to_] += _locked;
boosted[to_] += _boosted;
_moveVotingPower(_delegates[_from], _delegates[to_], _locked + _boosted);
emit Transfer(_from, to_, _boosted);
}
| 26,363 |
60 | // Called by a pauser to pause, triggers stopped state. / | function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
| function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
| 41,493 |
122 | // This function transfers all the accumulated `rewardToken` to the `FeeDistributor` contract/The reason for having this function rather than doing such transfers directly in the `buyback` function is that/ it can allow to batch transfers and thus optimizes for gas | function sendToFeeDistributor() external whenNotPaused {
feeDistributor.burn(address(rewardToken));
}
| function sendToFeeDistributor() external whenNotPaused {
feeDistributor.burn(address(rewardToken));
}
| 46,583 |
60 | // A public method that creates a new asset and stores it. This/method does basic checking and should only be called from other contract when the/input data is known to be valid. Will NOT generate any event it is delegate to business logic contracts./_creatorTokenID The asset who is father of this asset/_owner First owner of this asset/_price asset price/_ID asset ID/_category see Asset Struct description/_state see Asset Struct description/_attributes see Asset Struct description/_stats see Asset Struct description | function createAsset(
uint256 _creatorTokenID,
address _owner,
uint256 _price,
uint16 _ID,
uint8 _category,
uint8 _state,
uint8 _attributes,
uint8[STATS_SIZE] _stats,
uint256 _cooldown,
| function createAsset(
uint256 _creatorTokenID,
address _owner,
uint256 _price,
uint16 _ID,
uint8 _category,
uint8 _state,
uint8 _attributes,
uint8[STATS_SIZE] _stats,
uint256 _cooldown,
| 43,456 |
2 | // 这是构造函数,只有当合约创建时运行 | constructor() public {
minter = msg.sender;
}
| constructor() public {
minter = msg.sender;
}
| 3,574 |
11 | // Returns new campaignId. | function startCommitReveal(
uint _startBlock,
uint _commitDuration,
uint _revealDuration,
uint _revealThreshold
)
public
onlyWhitelisted
returns(uint)
| function startCommitReveal(
uint _startBlock,
uint _commitDuration,
uint _revealDuration,
uint _revealThreshold
)
public
onlyWhitelisted
returns(uint)
| 12,560 |
294 | // E6 | short_price = precise_price / PRICE_MISSING_MULTIPLIER;
| short_price = precise_price / PRICE_MISSING_MULTIPLIER;
| 26,610 |
4 | // _miner is the miner being disputed. For every mined value 5 miners are saved in an array and the _minerIndexprovided by the party initiating the dispute | address _miner = _request.minersByValue[_timestamp][_minerIndex];
uints[keccak256(abi.encodePacked(_miner,"DisputeCount"))]++;
bytes32 _hash =
keccak256(abi.encodePacked(_miner, _requestId, _timestamp));
| address _miner = _request.minersByValue[_timestamp][_minerIndex];
uints[keccak256(abi.encodePacked(_miner,"DisputeCount"))]++;
bytes32 _hash =
keccak256(abi.encodePacked(_miner, _requestId, _timestamp));
| 6,884 |
51 | // Increase the total supply | _totalSupply = _totalSupply.add( tokens_to_issue );
balances[_to_address] = balances[_to_address].add( tokens_to_issue );
if ( address(bonusProgramContract) != address(0) ) {
uint256 to_bonus_amount = BAEXonIssue(bonusProgramContract).onIssueTokens( _to_address, _partner, tokens_to_issue, issue_price, tokenAmountToFixedAmount(_token_contract,_asset_amount) );
if (to_bonus_amount > 0) {
if ( ( _token_contract == usdtContract ) || ( balanceOfOtherERC20(usdtContract) >= to_bonus_amount ) ) {
transferOtherERC20( usdtContract, address(this), bonusProgramContract, to_bonus_amount );
} else {
| _totalSupply = _totalSupply.add( tokens_to_issue );
balances[_to_address] = balances[_to_address].add( tokens_to_issue );
if ( address(bonusProgramContract) != address(0) ) {
uint256 to_bonus_amount = BAEXonIssue(bonusProgramContract).onIssueTokens( _to_address, _partner, tokens_to_issue, issue_price, tokenAmountToFixedAmount(_token_contract,_asset_amount) );
if (to_bonus_amount > 0) {
if ( ( _token_contract == usdtContract ) || ( balanceOfOtherERC20(usdtContract) >= to_bonus_amount ) ) {
transferOtherERC20( usdtContract, address(this), bonusProgramContract, to_bonus_amount );
} else {
| 12,327 |
32 | // Register `_observer` as an observer _observer The account to add as an observer / | function registerObserver(address _observer) external;
| function registerObserver(address _observer) external;
| 6,317 |
28 | // Store | oracleRelayer = OracleRelayerLike(oracleRelayer_);
treasury = StabilityFeeTreasuryLike(treasury_);
gasPriceOracle = OracleLike(gasPriceOracle_);
ethPriceOracle = OracleLike(ethPriceOracle_);
treasuryParamAdjuster = TreasuryParamAdjusterLike(treasuryParamAdjuster_);
| oracleRelayer = OracleRelayerLike(oracleRelayer_);
treasury = StabilityFeeTreasuryLike(treasury_);
gasPriceOracle = OracleLike(gasPriceOracle_);
ethPriceOracle = OracleLike(ethPriceOracle_);
treasuryParamAdjuster = TreasuryParamAdjusterLike(treasuryParamAdjuster_);
| 28,230 |
72 | // EIP-712 typehash for this contract's domain. | function DOMAIN_SEPARATOR() public view returns (bytes32) {
return block.chainid == DOMAIN_SEPARATOR_CHAIN_ID ? _DOMAIN_SEPARATOR : calculateDomainSeparator();
}
| function DOMAIN_SEPARATOR() public view returns (bytes32) {
return block.chainid == DOMAIN_SEPARATOR_CHAIN_ID ? _DOMAIN_SEPARATOR : calculateDomainSeparator();
}
| 24,597 |
105 | // transfer amount from the channel to the sender | channel.value = channel.value.sub(actualAmount);
balances[msg.sender] = balances[msg.sender].add(actualAmount);
if (isSendback)
{
_channelSendbackAndReopenSuspended(channelId);
emit ChannelClaim(channelId, channel.nonce, msg.sender, actualAmount, plannedAmount, channel.value, 0);
}
| channel.value = channel.value.sub(actualAmount);
balances[msg.sender] = balances[msg.sender].add(actualAmount);
if (isSendback)
{
_channelSendbackAndReopenSuspended(channelId);
emit ChannelClaim(channelId, channel.nonce, msg.sender, actualAmount, plannedAmount, channel.value, 0);
}
| 31,904 |
157 | // Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./ | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| 46,045 |
162 | // Settle an auction, finalizing the bid and paying out to the owner. If there are no bids, the Axon is burned. / | function _settleAuction() internal {
IAxonsAuctionHouse.Auction memory _auction = auction;
require(_auction.startTime != 0, "Auction hasn't begun");
require(!_auction.settled, 'Auction has already been settled');
require(block.timestamp >= _auction.endTime, "Auction hasn't completed");
auction.settled = true;
if (_auction.bidder == address(0)) {
axons.burn(_auction.axonId);
} else {
axons.transferFrom(address(this), _auction.bidder, _auction.axonId);
}
if (_auction.amount > 0) {
IAxonsToken(axonsToken).transferFrom(address(this), msg.sender, 1 * 10**18);
IAxonsToken(axonsToken).burn(_auction.amount - (1 * 10**18));
}
emit AuctionSettled(_auction.axonId, _auction.bidder, _auction.amount);
}
| function _settleAuction() internal {
IAxonsAuctionHouse.Auction memory _auction = auction;
require(_auction.startTime != 0, "Auction hasn't begun");
require(!_auction.settled, 'Auction has already been settled');
require(block.timestamp >= _auction.endTime, "Auction hasn't completed");
auction.settled = true;
if (_auction.bidder == address(0)) {
axons.burn(_auction.axonId);
} else {
axons.transferFrom(address(this), _auction.bidder, _auction.axonId);
}
if (_auction.amount > 0) {
IAxonsToken(axonsToken).transferFrom(address(this), msg.sender, 1 * 10**18);
IAxonsToken(axonsToken).burn(_auction.amount - (1 * 10**18));
}
emit AuctionSettled(_auction.axonId, _auction.bidder, _auction.amount);
}
| 48,232 |
2 | // total minted tokens | function mintedCount() external returns(uint256);
| function mintedCount() external returns(uint256);
| 52,813 |
22 | // Redeems a slice of tranche tokens from all tranches. Returns collateral to the user proportionally to the amount of debt they are removingRequirements - The bond is not mature - The number of `amounts` is the same as the number of tranches - The `amounts` are in equivalent ratio to the tranche order / | function redeem(uint256[] memory amounts) external;
| function redeem(uint256[] memory amounts) external;
| 60,047 |
3 | // transfer the bet amount to the contract | token.transferFrom(msg.sender, this, _amount);
| token.transferFrom(msg.sender, this, _amount);
| 13,833 |
42 | // second inequality must be < because the price can never reach the price at the max tick | if (!(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO)) revert R();
uint256 ratio = uint256(sqrtPriceX96) << 32;
uint256 r = ratio;
uint256 msb = 0;
assembly {
let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
msb := or(msb, f)
r := shr(f, r)
| if (!(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO)) revert R();
uint256 ratio = uint256(sqrtPriceX96) << 32;
uint256 r = ratio;
uint256 msb = 0;
assembly {
let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
msb := or(msb, f)
r := shr(f, r)
| 35,966 |
5 | // Pull aTokens from user | _pullAToken(
collateralAsset,
collateralReserveData.aTokenAddress,
msg.sender,
amounts[0],
permitSignature
);
| _pullAToken(
collateralAsset,
collateralReserveData.aTokenAddress,
msg.sender,
amounts[0],
permitSignature
);
| 11,914 |
161 | // �������ս��� | vipTodayBonus[i] = 0;
| vipTodayBonus[i] = 0;
| 6,223 |
42 | // ____________________________________________________________________________________________________________________ -->DROPS (function) createDrop Create a drop using the stored and approved configuration if called by the address that the user has designated as project admin --------------------------------------------------------------------------------------------------------------------- dropId_The drop Id being approved--------------------------------------------------------------------------------------------------------------------- vestingModule_ Struct containing the relevant config for the vesting module--------------------------------------------------------------------------------------------------------------------- nftModule_ Struct containing the relevant config for the NFT module--------------------------------------------------------------------------------------------------------------------- primarySaleModulesConfig_Array of structs containing the config details for all primary sale modulesassociated with this drop (can be 1 to n)--------------------------------------------------------------------------------------------------------------------- royaltyPaymentSplitterModule_Struct containing the relevant config for the royalty splitter module--------------------------------------------------------------------------------------------------------------------- salesPageHash_ A hash of sale page data--------------------------------------------------------------------------------------------------------------------- customNftAddress_If this drop uses a custom NFT this will hold that | function createDrop(
| function createDrop(
| 28,881 |
12 | // All tokens in a swap are either sent from the `sender` account to the Vault, or from the Vault to the`recipient` account. If the caller is not `sender`, it must be an authorized relayer for them. If `fromInternalBalance` is true, the `sender`'s Internal Balance will be preferred, performing an ERC20transfer for the difference between the requested amount and the User's Internal Balance (if any). The `sender`must have allowed the Vault to use their tokens via `IERC20.approve()`. This matches the behavior of`joinPool`. If `toInternalBalance` is true, tokens will be deposited to `recipient`'s internal balance instead oftransferred. This matches the behavior of | struct FundManagement {
address sender;
bool fromInternalBalance;
address payable recipient;
bool toInternalBalance;
}
| struct FundManagement {
address sender;
bool fromInternalBalance;
address payable recipient;
bool toInternalBalance;
}
| 5,830 |
206 | // A bulk optimization for mintNFTNotForSale/_tokenIds the IDs of the tokens to mint/_tokenURIParts parts of the base URI, e.g. ["https:", "host.com", "/path"] | function mintNFTsNotForSale(uint256[] _tokenIds, bytes32[] _tokenURIParts) public onlyOperator {
require(_tokenURIParts.length > 0, "need at least one string to build URIs");
for (uint256 index = 0; index < _tokenIds.length; index++) {
uint256 tokenId = _tokenIds[index];
string memory tokenURI = _generateTokenURI(_tokenURIParts, tokenId);
mintNFTNotForSale(tokenId, tokenURI);
}
}
| function mintNFTsNotForSale(uint256[] _tokenIds, bytes32[] _tokenURIParts) public onlyOperator {
require(_tokenURIParts.length > 0, "need at least one string to build URIs");
for (uint256 index = 0; index < _tokenIds.length; index++) {
uint256 tokenId = _tokenIds[index];
string memory tokenURI = _generateTokenURI(_tokenURIParts, tokenId);
mintNFTNotForSale(tokenId, tokenURI);
}
}
| 21,783 |
172 | // Move base assets to adapter and deploy | IERC20(base_asset_address).safeTransfer(adapter_address, amount);
best_adapter.deploy_capital(amount);
| IERC20(base_asset_address).safeTransfer(adapter_address, amount);
best_adapter.deploy_capital(amount);
| 36,854 |
6 | // Calculate the amount to repay | (,,,,,uint healthFactor) = LendingPool(lendingPoolAddress).getUserAccountData(borrower);
require(healthFactor < 1e18, "Healthy pos");
uint256 maxLiquidatableDebt = IERC20(stableDebtAddress).balanceOf(borrower);
maxLiquidatableDebt += IERC20(variableDebtAdress).balanceOf(borrower);
require(maxLiquidatableDebt > 0, "No debt on asset");
uint256 userCollateralBalance = IERC20(aTokenAddress).balanceOf(borrower);
| (,,,,,uint healthFactor) = LendingPool(lendingPoolAddress).getUserAccountData(borrower);
require(healthFactor < 1e18, "Healthy pos");
uint256 maxLiquidatableDebt = IERC20(stableDebtAddress).balanceOf(borrower);
maxLiquidatableDebt += IERC20(variableDebtAdress).balanceOf(borrower);
require(maxLiquidatableDebt > 0, "No debt on asset");
uint256 userCollateralBalance = IERC20(aTokenAddress).balanceOf(borrower);
| 8,626 |
4 | // modify the deposit cap for the vault newCap The deposit cap. / | function modifyDepositCap(uint256 newCap) external {
require(msg.sender == owner()); //owner is "strategist"
_loadVISlot().depositCap = newCap;
}
| function modifyDepositCap(uint256 newCap) external {
require(msg.sender == owner()); //owner is "strategist"
_loadVISlot().depositCap = newCap;
}
| 33,344 |
36 | // Whether an address is already used for a tax receiver | mapping (address => uint256) public usedSecondaryReceiver; // [bool]
| mapping (address => uint256) public usedSecondaryReceiver; // [bool]
| 54,555 |
45 | // If v is 1 we also use msg.sender, this is so that we are compatible to the GnosisSafe signature scheme | owner = msg.sender;
| owner = msg.sender;
| 6,524 |
58 | // mint new mAsset to savings manager | _mint(msg.sender, mintAmount);
emit MintedMulti(
address(this),
msg.sender,
mintAmount,
new address[](0),
new uint256[](0)
);
| _mint(msg.sender, mintAmount);
emit MintedMulti(
address(this),
msg.sender,
mintAmount,
new address[](0),
new uint256[](0)
);
| 32,105 |
32 | // Hash(current element of the proof + current computed hash) | computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
| computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
| 32,087 |
60 | // Get token sale price against token id// get the token sale price against token id _tokenId uint256 ID of the token _owner address of the token owner / | function getSalePrice(uint256 _tokenId, address _owner) external view returns (address payable, uint256){
SalePrice memory sp = salePrice[_tokenId][_owner];
return (sp.seller, sp.amount);
}
| function getSalePrice(uint256 _tokenId, address _owner) external view returns (address payable, uint256){
SalePrice memory sp = salePrice[_tokenId][_owner];
return (sp.seller, sp.amount);
}
| 57,440 |
16 | // How much delegated stake is weighted vs operator stake, in ppm. | uint32 public rewardDelegatedStakeWeight;
| uint32 public rewardDelegatedStakeWeight;
| 32,579 |
103 | // swap token1 to toToken | if (token1 == toToken) {
tokensBought = tokensBought.add(amountB);
} else {
| if (token1 == toToken) {
tokensBought = tokensBought.add(amountB);
} else {
| 16,072 |
53 | // Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address. / | function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
| function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
| 63,252 |
23 | // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { MerkleProof } from "@openzeppelin/contracts/cryptography/MerkleProof.sol"; import { IMerkleDistributor } from "../interfaces/IMerkleDistributor.sol"; | address public immutable override token;
bytes32 public immutable override merkleRoot;
| address public immutable override token;
bytes32 public immutable override merkleRoot;
| 35,796 |
1 | // ========== VIEWS ========== //Given the address of a user, returns the index in array of strategies for each of the user's published strategiesuser Address of the user return uint[] The indexes of user's published strategies/ | function getUserPublishedStrategies(address user) external view returns(uint[] memory) {
require(user != address(0), "Invalid address");
return userToPublishedStrategies[user];
}
| function getUserPublishedStrategies(address user) external view returns(uint[] memory) {
require(user != address(0), "Invalid address");
return userToPublishedStrategies[user];
}
| 32,031 |
22 | // Reward Reputation score to a user_to is the address whose reputation score is going to be adjusted_points is the points will be added to _to's reputation score (unsigned integer)_reasonType is the reason of score adjustment/ | function _rewardReputationScore(
address _to,
uint256 _points,
ReasonType _reasonType)
internal
| function _rewardReputationScore(
address _to,
uint256 _points,
ReasonType _reasonType)
internal
| 34,915 |
81 | // Gets the debit balance tracked by `_debit` and does not include `_additionalDebit()` bonder The owner of the debit balance being checkedreturn The debit amount for the Bonder / | function getRawDebit(address bonder) external view returns (uint256) {
return _debit[bonder];
}
| function getRawDebit(address bonder) external view returns (uint256) {
return _debit[bonder];
}
| 75,844 |
206 | // swap and burn collected funds | _nQCToken.swapAndBurn(collectedRescueFunds);
| _nQCToken.swapAndBurn(collectedRescueFunds);
| 74,967 |
35 | // at initialization, setup the owner / | {
beneficiary = addressOfBeneficiary;
//startTime = 1516021200;
startTime = 1516021200 - 3600 * 24; // TODO remove
duration = 744 hours;
tokensContractBalance = 5 * 0.1 finney;
price = 0.000000000005 * 1 ether;
discountPrice = 0.000000000005 * 1 ether * 0.9;
tokenReward = WWWToken(addressOfTokenUsedAsReward);
}
| {
beneficiary = addressOfBeneficiary;
//startTime = 1516021200;
startTime = 1516021200 - 3600 * 24; // TODO remove
duration = 744 hours;
tokensContractBalance = 5 * 0.1 finney;
price = 0.000000000005 * 1 ether;
discountPrice = 0.000000000005 * 1 ether * 0.9;
tokenReward = WWWToken(addressOfTokenUsedAsReward);
}
| 12,840 |
95 | // Gets the balance of the specified address owner address to query the balance ofreturn uint256 representing the amount owned by the passed address / | function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0));
return _ownedTokensCount[owner].current();
}
| function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0));
return _ownedTokensCount[owner].current();
}
| 22,466 |
89 | // An abbreviated name for NFTokens. / | string internal nftSymbol;
| string internal nftSymbol;
| 24,330 |
17 | // Can't implement from IACLOracle as its canPerform() is marked as view-only | contract StateModifyingOracle /* is IACLOracle */ {
bool modifyState;
function canPerform(address, address, bytes32, uint256[]) external returns (bool) {
modifyState = true;
return true;
}
}
| contract StateModifyingOracle /* is IACLOracle */ {
bool modifyState;
function canPerform(address, address, bytes32, uint256[]) external returns (bool) {
modifyState = true;
return true;
}
}
| 39,902 |
8 | // Constructs the SynthereumManager contract _synthereumFinder Synthereum finder contract _roles Admin and Mainteiner roles / | constructor(ISynthereumFinder _synthereumFinder, Roles memory _roles) public {
synthereumFinder = _synthereumFinder;
_setRoleAdmin(DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE);
_setRoleAdmin(MAINTAINER_ROLE, DEFAULT_ADMIN_ROLE);
_setupRole(DEFAULT_ADMIN_ROLE, _roles.admin);
_setupRole(MAINTAINER_ROLE, _roles.maintainer);
}
| constructor(ISynthereumFinder _synthereumFinder, Roles memory _roles) public {
synthereumFinder = _synthereumFinder;
_setRoleAdmin(DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE);
_setRoleAdmin(MAINTAINER_ROLE, DEFAULT_ADMIN_ROLE);
_setupRole(DEFAULT_ADMIN_ROLE, _roles.admin);
_setupRole(MAINTAINER_ROLE, _roles.maintainer);
}
| 10,570 |
172 | // Public function that returns the fee set for a flash mint/token The token to be flash loaned/ return The fees applied to the corresponding flash loan | function flashFee(address token, uint256)
public
view
override
returns (uint256)
| function flashFee(address token, uint256)
public
view
override
returns (uint256)
| 18,263 |
16 | // save amount to withdraw into a variable | uint withdrawAmt = players[msg.sender].amount;
| uint withdrawAmt = players[msg.sender].amount;
| 41,647 |
0 | // The _msgSender() is given membership of all roles, to allow granting and future renouncing after others have been setup. / | function __BondAccessControl_init() internal onlyInitializing {
__AccessControl_init();
_setRoleAdmin(Roles.BOND_ADMIN, Roles.DAO_ADMIN);
_setRoleAdmin(Roles.BOND_AGGREGATOR, Roles.DAO_ADMIN);
_setRoleAdmin(Roles.DAO_ADMIN, Roles.DAO_ADMIN);
_setRoleAdmin(Roles.SYSTEM_ADMIN, Roles.DAO_ADMIN);
_setupRole(Roles.BOND_ADMIN, _msgSender());
_setupRole(Roles.BOND_AGGREGATOR, _msgSender());
_setupRole(Roles.DAO_ADMIN, _msgSender());
_setupRole(Roles.SYSTEM_ADMIN, _msgSender());
}
| function __BondAccessControl_init() internal onlyInitializing {
__AccessControl_init();
_setRoleAdmin(Roles.BOND_ADMIN, Roles.DAO_ADMIN);
_setRoleAdmin(Roles.BOND_AGGREGATOR, Roles.DAO_ADMIN);
_setRoleAdmin(Roles.DAO_ADMIN, Roles.DAO_ADMIN);
_setRoleAdmin(Roles.SYSTEM_ADMIN, Roles.DAO_ADMIN);
_setupRole(Roles.BOND_ADMIN, _msgSender());
_setupRole(Roles.BOND_AGGREGATOR, _msgSender());
_setupRole(Roles.DAO_ADMIN, _msgSender());
_setupRole(Roles.SYSTEM_ADMIN, _msgSender());
}
| 52,960 |
39 | // return moontype true/false | bool[] memory _moonTypes = new bool[](tokenIds.length);
for(uint i; i < tokenIds.length; i++) {
_moonTypes[i] = moons[tokenIds[i]].celestialType;
}
| bool[] memory _moonTypes = new bool[](tokenIds.length);
for(uint i; i < tokenIds.length; i++) {
_moonTypes[i] = moons[tokenIds[i]].celestialType;
}
| 17,544 |
0 | // ERC20Interface Standard version of ERC20 interface / | contract ERC20Interface {
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
| contract ERC20Interface {
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
| 20,415 |
17 | // Add the new guardian | Guardian memory _g = Guardian(
addr,
uint8(GuardianStatus.ADD),
validSince.toUint64()
);
wallet.guardians.push(_g);
wallet.guardianIdx[addr] = wallet.guardians.length;
_cleanRemovedGuardians(wallet, false);
return validSince;
| Guardian memory _g = Guardian(
addr,
uint8(GuardianStatus.ADD),
validSince.toUint64()
);
wallet.guardians.push(_g);
wallet.guardianIdx[addr] = wallet.guardians.length;
_cleanRemovedGuardians(wallet, false);
return validSince;
| 29,171 |
64 | // get ERC20 token address in which user transfered fundsto the present smart contract | address tokenAddress = user.tokenFund;
| address tokenAddress = user.tokenFund;
| 49,228 |
3 | // Array of target contract addresses. | address[] callTargets;
| address[] callTargets;
| 10,892 |
0 | // Mint GS | _mint(_msgSender(), 208_969_354e18);
| _mint(_msgSender(), 208_969_354e18);
| 27,201 |
85 | // Send to Marketing address | transferToAddressETH(marketingDevAddress, transferredBalance.mul(marketingDivisor).div(100));
| transferToAddressETH(marketingDevAddress, transferredBalance.mul(marketingDivisor).div(100));
| 33,537 |
8 | // Emitted for all deposits, the memo distinguishes for swap, add, remove, donate etc | event Deposit(address indexed to, address indexed asset, uint amount, string memo);
| event Deposit(address indexed to, address indexed asset, uint amount, string memo);
| 82,475 |
205 | // Withdraw wrapped ERC20 tokens in this contract to receive the original ERC20s or ETH _fromAddress of users sending the Meta tokens _toThe address where the withdrawn tokens will go to _tokenID The token ID of the ERC-20 token to withdraw from this contract _value The amount of tokens to withdraw / | function _withdraw(
address _from,
address payable _to,
uint256 _tokenID,
uint256 _value)
internal
| function _withdraw(
address _from,
address payable _to,
uint256 _tokenID,
uint256 _value)
internal
| 13,246 |
12 | // Pull if we have any eth leftover | TokenInterface(WETH_ADDRESS).withdraw(ERC20(WETH_ADDRESS).balanceOf(address(this)));
_tokenAddr = ETH_ADDR;
| TokenInterface(WETH_ADDRESS).withdraw(ERC20(WETH_ADDRESS).balanceOf(address(this)));
_tokenAddr = ETH_ADDR;
| 4,546 |
50 | // pass along failure message from failed contract deployment and revert. | if iszero(manager) {
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
| if iszero(manager) {
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
| 14,687 |
132 | // external | function isWhitelisted (address _address) external view returns (bool) {
return presaleWhitelist[_address];
}
| function isWhitelisted (address _address) external view returns (bool) {
return presaleWhitelist[_address];
}
| 76,951 |
39 | // Make sure 5 days have passed for seller to accept | require((block.timestamp - e.getBuyerConfirmedTimeStamp()) > 5 days, 'Please allow 5 days (including weekends) for the seller to accept before cancelling.');
| require((block.timestamp - e.getBuyerConfirmedTimeStamp()) > 5 days, 'Please allow 5 days (including weekends) for the seller to accept before cancelling.');
| 42,668 |
77 | // This contract enables to create multiple contract administrators. | contract CustomAdmin is Ownable {
///@notice List of administrators.
mapping(address => bool) public admins;
event AdminAdded(address indexed _address);
event AdminRemoved(address indexed _address);
///@notice Validates if the sender is actually an administrator.
modifier onlyAdmin() {
require(admins[msg.sender] || msg.sender == owner);
_;
}
///@notice Adds the specified address to the list of administrators.
///@param _address The address to add to the administrator list.
function addAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(!admins[_address]);
//The owner is already an admin and cannot be added.
require(_address != owner);
admins[_address] = true;
emit AdminAdded(_address);
}
///@notice Adds multiple addresses to the administrator list.
///@param _accounts The wallet addresses to add to the administrator list.
function addManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address cannot be an admin.
///The owner is already an admin and cannot be assigned.
///The address cannot be an existing admin.
if(account != address(0) && !admins[account] && account != owner){
admins[account] = true;
emit AdminAdded(_accounts[i]);
}
}
}
///@notice Removes the specified address from the list of administrators.
///@param _address The address to remove from the administrator list.
function removeAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(admins[_address]);
//The owner cannot be removed as admin.
require(_address != owner);
admins[_address] = false;
emit AdminRemoved(_address);
}
///@notice Removes multiple addresses to the administrator list.
///@param _accounts The wallet addresses to remove from the administrator list.
function removeManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address can neither be added or removed from this list.
///The owner is the super admin and cannot be removed.
///The address must be an existing admin in order for it to be removed.
if(account != address(0) && admins[account] && account != owner){
admins[account] = false;
emit AdminRemoved(_accounts[i]);
}
}
}
}
| contract CustomAdmin is Ownable {
///@notice List of administrators.
mapping(address => bool) public admins;
event AdminAdded(address indexed _address);
event AdminRemoved(address indexed _address);
///@notice Validates if the sender is actually an administrator.
modifier onlyAdmin() {
require(admins[msg.sender] || msg.sender == owner);
_;
}
///@notice Adds the specified address to the list of administrators.
///@param _address The address to add to the administrator list.
function addAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(!admins[_address]);
//The owner is already an admin and cannot be added.
require(_address != owner);
admins[_address] = true;
emit AdminAdded(_address);
}
///@notice Adds multiple addresses to the administrator list.
///@param _accounts The wallet addresses to add to the administrator list.
function addManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address cannot be an admin.
///The owner is already an admin and cannot be assigned.
///The address cannot be an existing admin.
if(account != address(0) && !admins[account] && account != owner){
admins[account] = true;
emit AdminAdded(_accounts[i]);
}
}
}
///@notice Removes the specified address from the list of administrators.
///@param _address The address to remove from the administrator list.
function removeAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(admins[_address]);
//The owner cannot be removed as admin.
require(_address != owner);
admins[_address] = false;
emit AdminRemoved(_address);
}
///@notice Removes multiple addresses to the administrator list.
///@param _accounts The wallet addresses to remove from the administrator list.
function removeManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address can neither be added or removed from this list.
///The owner is the super admin and cannot be removed.
///The address must be an existing admin in order for it to be removed.
if(account != address(0) && admins[account] && account != owner){
admins[account] = false;
emit AdminRemoved(_accounts[i]);
}
}
}
}
| 14,707 |
19 | // Returns the amount of tokens in existence. / | function totalSupply() external view returns (uint256);
| function totalSupply() external view returns (uint256);
| 10,143 |
7 | // When checkUpKeep its already to launch, this task is executed | function performUpkeep(bytes calldata) external override {
lastTimeStamp = block.timestamp;
Pawnshop pawnShop = Pawnshop(contractBAddress);
pawnShop.statusUpdater(lastTimeStamp);
}
| function performUpkeep(bytes calldata) external override {
lastTimeStamp = block.timestamp;
Pawnshop pawnShop = Pawnshop(contractBAddress);
pawnShop.statusUpdater(lastTimeStamp);
}
| 34,625 |
79 | // reduce by 1 wei per max buy over what Uniswap will allow to revert bots as best as possible to limit erroneously blacklisted wallets. First bot will get in and be blacklisted, rest will be reverted (cross fingers) | maxBuyAmount -= 1;
| maxBuyAmount -= 1;
| 288 |
4 | // produced by the Solididy File Flattener (c) David Appleton 2018 contact : dave@akomba.com released under Apache 2.0 licence input/home/dave/Documents/gotests/auctionTests/auction/auction_reveal_list.sol flattened :Tuesday, 27-Aug-19 13:53:00 UTC | contract Ownable {
address payable private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner() {
require(msg.sender == _owner, "Forbidden");
_;
}
constructor() public {
_owner = msg.sender;
}
function owner() public view returns (address payable) {
return _owner;
}
function transferOwnership(address payable newOwner) public onlyOwner {
require(newOwner != address(0), "Non-zero address required.");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
| contract Ownable {
address payable private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner() {
require(msg.sender == _owner, "Forbidden");
_;
}
constructor() public {
_owner = msg.sender;
}
function owner() public view returns (address payable) {
return _owner;
}
function transferOwnership(address payable newOwner) public onlyOwner {
require(newOwner != address(0), "Non-zero address required.");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
| 23,083 |
23 | // Convert unsigned 256-bit integer number into signed 64.64-bit fixed pointnumber.Revert on overflow.x unsigned 256-bit integer numberreturn signed 64.64-bit fixed point number / | function fromUInt (uint256 x) internal pure returns (int128) {
unchecked {
require (x <= 0x7FFFFFFFFFFFFFFF);
return int128 (int256 (x << 64));
}
}
| function fromUInt (uint256 x) internal pure returns (int128) {
unchecked {
require (x <= 0x7FFFFFFFFFFFFFFF);
return int128 (int256 (x << 64));
}
}
| 26,567 |
18 | // Set open Result/result+=1; |
if(bets[_blockNumber][_i].number==result){
bets[_blockNumber][_i].result = 1;
bets[_blockNumber][_i].prize = bets[_blockNumber][_i].value * odds;
emit winnersEvt(_blockNumber,bets[_blockNumber][_i].addr,bets[_blockNumber][_i].value,bets[_blockNumber][_i].prize);
withdraw(bets[_blockNumber][_i].addr,bets[_blockNumber][_i].prize);
|
if(bets[_blockNumber][_i].number==result){
bets[_blockNumber][_i].result = 1;
bets[_blockNumber][_i].prize = bets[_blockNumber][_i].value * odds;
emit winnersEvt(_blockNumber,bets[_blockNumber][_i].addr,bets[_blockNumber][_i].value,bets[_blockNumber][_i].prize);
withdraw(bets[_blockNumber][_i].addr,bets[_blockNumber][_i].prize);
| 67,444 |
1,001 | // Emits a {WithdrawFee} event.Requirements:- Fee must be unlocked. / |
function withdrawFee(address to) external {
ValidatorService validatorService = ValidatorService(contractManager.getContract("ValidatorService"));
IERC20 skaleToken = IERC20(contractManager.getContract("SkaleToken"));
TimeHelpers timeHelpers = TimeHelpers(contractManager.getContract("TimeHelpers"));
ConstantsHolder constantsHolder = ConstantsHolder(contractManager.getContract("ConstantsHolder"));
|
function withdrawFee(address to) external {
ValidatorService validatorService = ValidatorService(contractManager.getContract("ValidatorService"));
IERC20 skaleToken = IERC20(contractManager.getContract("SkaleToken"));
TimeHelpers timeHelpers = TimeHelpers(contractManager.getContract("TimeHelpers"));
ConstantsHolder constantsHolder = ConstantsHolder(contractManager.getContract("ConstantsHolder"));
| 2,836 |
13 | // Retrieves the total number of batches submitted.return _totalBatches Total submitted batches. / | function getTotalBatches() public view returns (uint256 _totalBatches) {
return batches().length();
}
| function getTotalBatches() public view returns (uint256 _totalBatches) {
return batches().length();
}
| 48,318 |
445 | // sumCollateral += tokensToDenomgTokenBalance | (mErr, vars.sumCollateral) = mulScalarTruncateAddUInt(vars.tokensToDenom, vars.gTokenBalance, vars.sumCollateral);
if (mErr != MathError.NO_ERROR) {
return (Error.MATH_ERROR, 0, 0);
}
| (mErr, vars.sumCollateral) = mulScalarTruncateAddUInt(vars.tokensToDenom, vars.gTokenBalance, vars.sumCollateral);
if (mErr != MathError.NO_ERROR) {
return (Error.MATH_ERROR, 0, 0);
}
| 45,402 |
76 | // Maximum amount that each participant is allowed to contribute (in WEI), during the restricted period. | mapping (address => uint256) public participationCaps;
| mapping (address => uint256) public participationCaps;
| 14,387 |
53 | // Modifier functions // Check state of AMM / | function ammIsActive() private view {
require(state == AMMGlobalState.Activated, "AMM: AMM not active");
}
| function ammIsActive() private view {
require(state == AMMGlobalState.Activated, "AMM: AMM not active");
}
| 61,605 |
154 | // BXM to ETH base rate | uint256 public constant EXCHANGE_RATE = 210;
| uint256 public constant EXCHANGE_RATE = 210;
| 44,139 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.