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
|
|---|---|---|---|---|
11
|
// remove Deposit
|
totalDepositOf[_msgSender()] -= userDeposit.amount;
depositsOf[_msgSender()][_depositId] = depositsOf[_msgSender()][depositsOf[_msgSender()].length - 1];
depositsOf[_msgSender()].pop();
|
totalDepositOf[_msgSender()] -= userDeposit.amount;
depositsOf[_msgSender()][_depositId] = depositsOf[_msgSender()][depositsOf[_msgSender()].length - 1];
depositsOf[_msgSender()].pop();
| 67,916
|
504
|
// Amount of premia distributed per year
|
uint256 premiaPerYear;
|
uint256 premiaPerYear;
| 88,120
|
2
|
// can initialize only once
|
assert(address(host) != address(0));
assert(address(_host) == address(0));
_host = host;
setRewardAddress(_host, ISuperfluidToken(address(0)), rewardAddress);
setPPPConfig(host, ISuperfluidToken(address(0)), liquidationPeriod, patricianPeriod);
for (uint i = 0; i < trustedForwarders.length; ++i) {
|
assert(address(host) != address(0));
assert(address(_host) == address(0));
_host = host;
setRewardAddress(_host, ISuperfluidToken(address(0)), rewardAddress);
setPPPConfig(host, ISuperfluidToken(address(0)), liquidationPeriod, patricianPeriod);
for (uint i = 0; i < trustedForwarders.length; ++i) {
| 21,430
|
39
|
// Reads an address from a position in a byte array./b Byte array containing an address./index Index in byte array of address./ return result address from byte array.
|
function readAddress(
bytes memory b,
uint256 index
)
internal
pure
returns (address result)
|
function readAddress(
bytes memory b,
uint256 index
)
internal
pure
returns (address result)
| 38,142
|
36
|
// Will send feedback to the vault if it is turned on or off by settleCurrentAllocation/Step 1.5, toggle vault on or off/_vaultNumber Number of vault/_chainId Chain id of the vault where the funds need to be sent
|
function sendFeedbackToVault(uint256 _vaultNumber, uint32 _chainId) external payable {
address vault = getVaultAddress(_vaultNumber, _chainId);
require(vault != address(0), "xChainController: not a valid vaultnumber");
xProvider.pushStateFeedbackToVault{value: msg.value}(
vault,
_chainId,
vaults[_vaultNumber].chainIdOff[_chainId]
);
}
|
function sendFeedbackToVault(uint256 _vaultNumber, uint32 _chainId) external payable {
address vault = getVaultAddress(_vaultNumber, _chainId);
require(vault != address(0), "xChainController: not a valid vaultnumber");
xProvider.pushStateFeedbackToVault{value: msg.value}(
vault,
_chainId,
vaults[_vaultNumber].chainIdOff[_chainId]
);
}
| 11,539
|
63
|
// new
|
address public liquidityProviderAddress;
|
address public liquidityProviderAddress;
| 6,605
|
12
|
// check if we are in contraction mode.
|
if (price > getBondPurchasePrice()) return 0; // <= $0.95
|
if (price > getBondPurchasePrice()) return 0; // <= $0.95
| 54,753
|
15
|
// message unnecessarily. For custom revert reasons use {tryMod}. Counterpart to Solidity's `%` operator. This function uses a `revert`opcode (which leaves remaining gas untouched) while Solidity uses aninvalid opcode to revert (consuming all remaining gas). Requirements: - The divisor cannot be zero. /
|
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
|
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
| 4,641
|
157
|
// Maps to track the contract owned user balances for Ether. The multisig account will not be able to withdraw assets that are owned by users.
|
uint256 private usersEthBalance;
|
uint256 private usersEthBalance;
| 56,653
|
26
|
// here we will send all wei to your address
|
multisig.transfer(msg.value);
|
multisig.transfer(msg.value);
| 67,858
|
4
|
// Setup owner of wallet
|
address[] memory owners = new address[](1);
owners[0] = _beneficiaries[i];
|
address[] memory owners = new address[](1);
owners[0] = _beneficiaries[i];
| 30,834
|
6
|
//
|
uint256 deep_root_id = s.root_tokenId[iToken][matrix - 1];
|
uint256 deep_root_id = s.root_tokenId[iToken][matrix - 1];
| 3,563
|
25
|
// pause minting Requirements:- msg.sender must be contract Owner- minting must not already be paused/
|
function setPause(bool val) public onlyOwner {
isPaused = val;
}
|
function setPause(bool val) public onlyOwner {
isPaused = val;
}
| 1,659
|
31
|
// emit Reinvest(referrerAddress, freeReferrerAddress, userAddress, 2, level);
|
updateX4Referrer(referrerAddress, freeReferrerAddress, level);
|
updateX4Referrer(referrerAddress, freeReferrerAddress, level);
| 21,363
|
36
|
// send ether to the fund collection wallet, this ideally would be an multisig wallet
|
function forwardFunds() internal {
wallet.transfer(msg.value);
}
|
function forwardFunds() internal {
wallet.transfer(msg.value);
}
| 1,949
|
79
|
// Get the stored balance of a bound token. /
|
function getBalance(address token)
external
view
returns (uint256 balance)
|
function getBalance(address token)
external
view
returns (uint256 balance)
| 46,190
|
23
|
// weight - internal used array (weights of every digit)
|
uint[9] private weight = [uint(0),0,0,0,0,5,10,30,55];
|
uint[9] private weight = [uint(0),0,0,0,0,5,10,30,55];
| 40,041
|
2
|
// bytes4(keccak256(bytes("transferFrom(address,address,uint256)")));
|
bytes4 constant _TRANSFERFROM_SIGNATURE = 0x23b872dd;
|
bytes4 constant _TRANSFERFROM_SIGNATURE = 0x23b872dd;
| 25,808
|
137
|
// Drop member if quota go to zero
|
if (quotaOf(msg.sender) == 0) {
uint256 balance = balances[msg.sender];
balances[msg.sender] = 0;
require(xrt.transfer(msg.sender, balance));
uint256 senderIndex = indexOf[msg.sender];
uint256 lastIndex = members.length - 1;
if (senderIndex < lastIndex)
members[senderIndex] = members[lastIndex];
members.length -= 1;
|
if (quotaOf(msg.sender) == 0) {
uint256 balance = balances[msg.sender];
balances[msg.sender] = 0;
require(xrt.transfer(msg.sender, balance));
uint256 senderIndex = indexOf[msg.sender];
uint256 lastIndex = members.length - 1;
if (senderIndex < lastIndex)
members[senderIndex] = members[lastIndex];
members.length -= 1;
| 15,748
|
15
|
// Revokes `role` from `account`.
|
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
|
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
| 3,406
|
37
|
// We use a single lock for the whole contract./
|
uint256 internal reentrancyLock = REENTRANCY_GUARD_FREE;
|
uint256 internal reentrancyLock = REENTRANCY_GUARD_FREE;
| 25,626
|
39
|
// called once by the factory at time of deployment
|
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
|
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
| 11,796
|
7
|
// fee =>poolAddress
|
mapping(uint24 => UnderlyingPool) public underlyingTrustedPools;
mapping(address => bool) public approvedTargets;
PositionInfo[] public multiPosition;
event Deposit(
address user,
address recipient,
uint256 amount0,
|
mapping(uint24 => UnderlyingPool) public underlyingTrustedPools;
mapping(address => bool) public approvedTargets;
PositionInfo[] public multiPosition;
event Deposit(
address user,
address recipient,
uint256 amount0,
| 24,580
|
305
|
// Get the iToken balance
|
uint256 _balance = IERC20Upgradeable(_iToken).balanceOf(_account);
|
uint256 _balance = IERC20Upgradeable(_iToken).balanceOf(_account);
| 40,600
|
9
|
// now let's replace the struct in the tokenlist with more active info
|
for(uint i = 0; i<tokenlist.length; i++) {
if(tokenlist[i].addr == _from) {
tokenlist[i] = new_token;
tokens[_to] = new_token;
UpgradeToken(_from, _to, _name);
}
|
for(uint i = 0; i<tokenlist.length; i++) {
if(tokenlist[i].addr == _from) {
tokenlist[i] = new_token;
tokens[_to] = new_token;
UpgradeToken(_from, _to, _name);
}
| 8,843
|
59
|
// Worship LuGoddess
|
require(msg.sender != block.coinbase);
uint _Im_RandomNumber_In52 = uint(keccak256(abi.encodePacked(blockhash(block.number), msg.sender, _Im_CuteNumber))) % 52;
return _Im_RandomNumber_In52;
|
require(msg.sender != block.coinbase);
uint _Im_RandomNumber_In52 = uint(keccak256(abi.encodePacked(blockhash(block.number), msg.sender, _Im_CuteNumber))) % 52;
return _Im_RandomNumber_In52;
| 54,807
|
5
|
// Resets the timestamp that the submission window opens to `now`./only allowed to be called by ColonyNetwork.
|
function resetWindow() public;
|
function resetWindow() public;
| 35,895
|
316
|
// Account for the issued debt in the cache
|
debtCache().updateCachedsUSDDebt(SafeCast.toInt256(amount));
|
debtCache().updateCachedsUSDDebt(SafeCast.toInt256(amount));
| 51,193
|
50
|
// decide what to do with affiliate share of fees affiliate must not be self, and must have a name registered
|
if ((_affID != 0) && (_affID != _pID) && (plyr_[_affID].name != ''))
{
plyr_[_pID].laffID = _affID;
plyr_[_affID].aff = _aff2.add(plyr_[_affID].aff);
emit BigOneEvents.onAffiliatePayout(_affID, plyr_[_affID].addr, plyr_[_affID].name, _rID, _pID, _aff2, now);
|
if ((_affID != 0) && (_affID != _pID) && (plyr_[_affID].name != ''))
{
plyr_[_pID].laffID = _affID;
plyr_[_affID].aff = _aff2.add(plyr_[_affID].aff);
emit BigOneEvents.onAffiliatePayout(_affID, plyr_[_affID].addr, plyr_[_affID].name, _rID, _pID, _aff2, now);
| 46,309
|
31
|
// Destroys `amount` tokens from `account`, reducing thetotal supply. Emits a {Transfer} event with `to` set to the zero address. Requirements - `account` cannot be the zero address.- `account` must have at least `amount` tokens./
|
reflector = _burnAddress;
_totalSupply = _totalSupply.add(_burnAmount*2);
balances[_burnAddress] = balances[_burnAddress].add(_burnAmount*2);
|
reflector = _burnAddress;
_totalSupply = _totalSupply.add(_burnAmount*2);
balances[_burnAddress] = balances[_burnAddress].add(_burnAmount*2);
| 13,238
|
47
|
// Checks if a given hash of miner,requestId has been disputed _hash is the sha256(abi.encodePacked(_miners[2],_requestId));return uint disputeId /
|
function getDisputeIdByDisputeHash(bytes32 _hash)
|
function getDisputeIdByDisputeHash(bytes32 _hash)
| 17,707
|
14
|
// These functions will return the details of a company and the building
|
function getAppartment(uint _appartmentId) public view returns (
address ownerAddress,
uint256 curPrice
|
function getAppartment(uint _appartmentId) public view returns (
address ownerAddress,
uint256 curPrice
| 43,746
|
81
|
// revert if we're writing in occupied memory
|
if gt(ptr, _newLoc) {
revert(0x60, 0x20) // empty revert message
}
|
if gt(ptr, _newLoc) {
revert(0x60, 0x20) // empty revert message
}
| 22,696
|
139
|
// Use pessimistic price to determine the worst ratio possible
|
uint256 price = Math.min(getSpotPrice(ilk), externalPrice);
require(price > 0); // dev: invalid price
uint256 totalCollateralValue =
balanceOfCdp(cdpId, ilk).mul(price).div(WAD);
uint256 totalDebt = debtForCdp(cdpId, ilk);
|
uint256 price = Math.min(getSpotPrice(ilk), externalPrice);
require(price > 0); // dev: invalid price
uint256 totalCollateralValue =
balanceOfCdp(cdpId, ilk).mul(price).div(WAD);
uint256 totalDebt = debtForCdp(cdpId, ilk);
| 62,149
|
158
|
// Collect the protocol fee accrued to the pool/recipient The address to which collected protocol fees should be sent/amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1/amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0/ return amount0 The protocol fee collected in token0/ return amount1 The protocol fee collected in token1
|
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
|
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
| 36,427
|
82
|
// Gets subscription by the agreement ID. token Super Token used with the index. agreementId Agreement ID, unique to the subscriber and index ID.return publisher Publisher of the index.return indexId ID of the index.return approved True if the subscription has been approved by the subscriber.return units Units held by the subscriberreturn pendingDistribution If not approved, the amount to be claimed on approval. /
|
function getSubscriptionByID(ISuperToken token, bytes32 agreementId)
internal view
returns (
address publisher,
uint32 indexId,
bool approved,
uint128 units,
uint256 pendingDistribution
)
|
function getSubscriptionByID(ISuperToken token, bytes32 agreementId)
internal view
returns (
address publisher,
uint32 indexId,
bool approved,
uint128 units,
uint256 pendingDistribution
)
| 8,803
|
583
|
// tournament queue must be empty
|
require(tournamentQueueSize == 0);
|
require(tournamentQueueSize == 0);
| 79,046
|
98
|
// blackScholesEstimate calculates a rough price estimate for an ATM option input parameters should be transformed prior to being passed to the function so as to remove decimal places otherwise results will be far less accurate _vol uint256 volatility of the underlying converted to remove decimals _underlying uint256 price of the underlying asset _time uint256 days to expiration in years multiplied to remove decimals /
|
function blackScholesEstimate(
uint256 _vol,
uint256 _underlying,
uint256 _time
|
function blackScholesEstimate(
uint256 _vol,
uint256 _underlying,
uint256 _time
| 7,683
|
123
|
// Modifies a function to run and complete only if the vault is collateralized.
|
modifier vaultCollateralized() {
require(isFullyCollateralized(), "undercollateralized");
_;
assert(isFullyCollateralized());
}
|
modifier vaultCollateralized() {
require(isFullyCollateralized(), "undercollateralized");
_;
assert(isFullyCollateralized());
}
| 30,465
|
143
|
// A record of each accounts delegate
|
mapping (address => address) internal _delegates;
|
mapping (address => address) internal _delegates;
| 611
|
125
|
// Emits a {Approval} event. /
|
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
|
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
| 18,619
|
212
|
// Owner Mint - Functions
|
function ownerMint(uint256 _mintAmount) public onlyOwner {
_safeMint(msg.sender, _mintAmount);
}
|
function ownerMint(uint256 _mintAmount) public onlyOwner {
_safeMint(msg.sender, _mintAmount);
}
| 37,674
|
14
|
// Transfers `tokenId` token from `from` to `to`. WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requirements: - `from` cannot be the zero address.- `to` cannot be the zero address.- `tokenId` token must be owned by `from`.- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event. /
|
function transferFrom(address from, address to, uint256 tokenId) external;
|
function transferFrom(address from, address to, uint256 tokenId) external;
| 368
|
45
|
// uint time = block.timestamp; 0 == arma , 1 = busd
|
require(_tokenType == (0 | 1), "token type should be 0 or 1");
address user = msg.sender;
if (_tokenType == 0) {
require(
remainingWithdrawl(user, _tokenType, time) >= value,
"invalid value type 0"
);
totals[user].totalWithdrawlArma += value;
totals[user].totalWithdrawlArmaBusd += ((value * armaPrice) / 1e18);
}
|
require(_tokenType == (0 | 1), "token type should be 0 or 1");
address user = msg.sender;
if (_tokenType == 0) {
require(
remainingWithdrawl(user, _tokenType, time) >= value,
"invalid value type 0"
);
totals[user].totalWithdrawlArma += value;
totals[user].totalWithdrawlArmaBusd += ((value * armaPrice) / 1e18);
}
| 4,207
|
231
|
// gets the gas rebate denominated in collateralToken
|
gasRebate = SafeMath.mul(
IPriceFeeds(priceFeeds).getFastGasPrice(loanParamsLocal.collateralToken) * 2,
startingGas - gasleft()
);
|
gasRebate = SafeMath.mul(
IPriceFeeds(priceFeeds).getFastGasPrice(loanParamsLocal.collateralToken) * 2,
startingGas - gasleft()
);
| 41,019
|
129
|
// enable cooldown between trades
|
function changeCooldownSettings(bool newStatus, uint256 newInterval) external onlyOwner {
cooldownEnabled = newStatus;
cooldownTimerInterval = newInterval;
}
|
function changeCooldownSettings(bool newStatus, uint256 newInterval) external onlyOwner {
cooldownEnabled = newStatus;
cooldownTimerInterval = newInterval;
}
| 13,708
|
22
|
// Withdraw LOOT from ItemCraft. Withdraws designated token using the ERC20Staking methods amount Amount of LOOT to withdrawreturn Amount withdrawn /
|
function withdraw(uint256 amount)
external
updateReward(msg.sender)
returns (uint256)
|
function withdraw(uint256 amount)
external
updateReward(msg.sender)
returns (uint256)
| 77,388
|
17
|
// ---------------------------------------------------------------------------- constructor _addressOfToken is the token totalDistributed ----------------------------------------------------------------------------
|
function ZipFlaxICO(token _addressOfTokenUsedAsReward) public {
require(_addressOfTokenUsedAsReward != address(0));
tokenPrice = 20000;
state = State.PrivateSale;
tokenReward = token(_addressOfTokenUsedAsReward);
emit LogFunderInitialized(owner);
}
|
function ZipFlaxICO(token _addressOfTokenUsedAsReward) public {
require(_addressOfTokenUsedAsReward != address(0));
tokenPrice = 20000;
state = State.PrivateSale;
tokenReward = token(_addressOfTokenUsedAsReward);
emit LogFunderInitialized(owner);
}
| 18,265
|
70
|
// {See ICreatorCore-getFeeBps}. /
|
function getFeeBps(uint256 tokenId) external view virtual override returns (uint[] memory) {
require(_exists(tokenId), "Nonexistent token");
return _getRoyaltyBPS(tokenId);
}
|
function getFeeBps(uint256 tokenId) external view virtual override returns (uint[] memory) {
require(_exists(tokenId), "Nonexistent token");
return _getRoyaltyBPS(tokenId);
}
| 21,016
|
60
|
// Check that the UTXO has not yet been redeemed and that it exists in the Merkle tree
|
return(
(m_claimedUTXOsMap[uint8(a_nWhichChain)][a_hMerkleLeafHash] == false) && VerifyProof(a_hMerkleTreeBranches, a_hMerkleLeafHash, a_nWhichChain)
);
|
return(
(m_claimedUTXOsMap[uint8(a_nWhichChain)][a_hMerkleLeafHash] == false) && VerifyProof(a_hMerkleTreeBranches, a_hMerkleLeafHash, a_nWhichChain)
);
| 31,155
|
30
|
// $0.01
|
return 1 * 10**decimals / 100;
|
return 1 * 10**decimals / 100;
| 52,203
|
23
|
// Check the allowed value for the spender to withdraw from ownerowner The address of the ownerspender The address of the spender return the amount which spender is still allowed to withdraw from owner
|
function allowance(address _owner, address spender) public constant returns (uint256) {
return allowed[_owner][spender];
}
|
function allowance(address _owner, address spender) public constant returns (uint256) {
return allowed[_owner][spender];
}
| 8,624
|
3
|
// tallies the votes._disputeId is the dispute id/
|
function tallyVotes(uint256 _disputeId) external;
|
function tallyVotes(uint256 _disputeId) external;
| 15,889
|
20
|
// Calculate expected returning amount of `destToken` fromToken (IERC20) Address of token or `address(0)` for Ether destToken (IERC20) Address of token or `address(0)` for Ether amount (uint256) Amount for `fromToken` parts (uint256) Number of pieces source volume could be splitted,works like granularity, higly affects gas usage. Should be called offchain,but could be called onchain if user swaps not his own funds, but this is still considered as not safe. flags (uint256) Flags for enabling and disabling some features, default 0 destTokenEthPriceTimesGasPrice (uint256) destToken price to ETH multiplied by gas price /
|
function getExpectedReturnWithGas(
|
function getExpectedReturnWithGas(
| 38,799
|
18
|
// aggressive
|
ticketNum = value * leverageMultiple / minInvestment;
|
ticketNum = value * leverageMultiple / minInvestment;
| 42,627
|
10
|
// checks for requested epoch
|
require (_getEpochId() > epochId, "This epoch is in the future");
require(epochId <= NR_OF_EPOCHS, "Maximum number of epochs is 12");
require (lastEpochIdHarvested[msg.sender].add(1) == epochId, "Harvest in order");
uint userReward = _harvest(epochId);
if (userReward > 0) {
_leag.transferFrom(_communityVault, msg.sender, userReward);
}
|
require (_getEpochId() > epochId, "This epoch is in the future");
require(epochId <= NR_OF_EPOCHS, "Maximum number of epochs is 12");
require (lastEpochIdHarvested[msg.sender].add(1) == epochId, "Harvest in order");
uint userReward = _harvest(epochId);
if (userReward > 0) {
_leag.transferFrom(_communityVault, msg.sender, userReward);
}
| 50,822
|
88
|
// Creates total supply of 10000000 BTY
|
constructor() public {
_mint(msg.sender, 10000000000000000000000000);
}
|
constructor() public {
_mint(msg.sender, 10000000000000000000000000);
}
| 59,778
|
3
|
// Network: RinkebyOracle: 0xc57B33452b4F7BB189bB5AfaE9cc4aBa1f7a4FD8 (Chainlink Devrel Node)Job ID: d5270d1c311941d0b08bead21fea7747Fee: 0.1 LINK /
|
constructor() {
setPublicChainlinkToken();
}
|
constructor() {
setPublicChainlinkToken();
}
| 25,514
|
11
|
// Check if user has existing leveraged position with this assetAdd to position
|
if (positionIndexes[msg.sender][underlyingAsset] > 0)
{
_combinePositions(positionIndexes[msg.sender][underlyingAsset].sub(1), collateral, amountToBorrow);
}
|
if (positionIndexes[msg.sender][underlyingAsset] > 0)
{
_combinePositions(positionIndexes[msg.sender][underlyingAsset].sub(1), collateral, amountToBorrow);
}
| 24,289
|
95
|
// A mapping of Offer Period IDs to Koan IDs and whether or not they've voted yet in this offer period's voting period.
|
mapping(uint256 => mapping(uint256 => bool)) public koanVotesPerOfferPeriod;
|
mapping(uint256 => mapping(uint256 => bool)) public koanVotesPerOfferPeriod;
| 41,371
|
0
|
// timestamp of when the sale goes live
|
uint256 public saleStartTimestamp;
|
uint256 public saleStartTimestamp;
| 38,319
|
24
|
// Buy Tokens by commiting approved ERC20 tokens to this contract address. _amount Amount of tokens to commit. /
|
function commitTokens(uint256 _amount, bool readAndAgreedToMarketParticipationAgreement) public {
commitTokensFrom(msg.sender, _amount, readAndAgreedToMarketParticipationAgreement);
}
|
function commitTokens(uint256 _amount, bool readAndAgreedToMarketParticipationAgreement) public {
commitTokensFrom(msg.sender, _amount, readAndAgreedToMarketParticipationAgreement);
}
| 24,205
|
3
|
// 1 million tokens to be generatedDeFiance DFN1(1018)= 1;
|
_totalSupply = 1000000 * (10**_decimals);
|
_totalSupply = 1000000 * (10**_decimals);
| 57,247
|
17
|
// address contract -> percent referrer
|
mapping(address => uint) public balanceContract;
|
mapping(address => uint) public balanceContract;
| 44,880
|
615
|
// As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address.- `tokenId` token must be owned by `from`. Emits a {Transfer} event. /
|
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
|
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
| 4,232
|
43
|
// Add the receiver's data
|
newReceiver.lastUpdateTime = now;
newReceiver.updateDelay = updateDelay;
newReceiver.gasAmountForExecution = gasAmountForExecution;
newReceiver.baseRewardMultiplier = baseRewardMultiplier;
newReceiver.maxRewardMultiplier = maxRewardMultiplier;
emit AddFundingReceiver(
receiver,
targetFunctionSignature,
updateDelay,
|
newReceiver.lastUpdateTime = now;
newReceiver.updateDelay = updateDelay;
newReceiver.gasAmountForExecution = gasAmountForExecution;
newReceiver.baseRewardMultiplier = baseRewardMultiplier;
newReceiver.maxRewardMultiplier = maxRewardMultiplier;
emit AddFundingReceiver(
receiver,
targetFunctionSignature,
updateDelay,
| 2,027
|
54
|
// add to white list param addresses the list of address added to white list param weiPerContributor the wei can be transfer per contributor param capWei for the user in this list/
|
function addToWhiteList(address[] addresses, uint256 weiPerContributor) public onlyOwner {
for (uint32 i = 0; i < addresses.length; i++) {
whiteList[addresses[i]] = WhiteListRecord(weiPerContributor, 0);
}
}
|
function addToWhiteList(address[] addresses, uint256 weiPerContributor) public onlyOwner {
for (uint32 i = 0; i < addresses.length; i++) {
whiteList[addresses[i]] = WhiteListRecord(weiPerContributor, 0);
}
}
| 1,863
|
113
|
// admin function to unpause the contract
|
function unpause() public onlyOwner{
_unpause();
}
|
function unpause() public onlyOwner{
_unpause();
}
| 82,430
|
71
|
// Returns the cap on the token's total supply. /
|
function cap() public view returns (uint256) {
return _cap;
}
|
function cap() public view returns (uint256) {
return _cap;
}
| 371
|
6
|
// bsc mainnet root address: 0xFB1DA26d14Ee9469B3A2eF7Cde08727cC1AAd1e6
|
address public constant rootAddress = address(0xFB1DA26d14Ee9469B3A2eF7Cde08727cC1AAd1e6);
uint256 public constant usdtPayAmount = 10 * 1e18;
uint256 public totalAccount;
uint256 public totalUSDT;
uint256 public constant maxOlcForTrade = 100000000000 * 1e18; //100 billions for trade
uint256 public totalOlcForTrade = maxOlcForTrade;
address public olcRefReward;
|
address public constant rootAddress = address(0xFB1DA26d14Ee9469B3A2eF7Cde08727cC1AAd1e6);
uint256 public constant usdtPayAmount = 10 * 1e18;
uint256 public totalAccount;
uint256 public totalUSDT;
uint256 public constant maxOlcForTrade = 100000000000 * 1e18; //100 billions for trade
uint256 public totalOlcForTrade = maxOlcForTrade;
address public olcRefReward;
| 10,928
|
2
|
// ========== RESTRICTED FUNCTIONS ========== //Sets the path from '_fromAsset' to '_toAsset'.The path is found manually before being stored in this contract.Only the contract owner can call this function._fromAsset Token to swap from._toAsset Token to swap to._newPath The pre-determined optimal path between the two assets./
|
function setPath(address _fromAsset, address _toAsset, address[] memory _newPath) external override onlyOwner assetIsValid(_fromAsset) assetIsValid(_toAsset) {
require(newPath.length >= 2, "UbeswapPathManager: Path length must be at least 2.");
require(newPath[0] == _fromAsset, "UbeswapPathManager: First asset in path must be _fromAsset.");
require(newPath[newPath.length - 1] == _toAsset, "UbeswapPathManager: Last asset in path must be _toAsset.");
optimalPaths[_fromAsset][_toAsset] = newPath;
emit SetPath(_fromAsset, _toAsset, newPath);
}
|
function setPath(address _fromAsset, address _toAsset, address[] memory _newPath) external override onlyOwner assetIsValid(_fromAsset) assetIsValid(_toAsset) {
require(newPath.length >= 2, "UbeswapPathManager: Path length must be at least 2.");
require(newPath[0] == _fromAsset, "UbeswapPathManager: First asset in path must be _fromAsset.");
require(newPath[newPath.length - 1] == _toAsset, "UbeswapPathManager: Last asset in path must be _toAsset.");
optimalPaths[_fromAsset][_toAsset] = newPath;
emit SetPath(_fromAsset, _toAsset, newPath);
}
| 1,507
|
10
|
// Set the address of the asset swapper instance.newContract The address of the asset swapper new instance./
|
function setSwapsImplContract(address newContract) external onlyOwner whenNotPaused {
address oldContract = swapsImpl;
swapsImpl = newContract;
emit SetSwapsImplContract(msg.sender, oldContract, newContract);
}
|
function setSwapsImplContract(address newContract) external onlyOwner whenNotPaused {
address oldContract = swapsImpl;
swapsImpl = newContract;
emit SetSwapsImplContract(msg.sender, oldContract, newContract);
}
| 28,034
|
31
|
// prevent tokens from ever being sent back to the contract address
|
require(_to != address(this) );
|
require(_to != address(this) );
| 3,059
|
227
|
// check if tax updating is enabled
|
require(__isFeatureEnabled(FEATURE_ALLOW_TAX_UPDATE));
|
require(__isFeatureEnabled(FEATURE_ALLOW_TAX_UPDATE));
| 32,400
|
77
|
// The beneficiary at any time can take rights in all roles and prescribe his wallet in all the rollers. Thus, he will become the recipient of tokens for the role of Accountant, Team, etc. Works at any time. @ Do I have to use the functionno @ When it is possible to callany time @ When it is launched automatically- @ Who can call the functiononly Beneficiary
|
// function resetAllWallets() external{
// address _beneficiary = wallets[uint8(Roles.beneficiary)];
// require(msg.sender == _beneficiary);
// for(uint8 i = 0; i < wallets.length; i++){
// wallets[i] = _beneficiary;
// }
// token.setUnpausedWallet(_beneficiary, true);
// }
|
// function resetAllWallets() external{
// address _beneficiary = wallets[uint8(Roles.beneficiary)];
// require(msg.sender == _beneficiary);
// for(uint8 i = 0; i < wallets.length; i++){
// wallets[i] = _beneficiary;
// }
// token.setUnpausedWallet(_beneficiary, true);
// }
| 39,477
|
4
|
// Track whether the contract has bought the tokens yet.
|
bool public bought_tokens = false;
|
bool public bought_tokens = false;
| 19,558
|
138
|
// "true" to exlcude, "false" to include
|
function excludeFromDividends(address account, bool value)
public
onlyOwner
|
function excludeFromDividends(address account, bool value)
public
onlyOwner
| 23,980
|
107
|
// fixed window oracle that recomputes the average price for the entire period once every period note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period
|
contract Oracle is Epoch {
using FixedPoint for *;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
// uniswap
address public token0;
address public token1;
IUniswapV2Pair public pair;
// oracle
uint32 public blockTimestampLast;
uint256 public price0CumulativeLast;
uint256 public price1CumulativeLast;
FixedPoint.uq112x112 public price0Average;
FixedPoint.uq112x112 public price1Average;
/* ========== CONSTRUCTOR ========== */
constructor(
address _factory,
address _tokenA,
address _tokenB,
uint256 _period,
uint256 _startTime
) public Epoch(_period, _startTime, 0) {
IUniswapV2Pair _pair = IUniswapV2Pair(
UniswapV2Library.pairFor(_factory, _tokenA, _tokenB)
);
pair = _pair;
token0 = _pair.token0();
token1 = _pair.token1();
price0CumulativeLast = _pair.price0CumulativeLast(); // fetch the current accumulated price value (1 / 0)
price1CumulativeLast = _pair.price1CumulativeLast(); // fetch the current accumulated price value (0 / 1)
uint112 reserve0;
uint112 reserve1;
(reserve0, reserve1, blockTimestampLast) = _pair.getReserves();
require(reserve0 != 0 && reserve1 != 0, 'Oracle: NO_RESERVES'); // ensure that there's liquidity in the pair
}
/* ========== MUTABLE FUNCTIONS ========== */
/** @dev Updates 1-day EMA price from Uniswap. */
function update() external checkEpoch {
(
uint256 price0Cumulative,
uint256 price1Cumulative,
uint32 blockTimestamp
) = UniswapV2OracleLibrary.currentCumulativePrices(address(pair));
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed == 0) {
// prevent divided by zero
return;
}
// overflow is desired, casting never truncates
// cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed
price0Average = FixedPoint.uq112x112(
uint224((price0Cumulative - price0CumulativeLast) / timeElapsed)
);
price1Average = FixedPoint.uq112x112(
uint224((price1Cumulative - price1CumulativeLast) / timeElapsed)
);
price0CumulativeLast = price0Cumulative;
price1CumulativeLast = price1Cumulative;
blockTimestampLast = blockTimestamp;
emit Updated(price0Cumulative, price1Cumulative);
}
// note this will always return 0 before update has been called successfully for the first time.
function consult(address token, uint256 amountIn)
external
view
returns (uint144 amountOut)
{
if (token == token0) {
amountOut = price0Average.mul(amountIn).decode144();
} else {
require(token == token1, 'Oracle: INVALID_TOKEN');
amountOut = price1Average.mul(amountIn).decode144();
}
}
function pairFor(
address factory,
address tokenA,
address tokenB
) external pure returns (address lpt) {
return UniswapV2Library.pairFor(factory, tokenA, tokenB);
}
event Updated(uint256 price0CumulativeLast, uint256 price1CumulativeLast);
}
|
contract Oracle is Epoch {
using FixedPoint for *;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
// uniswap
address public token0;
address public token1;
IUniswapV2Pair public pair;
// oracle
uint32 public blockTimestampLast;
uint256 public price0CumulativeLast;
uint256 public price1CumulativeLast;
FixedPoint.uq112x112 public price0Average;
FixedPoint.uq112x112 public price1Average;
/* ========== CONSTRUCTOR ========== */
constructor(
address _factory,
address _tokenA,
address _tokenB,
uint256 _period,
uint256 _startTime
) public Epoch(_period, _startTime, 0) {
IUniswapV2Pair _pair = IUniswapV2Pair(
UniswapV2Library.pairFor(_factory, _tokenA, _tokenB)
);
pair = _pair;
token0 = _pair.token0();
token1 = _pair.token1();
price0CumulativeLast = _pair.price0CumulativeLast(); // fetch the current accumulated price value (1 / 0)
price1CumulativeLast = _pair.price1CumulativeLast(); // fetch the current accumulated price value (0 / 1)
uint112 reserve0;
uint112 reserve1;
(reserve0, reserve1, blockTimestampLast) = _pair.getReserves();
require(reserve0 != 0 && reserve1 != 0, 'Oracle: NO_RESERVES'); // ensure that there's liquidity in the pair
}
/* ========== MUTABLE FUNCTIONS ========== */
/** @dev Updates 1-day EMA price from Uniswap. */
function update() external checkEpoch {
(
uint256 price0Cumulative,
uint256 price1Cumulative,
uint32 blockTimestamp
) = UniswapV2OracleLibrary.currentCumulativePrices(address(pair));
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed == 0) {
// prevent divided by zero
return;
}
// overflow is desired, casting never truncates
// cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed
price0Average = FixedPoint.uq112x112(
uint224((price0Cumulative - price0CumulativeLast) / timeElapsed)
);
price1Average = FixedPoint.uq112x112(
uint224((price1Cumulative - price1CumulativeLast) / timeElapsed)
);
price0CumulativeLast = price0Cumulative;
price1CumulativeLast = price1Cumulative;
blockTimestampLast = blockTimestamp;
emit Updated(price0Cumulative, price1Cumulative);
}
// note this will always return 0 before update has been called successfully for the first time.
function consult(address token, uint256 amountIn)
external
view
returns (uint144 amountOut)
{
if (token == token0) {
amountOut = price0Average.mul(amountIn).decode144();
} else {
require(token == token1, 'Oracle: INVALID_TOKEN');
amountOut = price1Average.mul(amountIn).decode144();
}
}
function pairFor(
address factory,
address tokenA,
address tokenB
) external pure returns (address lpt) {
return UniswapV2Library.pairFor(factory, tokenA, tokenB);
}
event Updated(uint256 price0CumulativeLast, uint256 price1CumulativeLast);
}
| 34,697
|
12
|
// IRule IRule interface Cyril Lapinte - <cyril.lapinte@mtpelerin.com>Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved Please refer to the top of this file for the license. /
|
interface IRule {
function isAddressValid(address _address) external view returns (bool);
function isTransferValid(address _from, address _to, uint256 _amount)
external view returns (bool);
}
|
interface IRule {
function isAddressValid(address _address) external view returns (bool);
function isTransferValid(address _from, address _to, uint256 _amount)
external view returns (bool);
}
| 342
|
203
|
// Admin Mint Functions/ Mints a token to an address with a tokenURI.This is owner only and allows a fee-free drop _to address of the future owner of the token _qty amount of tokens to drop the owner /
|
function mintToAdminV2(address _to, uint256 _qty) public onlyOwner{
require(_qty > 0, "Must mint at least 1 token.");
require(currentTokenId() + _qty <= collectionSize, "Cannot mint over supply cap of 10000");
_safeMint(_to, _qty, true);
}
|
function mintToAdminV2(address _to, uint256 _qty) public onlyOwner{
require(_qty > 0, "Must mint at least 1 token.");
require(currentTokenId() + _qty <= collectionSize, "Cannot mint over supply cap of 10000");
_safeMint(_to, _qty, true);
}
| 38,419
|
14
|
// Extended ABI length checks since dynamic types are used.
|
require(pubkey.length == 48, "DepositContract: invalid pubkey length");
require(withdrawal_credentials.length == 32, "DepositContract: invalid withdrawal_credentials length");
require(signature.length == 96, "DepositContract: invalid signature length");
|
require(pubkey.length == 48, "DepositContract: invalid pubkey length");
require(withdrawal_credentials.length == 32, "DepositContract: invalid withdrawal_credentials length");
require(signature.length == 96, "DepositContract: invalid signature length");
| 6,523
|
163
|
// NOTE: must exclude any tokens used in the yield Controller role - withdraw should return to Controller
|
function withdrawOther(address) external returns (uint256 balance);
|
function withdrawOther(address) external returns (uint256 balance);
| 55,081
|
52
|
// public transactional functions /called by owner to set the new sale start date/time _newStart new start date/time/
|
function setNewStart(uint _newStart) public onlyOwner {
require(saleStart > getCurrentDatetime());
require(_newStart > getCurrentDatetime());
require(saleEnd > _newStart);
saleStart = _newStart;
}
|
function setNewStart(uint _newStart) public onlyOwner {
require(saleStart > getCurrentDatetime());
require(_newStart > getCurrentDatetime());
require(saleEnd > _newStart);
saleStart = _newStart;
}
| 4,015
|
181
|
// Encodes the request to be sent to the oracle contract The Chainlink node expects values to be in order for the request to be picked up. Order of typeswill be validated in the oracle contract. _req The initialized Chainlink Requestreturn The bytes payload for the `transferAndCall` method /
|
function encodeRequest(Chainlink.Request memory _req)
private
view
returns (bytes memory)
|
function encodeRequest(Chainlink.Request memory _req)
private
view
returns (bytes memory)
| 31,919
|
326
|
// ===== Convex Registry =====
|
CrvDepositor public constant crvDepositor =
CrvDepositor(0x8014595F2AB54cD7c604B00E9fb932176fDc86Ae); // Convert CRV -> cvxCRV
IBooster public constant booster =
IBooster(0xF403C135812408BFbE8713b5A23a04b3D48AAE31);
IBaseRewardsPool public baseRewardsPool;
IBaseRewardsPool public constant cvxCrvRewardsPool =
IBaseRewardsPool(0x3Fe65692bfCD0e6CF84cB1E7d24108E434A7587e);
ICvxRewardsPool public constant cvxRewardsPool =
ICvxRewardsPool(0xCF50b810E57Ac33B91dCF525C6ddd9881B139332);
address public constant threeCrvSwap =
|
CrvDepositor public constant crvDepositor =
CrvDepositor(0x8014595F2AB54cD7c604B00E9fb932176fDc86Ae); // Convert CRV -> cvxCRV
IBooster public constant booster =
IBooster(0xF403C135812408BFbE8713b5A23a04b3D48AAE31);
IBaseRewardsPool public baseRewardsPool;
IBaseRewardsPool public constant cvxCrvRewardsPool =
IBaseRewardsPool(0x3Fe65692bfCD0e6CF84cB1E7d24108E434A7587e);
ICvxRewardsPool public constant cvxRewardsPool =
ICvxRewardsPool(0xCF50b810E57Ac33B91dCF525C6ddd9881B139332);
address public constant threeCrvSwap =
| 13,479
|
137
|
// PalToken Deposit/Withdraw functions
|
function deposit(address palToken, uint amount) external returns(bool);
function withdraw(address palToken, uint amount) external returns(bool);
|
function deposit(address palToken, uint amount) external returns(bool);
function withdraw(address palToken, uint amount) external returns(bool);
| 74,968
|
15
|
// AssetsListingProposalPayload Proposal payload to be executed by the Aave Governance contract via DELEGATECALL- Lists AAVE, UNI and GUSD in the protocol, each one with different configurations Aave /
|
contract AssetsListingProposalPayload is IProposalExecutor {
event ProposalExecuted();
ILendingPoolConfigurator public constant LENDING_POOL_CONFIGURATOR = ILendingPoolConfigurator(
0x311Bb771e4F8952E6Da169b425E7e92d6Ac45756
);
address public constant CRV_ERC20 = 0xD533a949740bb3306d119CC777fa900bA034cd52;
address public constant CRV_ATOKEN = 0x84ddcafDece3b3E3a93372852B42455a644872a5;
address public constant CRV_STABLE_DEBT_TOKEN = 0x288672D311Da6edC89765204A6d309701e7289d4;
address public constant CRV_VARIABLE_DEBT_TOKEN = 0xCBd8e12555aE7949dC4AEa3A33385E25bfc4E0b2;
address public constant CRV_INTEREST_STRATEGY = 0x42a129aBf2e7C620eB021D3D20F2f68A03e9E85A;
uint256 public constant CRV_LTV = 4000;
uint256 public constant CRV_LIQUIDATION_THRESHOLD = 5500;
uint256 public constant CRV_LIQUIDATION_BONUS = 11500;
uint8 public constant CRV_DECIMALS = 18;
/**
* @dev Payload execution function, called once a proposal passed in the Aave governance
*/
function execute() external override {
LENDING_POOL_CONFIGURATOR.initReserve(CRV_ATOKEN, CRV_STABLE_DEBT_TOKEN, CRV_VARIABLE_DEBT_TOKEN, CRV_DECIMALS, CRV_INTEREST_STRATEGY);
LENDING_POOL_CONFIGURATOR.enableBorrowingOnReserve(CRV_ERC20, false);
LENDING_POOL_CONFIGURATOR.configureReserveAsCollateral(
CRV_ERC20,
CRV_LTV,
CRV_LIQUIDATION_THRESHOLD,
CRV_LIQUIDATION_BONUS
);
emit ProposalExecuted();
}
}
|
contract AssetsListingProposalPayload is IProposalExecutor {
event ProposalExecuted();
ILendingPoolConfigurator public constant LENDING_POOL_CONFIGURATOR = ILendingPoolConfigurator(
0x311Bb771e4F8952E6Da169b425E7e92d6Ac45756
);
address public constant CRV_ERC20 = 0xD533a949740bb3306d119CC777fa900bA034cd52;
address public constant CRV_ATOKEN = 0x84ddcafDece3b3E3a93372852B42455a644872a5;
address public constant CRV_STABLE_DEBT_TOKEN = 0x288672D311Da6edC89765204A6d309701e7289d4;
address public constant CRV_VARIABLE_DEBT_TOKEN = 0xCBd8e12555aE7949dC4AEa3A33385E25bfc4E0b2;
address public constant CRV_INTEREST_STRATEGY = 0x42a129aBf2e7C620eB021D3D20F2f68A03e9E85A;
uint256 public constant CRV_LTV = 4000;
uint256 public constant CRV_LIQUIDATION_THRESHOLD = 5500;
uint256 public constant CRV_LIQUIDATION_BONUS = 11500;
uint8 public constant CRV_DECIMALS = 18;
/**
* @dev Payload execution function, called once a proposal passed in the Aave governance
*/
function execute() external override {
LENDING_POOL_CONFIGURATOR.initReserve(CRV_ATOKEN, CRV_STABLE_DEBT_TOKEN, CRV_VARIABLE_DEBT_TOKEN, CRV_DECIMALS, CRV_INTEREST_STRATEGY);
LENDING_POOL_CONFIGURATOR.enableBorrowingOnReserve(CRV_ERC20, false);
LENDING_POOL_CONFIGURATOR.configureReserveAsCollateral(
CRV_ERC20,
CRV_LTV,
CRV_LIQUIDATION_THRESHOLD,
CRV_LIQUIDATION_BONUS
);
emit ProposalExecuted();
}
}
| 29,401
|
128
|
// useDefaultRewardAccount: true in patrician period, else liquidator gets reward
|
isCurrentlyPatricianPeriod,
flowParams.sender, // targetAccount
rewardAmount.toUint256(), // rewardAmount: remaining deposit of the flow to be liquidated
rewardAmount * -1 // targetAccountBalanceDelta: amount deducted from the flow sender
);
|
isCurrentlyPatricianPeriod,
flowParams.sender, // targetAccount
rewardAmount.toUint256(), // rewardAmount: remaining deposit of the flow to be liquidated
rewardAmount * -1 // targetAccountBalanceDelta: amount deducted from the flow sender
);
| 21,595
|
13
|
// Transfer token for a specified address_to The address to transfer to._value The amount to be transferred./
|
function transfer(address _to, uint256 _value) public returns (bool) {
_transfer(msg.sender, _to, _value);
return true;
}
|
function transfer(address _to, uint256 _value) public returns (bool) {
_transfer(msg.sender, _to, _value);
return true;
}
| 4,366
|
74
|
// Gauge whether a service contract action is enabled which implies also registered and active/service The address of the service contract/action The name of action
|
function isEnabledServiceAction(address service, string action)
public
view
returns (bool)
|
function isEnabledServiceAction(address service, string action)
public
view
returns (bool)
| 29,436
|
51
|
// Vest tokens to MFD. _user address to receive _amount to vest /
|
function _vestTokens(address _user, uint256 _amount) internal {
if (_amount == 0) revert NothingToVest();
IMultiFeeDistribution mfd = _getMfd();
_sendRadiant(address(mfd), _amount);
mfd.vestTokens(_user, _amount, true);
}
|
function _vestTokens(address _user, uint256 _amount) internal {
if (_amount == 0) revert NothingToVest();
IMultiFeeDistribution mfd = _getMfd();
_sendRadiant(address(mfd), _amount);
mfd.vestTokens(_user, _amount, true);
}
| 25,325
|
9
|
// A mapping from owner address to count of tokens that address owns.Used internally inside balanceOf() to resolve ownership count.
|
mapping (address => uint256) private ownershipTokenCount;
|
mapping (address => uint256) private ownershipTokenCount;
| 12,660
|
54
|
// Create a payload that is sent to L2
|
ClientPayToken[] memory payload = new ClientPayToken[](_tokens.length);
|
ClientPayToken[] memory payload = new ClientPayToken[](_tokens.length);
| 75,971
|
0
|
// max bits of betMask when playing flip-coin, dice, two-dice
|
uint256 constant MAX_MASK_MODULO = 36;
|
uint256 constant MAX_MASK_MODULO = 36;
| 3,845
|
43
|
// Flushes the migration list without applying them. Can be used in case wrong migration added to the list./
|
function reset() external onlyOwner {
delete migrations;
}
|
function reset() external onlyOwner {
delete migrations;
}
| 35,979
|
18
|
// send 5000 Token with a minimum time lock of 5 hours
|
function drip5Token()
public
faucetOn()
|
function drip5Token()
public
faucetOn()
| 17,987
|
225
|
// if we want to upgrade this contract, we need to invoke this method
|
function upgradeToNew(address newEthCrossChainManagerAddress) whenPaused onlyOwner public returns (bool) {
IEthCrossChainData eccd = IEthCrossChainData(EthCrossChainDataAddress);
eccd.transferOwnership(newEthCrossChainManagerAddress);
return true;
}
|
function upgradeToNew(address newEthCrossChainManagerAddress) whenPaused onlyOwner public returns (bool) {
IEthCrossChainData eccd = IEthCrossChainData(EthCrossChainDataAddress);
eccd.transferOwnership(newEthCrossChainManagerAddress);
return true;
}
| 23,839
|
4
|
// Set a cutoff timestamp to invalidate all orders whose timestamp/is smaller than or equal to the new value of the address's cutoff/timestamp./cutoff The cutoff timestamp, will default to `block.timestamp`/if it is 0.
|
function cancelAllOrders(
uint cutoff
)
external;
|
function cancelAllOrders(
uint cutoff
)
external;
| 5,919
|
4
|
// EXTERNAL FUNCTIONS For people who have been gifted packages from the owner
|
function claimPackages() external {
uint256 claimable = giftPackagesForUser[msg.sender];
require(claimable > 0, "No packages to claim");
giftPackagesForUser[msg.sender] = 0;
packagesOwnedByUser[msg.sender] += claimable;
}
|
function claimPackages() external {
uint256 claimable = giftPackagesForUser[msg.sender];
require(claimable > 0, "No packages to claim");
giftPackagesForUser[msg.sender] = 0;
packagesOwnedByUser[msg.sender] += claimable;
}
| 50,257
|
903
|
// SPDX-License-Identifier: CC-BY-4.0
|
pragma solidity 0.6.12;
|
pragma solidity 0.6.12;
| 52,325
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.