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 |
|---|---|---|---|---|
25 | // when the escrow is created by seller | require(
msg.sender == escrowTransactions[escrowID].seller,
"Only owner can access the transaction"
);
| require(
msg.sender == escrowTransactions[escrowID].seller,
"Only owner can access the transaction"
);
| 12,126 |
213 | // ========== RESTRICTED FUNCTIONS, GOVERNANCE ONLY ========== / Add an AMO Minter | function addAMOMinter(address amo_minter_addr) external onlyByOwnGov {
require(amo_minter_addr != address(0), "Zero address detected");
// Make sure the AMO Minter has collatDollarBalance()
uint256 collat_val_e18 = IFraxAMOMinter(amo_minter_addr).collatDollarBalance();
require(colla... | function addAMOMinter(address amo_minter_addr) external onlyByOwnGov {
require(amo_minter_addr != address(0), "Zero address detected");
// Make sure the AMO Minter has collatDollarBalance()
uint256 collat_val_e18 = IFraxAMOMinter(amo_minter_addr).collatDollarBalance();
require(colla... | 29,534 |
107 | // Adjust claimed state | _wallets[beneficiary].claimed = true;
| _wallets[beneficiary].claimed = true;
| 27,596 |
3 | // Mouth N°4 => Poker | function item_4() public pure returns (string memory) {
return
base(
string(
abi.encodePacked(
'<line id="Poker" fill="none" stroke="#000000" stroke-linecap="round" stroke-miterlimit="10" x1="180" y1="263" x2="226" y2="263"/>'
... | function item_4() public pure returns (string memory) {
return
base(
string(
abi.encodePacked(
'<line id="Poker" fill="none" stroke="#000000" stroke-linecap="round" stroke-miterlimit="10" x1="180" y1="263" x2="226" y2="263"/>'
... | 40,876 |
11 | // Function that allows users, owners or with permissions, to burn NFT | function burn(uint256 _tokenId) public virtual checkBurn() {
require(
_isApprovedOrOwner(_msgSender(), _tokenId),
"Error: caller is not token owner nor approved"
);
_burn(_tokenId);
emit Burn(msg.sender, _tokenId);
}
| function burn(uint256 _tokenId) public virtual checkBurn() {
require(
_isApprovedOrOwner(_msgSender(), _tokenId),
"Error: caller is not token owner nor approved"
);
_burn(_tokenId);
emit Burn(msg.sender, _tokenId);
}
| 9,578 |
6 | // Returns the number of decimals used to get its user representation.For example, if `decimals` equals `2`, a balance of `505` tokens shouldbe displayed to a user as `5.05` (`505 / 102`). Tokens usually opt for a value of 18, imitating the relationship between | * Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public ... | * Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public ... | 1,770 |
52 | // trusted reward token contract address (UNOS) | address public constant trustedRewardTokenAddress = 0xd18A8abED9274eDBEace4B12D86A8633283435Da;
| address public constant trustedRewardTokenAddress = 0xd18A8abED9274eDBEace4B12D86A8633283435Da;
| 63,624 |
54 | // A contract that can be destroyed by its owner after a delay elapses. / | contract SelfDestructible is Owned {
uint public initiationTime;
bool public selfDestructInitiated;
address public selfDestructBeneficiary;
uint public constant SELFDESTRUCT_DELAY = 4 weeks;
/**
* @dev Constructor
* @param _owner The account which controls this contract.
*/
... | contract SelfDestructible is Owned {
uint public initiationTime;
bool public selfDestructInitiated;
address public selfDestructBeneficiary;
uint public constant SELFDESTRUCT_DELAY = 4 weeks;
/**
* @dev Constructor
* @param _owner The account which controls this contract.
*/
... | 15,356 |
29 | // Check if the new Buyer has sufficient Balance in their ERC account/ IMP!! Fee is charged again as a New Token Minting Fee additionally Check if the seller is not the buyer | require(sellerOwner != msg.sender, "EA");
| require(sellerOwner != msg.sender, "EA");
| 905 |
282 | // coupons have not expired | decrementBalanceOfCoupons(msg.sender, couponEpoch, couponUnderlying, "Market: Insufficient coupon balance");
| decrementBalanceOfCoupons(msg.sender, couponEpoch, couponUnderlying, "Market: Insufficient coupon balance");
| 4,229 |
35 | // Check if an asset is supported. _assetAddress of the assetreturn bool Whether asset is supported / | function supportsAsset(address _asset) external view virtual returns (bool);
| function supportsAsset(address _asset) external view virtual returns (bool);
| 34,628 |
125 | // Claimer claim status. | bool claimedStatus = claimed[address(this)][msg.sender];
| bool claimedStatus = claimed[address(this)][msg.sender];
| 27,998 |
304 | // Royalty manager is responsible for managing the EIP2981 royalty infoRole ROLE_ROYALTY_MANAGER allows updating the royalty information (executing `setRoyaltyInfo` function) / | uint32 public constant ROLE_ROYALTY_MANAGER = 0x0008_0000;
| uint32 public constant ROLE_ROYALTY_MANAGER = 0x0008_0000;
| 8,766 |
3 | // Allows batched call to self (this contract)./calls An array of inputs for each call./revertOnFail If True then reverts after a failed call and stops doing further calls./ return successes An array indicating the success of a call, mapped one-to-one to `calls`./ return results An array with the returned data of each ... | function batch(bytes[] calldata calls, bool revertOnFail) external payable returns (bool[] memory successes, bytes[] memory results) {
successes = new bool[](calls.length);
results = new bytes[](calls.length);
for (uint256 i = 0; i < calls.length; i++) {
(bool success, bytes memo... | function batch(bytes[] calldata calls, bool revertOnFail) external payable returns (bool[] memory successes, bytes[] memory results) {
successes = new bool[](calls.length);
results = new bytes[](calls.length);
for (uint256 i = 0; i < calls.length; i++) {
(bool success, bytes memo... | 36,797 |
90 | // Internal initialize function, to set up initial internal state _platformAddress jGeneric platform address _vaultAddress Address of the Vault _rewardTokenAddress Address of reward token for platform _assets Addresses of initial supported assets _pTokens Platform Token corresponding addresses / | function initialize(
address _platformAddress,
address _vaultAddress,
address _rewardTokenAddress,
address[] calldata _assets,
address[] calldata _pTokens
| function initialize(
address _platformAddress,
address _vaultAddress,
address _rewardTokenAddress,
address[] calldata _assets,
address[] calldata _pTokens
| 73,275 |
110 | // Move the miner to the next halving | miner.block = miner.block.add(subsidyHalvingInterval);
| miner.block = miner.block.add(subsidyHalvingInterval);
| 45,588 |
24 | // Check if the token is a wrapped asset._tokenAddress is the address of the token./ | function isTokenWrapped(address _tokenAddress) public returns (bool) {
require(_tokenAddress != 0, "An empty token address was passed");
return address(_tokenAddress) == address(wrappedEther);
}
| function isTokenWrapped(address _tokenAddress) public returns (bool) {
require(_tokenAddress != 0, "An empty token address was passed");
return address(_tokenAddress) == address(wrappedEther);
}
| 3,736 |
89 | // user=>staked | mapping(address => uint256) public yflStaked;
| mapping(address => uint256) public yflStaked;
| 23,300 |
172 | // Increase amount | function increaseAmount(uint256 _lockId, uint256 _value) external;
| function increaseAmount(uint256 _lockId, uint256 _value) external;
| 33,087 |
66 | // Construct a new BountyRegistry_token address of NCT token to use / | constructor(address _token, address _arbiterStaking, uint256 _arbiterVoteWindow) Ownable() public {
owner = msg.sender;
token = NectarToken(_token);
staking = ArbiterStaking(_arbiterStaking);
arbiterVoteWindow = _arbiterVoteWindow;
}
| constructor(address _token, address _arbiterStaking, uint256 _arbiterVoteWindow) Ownable() public {
owner = msg.sender;
token = NectarToken(_token);
staking = ArbiterStaking(_arbiterStaking);
arbiterVoteWindow = _arbiterVoteWindow;
}
| 30,000 |
184 | // Returns if an account is excluded from fees./Checks packed flag/account the account to check | function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
| function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
| 12,597 |
34 | // add via to this contract's balance first (aka issue them first) | balances[address(this)].add(via);
| balances[address(this)].add(via);
| 20,444 |
280 | // Method used if the creator wants to keep their collection hidden untila later release date. On reveal, a creator can decide if they want to lock the unminted tokens or enable them for on-chain randomness minting.IMPORTANT - this function can only be called ONCE, if a wrong IPFS hashis submitted by the owner, it cann... | function lockTokenURI(string calldata revealIPFSHash, bool lockOnReveal) external onlyOwner {
require(!isRevealed, "The token URI has already been set");
offset = _random(maxSupply);
ipfsHash = revealIPFSHash;
isRevealed = true;
if (!lockOnReveal) {
// so we know... | function lockTokenURI(string calldata revealIPFSHash, bool lockOnReveal) external onlyOwner {
require(!isRevealed, "The token URI has already been set");
offset = _random(maxSupply);
ipfsHash = revealIPFSHash;
isRevealed = true;
if (!lockOnReveal) {
// so we know... | 32,886 |
124 | // Require msg.sender to own more than 0 of the token id / | modifier ownersOnly(uint256 _id) {
require(balances[msg.sender][_id] > 0, "ERC1155Tradable#ownersOnly: ONLY_OWNERS_ALLOWED");
_;
}
| modifier ownersOnly(uint256 _id) {
require(balances[msg.sender][_id] > 0, "ERC1155Tradable#ownersOnly: ONLY_OWNERS_ALLOWED");
_;
}
| 14,063 |
15 | // Converts all incoming ethereum to tokens for the caller, and passes down the referral address / | function buy(address referredyBy)
onlyFoundersIfNotPublic()
public
payable
returns(uint256)
| function buy(address referredyBy)
onlyFoundersIfNotPublic()
public
payable
returns(uint256)
| 42,320 |
178 | // Approve `to` to operate on `tokenId` Emits a {Approval} event. / | function _approve(address to, uint256 tokenId) internal virtual {
| function _approve(address to, uint256 tokenId) internal virtual {
| 17,592 |
38 | // calculates final amount after deducting registration tax | uint finalAmount = _amount.sub(registrationTax);
| uint finalAmount = _amount.sub(registrationTax);
| 9,749 |
88 | // prevent overly large contract sells. | if(contractBalance >= minimumTokensBeforeSwap * 20){
contractBalance = minimumTokensBeforeSwap * 20;
}
| if(contractBalance >= minimumTokensBeforeSwap * 20){
contractBalance = minimumTokensBeforeSwap * 20;
}
| 30,800 |
52 | // Note the zero'th game is marked Invalid to ensure it can't be initialised | if (self.state > State.Unknown) revert Transcript_IsInitialised();
| if (self.state > State.Unknown) revert Transcript_IsInitialised();
| 11,770 |
76 | // Transfer with signed proofs instead of onchain voting | function quickTransfer(bytes[] memory signatures, bytes memory txData) external onlyListedOwner returns (bool) {
uint256 totalSigned = 0;
address[] memory signedAddresses = new address[](signatures.length);
for (uint256 i = 0; i < signatures.length; i += 1) {
address signer = txData.verifySerialized... | function quickTransfer(bytes[] memory signatures, bytes memory txData) external onlyListedOwner returns (bool) {
uint256 totalSigned = 0;
address[] memory signedAddresses = new address[](signatures.length);
for (uint256 i = 0; i < signatures.length; i += 1) {
address signer = txData.verifySerialized... | 29,483 |
3 | // Constructor. Reverts if `symbol_` is not valid Reverts if `name_` is not valid Reverts if `tokenURI_` is not valid Reverts if `holder_` is an invalid address Reverts if `totalSupply_` is equal to zero symbol_ Symbol of the token. name_ Name of the token. holder_ Holder account of the token initial supply. totalSuppl... | constructor (
string memory symbol_,
string memory name_,
string memory tokenURI_,
| constructor (
string memory symbol_,
string memory name_,
string memory tokenURI_,
| 40,123 |
39 | // Stolen! | if(tokenTraits[minted].isWizard) {
emit WizardStolen(minted);
}
| if(tokenTraits[minted].isWizard) {
emit WizardStolen(minted);
}
| 39,234 |
75 | // unsuccess: | success := 0
| success := 0
| 40,431 |
35 | // Helper function wrapped around totalStakedFor. Checks whether _accountAddress _accountAddress - Account requesting forreturn Boolean indicating whether account is a staker / | function isStaker(address _accountAddress) external view returns (bool) {
_requireIsInitialized();
return totalStakedFor(_accountAddress) > 0;
}
| function isStaker(address _accountAddress) external view returns (bool) {
_requireIsInitialized();
return totalStakedFor(_accountAddress) > 0;
}
| 36,470 |
3 | // Returns if a contract is allowed to lock/unlock tokens. / | function approvedContract(address _contract) external view returns(bool);
| function approvedContract(address _contract) external view returns(bool);
| 8,280 |
10 | // Revokes a prior confirmation of the given operation | function revoke(bytes32 _operation) external onlyOwner {
emit Revoke(msg.sender, _operation);
delete m_pending[_operation];
}
| function revoke(bytes32 _operation) external onlyOwner {
emit Revoke(msg.sender, _operation);
delete m_pending[_operation];
}
| 50,536 |
0 | // Only authorized addresses can invoke functions with this modifier. | modifier onlyAuthorized() {
_assertSenderIsAuthorized();
_;
}
| modifier onlyAuthorized() {
_assertSenderIsAuthorized();
_;
}
| 11,289 |
72 | // AppState //halt the app. this action is irreversible./ (the only option at this point is have a proposal that will get to approval, then activated.)/ should be called by an app-owner when the app has been compromised.// Note the constraint that all apps but Registry & Stake must be halted first! | function switchOff() external onlyOwner {
uint32 totalAppsCount = GluonView(gluon).totalAppsCount();
for (uint32 i = 2; i < totalAppsCount; i++) {
AppState appState = AppState(GluonView(gluon).current(i));
require(!appState.isOn(), "One of the apps is still ON");
}
| function switchOff() external onlyOwner {
uint32 totalAppsCount = GluonView(gluon).totalAppsCount();
for (uint32 i = 2; i < totalAppsCount; i++) {
AppState appState = AppState(GluonView(gluon).current(i));
require(!appState.isOn(), "One of the apps is still ON");
}
| 823 |
15 | // Stores `amount` of `tokenAddress` tokens for the `user` into the vault / | function deposit(address tokenAddress, uint256 amount) public nonReentrant {
require(amount > 0, "Staking: Amount must be > 0");
IERC20 token = IERC20(tokenAddress);
uint256 allowance = token.allowance(msg.sender, address(this));
require(allowance >= amount, "Staking: Token allowanc... | function deposit(address tokenAddress, uint256 amount) public nonReentrant {
require(amount > 0, "Staking: Amount must be > 0");
IERC20 token = IERC20(tokenAddress);
uint256 allowance = token.allowance(msg.sender, address(this));
require(allowance >= amount, "Staking: Token allowanc... | 54,503 |
289 | // Returns pending bonded stake for a delegator from its lastClaimRound through an end round _delegator Address of delegator _endRound The last round to compute pending stake fromreturn Pending bonded stake for '_delegator' since last claiming rewards / | function pendingStake(address _delegator, uint256 _endRound) public view returns (uint256) {
// _endRound should be equal to the current round because after LIP-36 using a past _endRound can result
// in incorrect cumulative factor values used for the _endRound in pendingStakeAndFees().
// T... | function pendingStake(address _delegator, uint256 _endRound) public view returns (uint256) {
// _endRound should be equal to the current round because after LIP-36 using a past _endRound can result
// in incorrect cumulative factor values used for the _endRound in pendingStakeAndFees().
// T... | 23,713 |
7 | // 13 | function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] memory path,
address to,
uint deadline,
uint repeat
| function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] memory path,
address to,
uint deadline,
uint repeat
| 9,848 |
10 | // the addresses of the various Augur binary markets. One market for each token. Initiated in the constructor and does not change. | address[numberOfTokens] public marketAddresses;
| address[numberOfTokens] public marketAddresses;
| 28,508 |
39 | // Remove excess stake tokens earned by reflect fees | function skimStakeTokenFees(address _to) external onlyOwner {
uint256 stakeTokenFeeBalance = getStakeTokenFeeBalance();
STAKE_TOKEN.safeTransfer(_to, stakeTokenFeeBalance);
emit SkimStakeTokenFees(_to, stakeTokenFeeBalance);
}
| function skimStakeTokenFees(address _to) external onlyOwner {
uint256 stakeTokenFeeBalance = getStakeTokenFeeBalance();
STAKE_TOKEN.safeTransfer(_to, stakeTokenFeeBalance);
emit SkimStakeTokenFees(_to, stakeTokenFeeBalance);
}
| 24,999 |
69 | // add to cumulative amounts | locked = locked.add(locks[i].amount);
| locked = locked.add(locks[i].amount);
| 33,160 |
6 | // Called by the vault to update a user claimable reward after deposit or withdraw. This call should never revert._user The user address to updare rewards for_sharesChange The user of shared the user deposited or withdrew_isDeposit Whether user deposited or withdrew/ | function commitUserBalance(address _user, uint256 _sharesChange, bool _isDeposit) external;
| function commitUserBalance(address _user, uint256 _sharesChange, bool _isDeposit) external;
| 14,736 |
11 | // Balance of the DAO's treasury. Fed by portion of the opening and income fees set by the DAO | uint256 treasury;
| uint256 treasury;
| 7,479 |
117 | // ERC20 compliant token decimals/this can be only zero, since ERC721 token is non-fungible | uint8 public constant decimals = 0;
| uint8 public constant decimals = 0;
| 29,383 |
604 | // Returns whether the contract has been registered with the registry. If it is registered, it is an authorized participant in the UMA system. contractAddress address of the contract.return bool indicates whether the contract is registered. / | function isContractRegistered(address contractAddress) external view returns (bool);
| function isContractRegistered(address contractAddress) external view returns (bool);
| 10,065 |
6 | // Event | event TokenPurchase(address indexed purchaser, uint256 value,
uint256 amount);
event PreICOTokenPushed(address indexed buyer, uint256 amount);
event UserIDChanged(address owner, bytes32 user_id);
| event TokenPurchase(address indexed purchaser, uint256 value,
uint256 amount);
event PreICOTokenPushed(address indexed buyer, uint256 amount);
event UserIDChanged(address owner, bytes32 user_id);
| 39,804 |
26 | // ============================================================================== _ ___|. |`. __ _.| | |(_)(_||~|~|(/_| _\.(these are safety checks)==============================================================================/ used to make sure no one can interact with contract until it has been activated./ | modifier isActivated() {
require(activated_ == true, "its not ready yet. check ?eta in discord");
_;
}
| modifier isActivated() {
require(activated_ == true, "its not ready yet. check ?eta in discord");
_;
}
| 24,135 |
19 | // raised when the decimals are not in the range 0 - 18 | error InvalidDecimals(uint8 decimals);
| error InvalidDecimals(uint8 decimals);
| 5,663 |
66 | // Events to log controller actions | event SetController(address indexed _oldController, address indexed _newController);
| event SetController(address indexed _oldController, address indexed _newController);
| 47,777 |
40 | // Enable or disable approval for `operator` to manage all of the caller's tokens./operator address which will be granted rights to transfer all tokens of the caller./approved whether to approve or revoke | function setApprovalForAll(address operator, bool approved) external {
_setApprovalForAll(msg.sender, operator, approved);
}
| function setApprovalForAll(address operator, bool approved) external {
_setApprovalForAll(msg.sender, operator, approved);
}
| 2,688 |
53 | // total reflection supply | uint256 private _totalReflection = (MAX - (MAX % _totalSupply));
| uint256 private _totalReflection = (MAX - (MAX % _totalSupply));
| 42,772 |
63 | // Refund the operator by transferring REN | require(
ren.transfer(darknodeOperator, amount),
"DarknodeRegistry: bond transfer failed"
);
| require(
ren.transfer(darknodeOperator, amount),
"DarknodeRegistry: bond transfer failed"
);
| 31,932 |
8 | // check usefulness of tx | require(assetAmount != 0 || usdpAmount != 0, "Unit Protocol: USELESS_TX");
uint debt = vault.debts(asset, msg.sender);
| require(assetAmount != 0 || usdpAmount != 0, "Unit Protocol: USELESS_TX");
uint debt = vault.debts(asset, msg.sender);
| 83,555 |
29 | // 转换单位时间到秒 | function toSecond(uint unitType, uint value) internal pure returns (uint256 Seconds) {
uint _seconds;
if (unitType == 5){
_seconds = value.mul(1 years);
}else if(unitType == 4){
_seconds = value.mul(1 days);
}else if (unitType == 3){
_seconds = val... | function toSecond(uint unitType, uint value) internal pure returns (uint256 Seconds) {
uint _seconds;
if (unitType == 5){
_seconds = value.mul(1 years);
}else if(unitType == 4){
_seconds = value.mul(1 days);
}else if (unitType == 3){
_seconds = val... | 41,485 |
8 | // curve pool interface | interface Curve {
function exchange(int128, int128, uint256, uint256) external returns (uint256);
}
| interface Curve {
function exchange(int128, int128, uint256, uint256) external returns (uint256);
}
| 64,519 |
57 | // This is an alternative to {approve} that can be used as a mitigation forproblems described in {BEP20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. / | function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
| function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
| 19,581 |
179 | // Calculate the amount of base a user would get for certain amount of fyToken. baseReserves base reserves amount fyTokenReserves fyToken reserves amount fyTokenAmount fyToken amount to be traded timeTillMaturity time till maturity in seconds ts time till maturity coefficient, multiplied by 2^64 g fee coefficient, mult... | function baseOutForFYTokenIn(
uint128 baseReserves, uint128 fyTokenReserves, uint128 fyTokenAmount,
uint128 timeTillMaturity, int128 ts, int128 g)
| function baseOutForFYTokenIn(
uint128 baseReserves, uint128 fyTokenReserves, uint128 fyTokenAmount,
uint128 timeTillMaturity, int128 ts, int128 g)
| 38,763 |
9 | // {token_id}:{blueprint} |
function split(bytes calldata blob)
internal
pure
returns (uint256, bytes memory)
{
int256 index = Bytes.indexOf(blob, ":", 0);
require(index >= 0, "Separator must exist");
|
function split(bytes calldata blob)
internal
pure
returns (uint256, bytes memory)
{
int256 index = Bytes.indexOf(blob, ":", 0);
require(index >= 0, "Separator must exist");
| 24,152 |
3 | // Accept transferOwnership. / | function acceptOwnership() public {
if (msg.sender == newOwner) {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
| function acceptOwnership() public {
if (msg.sender == newOwner) {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
| 4,603 |
7 | // Mints `tokenId` and transfers it to `to`./ | function _mint(address to, uint256 tokenId) internal virtual override {
super._mint(to, tokenId);
unchecked {
_tokenSupply++;
}
}
| function _mint(address to, uint256 tokenId) internal virtual override {
super._mint(to, tokenId);
unchecked {
_tokenSupply++;
}
}
| 13,510 |
121 | // Potentially dangerous assumption about the type of the token. | require(
ERC20Mintable(address(token())).mint(beneficiary, tokenAmount),
"MintedCrowdsale: minting failed"
);
| require(
ERC20Mintable(address(token())).mint(beneficiary, tokenAmount),
"MintedCrowdsale: minting failed"
);
| 8,125 |
18 | // close LP NFT and get Weth and WPowerPerp amounts | (uint256 wPowerPerpAmountInLp, ) = ControllerHelperUtil.closeUniLp(
nonfungiblePositionManager,
ControllerHelperDataType.CloseUniLpParams({
tokenId: _params.tokenId,
liquidity: _params.liquidity,
liquidityPercentage: _params.liquidityPercen... | (uint256 wPowerPerpAmountInLp, ) = ControllerHelperUtil.closeUniLp(
nonfungiblePositionManager,
ControllerHelperDataType.CloseUniLpParams({
tokenId: _params.tokenId,
liquidity: _params.liquidity,
liquidityPercentage: _params.liquidityPercen... | 32,237 |
5 | // Return InstaEvent Address. / | function getEventAddr() internal pure returns (address) {
return 0x2af7ea6Cb911035f3eb1ED895Cb6692C39ecbA97; // InstaEvent Address
}
| function getEventAddr() internal pure returns (address) {
return 0x2af7ea6Cb911035f3eb1ED895Cb6692C39ecbA97; // InstaEvent Address
}
| 47,885 |
24 | // Decimals, because we care about the little rings as much as the big ones! | uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1212121212 * 10**_decimals;
string private constant _name = unicode"HermioneMichelleObamaAmyRose10Inu";
string private constant _symbol = unicode"AMY";
uint256 public _maxTxAmount = 24242424 * 10**_decimals; // ~2% of tTotal
... | uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1212121212 * 10**_decimals;
string private constant _name = unicode"HermioneMichelleObamaAmyRose10Inu";
string private constant _symbol = unicode"AMY";
uint256 public _maxTxAmount = 24242424 * 10**_decimals; // ~2% of tTotal
... | 33,713 |
84 | // term(k) = numer / denom= (product(a - i - 1, i = 1--> k)x ^ k) / (k!) Each iteration, multiply previous term by (a - (k - 1))x / k continue until term is less than precision | for (uint256 i = 1; term >= precision; i++) {
uint256 bigK = i * BONE;
(uint256 c, bool cneg) = rsubSign(a, rsub(bigK, BONE));
term = rmul(term, rmul(c, x));
term = rdiv(term, bigK);
if (term == 0) break;
| for (uint256 i = 1; term >= precision; i++) {
uint256 bigK = i * BONE;
(uint256 c, bool cneg) = rsubSign(a, rsub(bigK, BONE));
term = rmul(term, rmul(c, x));
term = rdiv(term, bigK);
if (term == 0) break;
| 40,540 |
102 | // No more synths may be issued than the value of SNX backing them. | uint public constant MAX_ISSUANCE_RATIO = 1e18;
| uint public constant MAX_ISSUANCE_RATIO = 1e18;
| 9,887 |
29 | // Get main data of deal deal - uniq id from priviate array deals/ | function getDealById(uint deal) onlyAgency constant public returns (
address buyer,
address sender,
address agency,
uint sum,
uint atCreated,
statuses status,
uint objectType,
| function getDealById(uint deal) onlyAgency constant public returns (
address buyer,
address sender,
address agency,
uint sum,
uint atCreated,
statuses status,
uint objectType,
| 23,290 |
23 | // Make sure locations were visited in order | require(hunters[msg.sender][i].block > lastBlock);
lastBlock = hunters[msg.sender][i].block;
| require(hunters[msg.sender][i].block > lastBlock);
lastBlock = hunters[msg.sender][i].block;
| 7,041 |
0 | // bytes32 public constant EIP712DOMAIN_TYPEHASH = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'); bytes32 public constant APPORDER_TYPEHASH = keccak256('AppOrder(address app,uint256 appprice,uint256 volume,bytes32 tag,address datasetrestrict,address workerpoolrestrict,a... | bytes32 public constant EIP712DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;
bytes32 public constant APPORDER_TYPEHASH = 0x60815a0eeec47dddf1615fe53b31d016c31444e01b9d796db365443a6445d008;
bytes32 public constant DATASETORDER_TYPEHASH = 0... | bytes32 public constant EIP712DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;
bytes32 public constant APPORDER_TYPEHASH = 0x60815a0eeec47dddf1615fe53b31d016c31444e01b9d796db365443a6445d008;
bytes32 public constant DATASETORDER_TYPEHASH = 0... | 43,484 |
8 | // The fundamental unit of storage for a reporter source | struct Datum {
uint64 timestamp;
uint64 value;
}
| struct Datum {
uint64 timestamp;
uint64 value;
}
| 18,257 |
14 | // Set the owner of this contract. This function can only be called by/ the current owner.//_newOwner The new owner of this contract. | function setOwner(address payable _newOwner) external onlyOwner {
owner = _newOwner;
}
| function setOwner(address payable _newOwner) external onlyOwner {
owner = _newOwner;
}
| 5,222 |
17 | // Returns the latest implementation given a contract type. | function getLatestImplementation(bytes32 _type) external view returns (address) {
return implementation[_type][currentVersion[_type]];
}
| function getLatestImplementation(bytes32 _type) external view returns (address) {
return implementation[_type][currentVersion[_type]];
}
| 18,024 |
16 | // Modifiers ========================================================================================================================================== | modifier Owner() {
require(msg.sender == _owner, "OMS: NOT_OWNER");
_;
}
| modifier Owner() {
require(msg.sender == _owner, "OMS: NOT_OWNER");
_;
}
| 46,246 |
260 | // For checking whether the player is in the leaderboard. | mapping(address => bool) public addressToIsInLeaderboard;
| mapping(address => bool) public addressToIsInLeaderboard;
| 12,052 |
7 | // @See https:etherscan.io/address/0xEF68e7C694F40c8202821eDF525dE3782458639freadContract | totalSupply = 14000000000000000000000;
balanceOf[msg.sender] = totalSupply;
| totalSupply = 14000000000000000000000;
balanceOf[msg.sender] = totalSupply;
| 40,631 |
307 | // Apply the penaltyPercentagePerSecond to the payment period. | latePenalty = pfc.mul(timeDiff).mul(penaltyPercentagePerSecond);
| latePenalty = pfc.mul(timeDiff).mul(penaltyPercentagePerSecond);
| 51,761 |
73 | // Converts the Ether accrued as dividends back into Staking tokens without having to withdraw it first. Saves on gas and potential price spike loss. | function processReinvest(address forWho,uint256 cR,uint256 cG,uint256 cB) internal{
// Retrieve the dividends associated with the address the request came from.
uint256 balance = dividends(msg.sender);
// Update the payouts array, incrementing the request address by `balance`.
// Since this is ... | function processReinvest(address forWho,uint256 cR,uint256 cG,uint256 cB) internal{
// Retrieve the dividends associated with the address the request came from.
uint256 balance = dividends(msg.sender);
// Update the payouts array, incrementing the request address by `balance`.
// Since this is ... | 59,125 |
137 | // Require msg.sender to be the creator of the token id / | modifier creatorOnly(uint256 _id) {
require(creators[_id] == msg.sender, "ERC1155Tradable#creatorOnly: ONLY_CREATOR_ALLOWED");
_;
}
| modifier creatorOnly(uint256 _id) {
require(creators[_id] == msg.sender, "ERC1155Tradable#creatorOnly: ONLY_CREATOR_ALLOWED");
_;
}
| 2,769 |
78 | // MarketAuctionStores information about token market auction./ | struct MarketAuction {
bool isAuction;
address highestBidder;
uint256 highestBid;
uint256 initPrice;
uint endTime;
}
| struct MarketAuction {
bool isAuction;
address highestBidder;
uint256 highestBid;
uint256 initPrice;
uint endTime;
}
| 52,080 |
10 | // in case we are whitelisting on a new chain an already whitelisted account, we need to make sure it expires at the same time | if (dateAuthenticated > 0) {
identities[account].dateAuthenticated = dateAuthenticated;
}
| if (dateAuthenticated > 0) {
identities[account].dateAuthenticated = dateAuthenticated;
}
| 17,778 |
41 | // Return address' authorization status / | function isAuthorized(address adr) public view returns (bool) {
return authorizations[adr];
}
| function isAuthorized(address adr) public view returns (bool) {
return authorizations[adr];
}
| 16,615 |
183 | // fallback function can be used to buy tokens | function () payable {
buyTokens(msg.sender);
}
| function () payable {
buyTokens(msg.sender);
}
| 11,561 |
230 | // Pending Governance address |
address public pendingGov;
|
address public pendingGov;
| 2,971 |
31 | // Updates strategist. Both governance and strategists can update strategist. / | function setStrategist(address _strategist, bool _allowed) external onlyStrategist {
require(_strategist != address(0x0), "strategist not set");
strategists[_strategist] = _allowed;
emit StrategistUpdated(_strategist, _allowed);
}
| function setStrategist(address _strategist, bool _allowed) external onlyStrategist {
require(_strategist != address(0x0), "strategist not set");
strategists[_strategist] = _allowed;
emit StrategistUpdated(_strategist, _allowed);
}
| 61,323 |
275 | // Try to find already existent proper old sub stake | uint16 previousPeriod = _currentPeriod - 1;
for (uint256 i = 0; i < _info.subStakes.length; i++) {
SubStakeInfo storage subStake = _info.subStakes[i];
if (subStake.lastPeriod == previousPeriod &&
((crosscurrentCommittedPeriod ==
(oldCurrentCommitte... | uint16 previousPeriod = _currentPeriod - 1;
for (uint256 i = 0; i < _info.subStakes.length; i++) {
SubStakeInfo storage subStake = _info.subStakes[i];
if (subStake.lastPeriod == previousPeriod &&
((crosscurrentCommittedPeriod ==
(oldCurrentCommitte... | 50,106 |
39 | // each byte takes two characters | uint256 shift = i * 2;
| uint256 shift = i * 2;
| 33,114 |
7 | // require(!voters[msg.sender]); require(!votePassed); |
value = value.add(step);
Increment(msg.sender, step);
if(value >= goal) {
votePassed = true;
VotePass();
|
value = value.add(step);
Increment(msg.sender, step);
if(value >= goal) {
votePassed = true;
VotePass();
| 9,953 |
0 | // fallback function / | constructor(address[] memory _addresses, uint8 _threshold) public
DelegateSig(_addresses, _threshold)
| constructor(address[] memory _addresses, uint8 _threshold) public
DelegateSig(_addresses, _threshold)
| 48,678 |
88 | // the last fomo buy user | if (canAddWaiting) {
haveLastFomoBuy = true;
lastFomoBuyUser = WaitingFomoWinner(to, calculateAnyFee(currentFomoPool(), 40), fomoTime);
}
| if (canAddWaiting) {
haveLastFomoBuy = true;
lastFomoBuyUser = WaitingFomoWinner(to, calculateAnyFee(currentFomoPool(), 40), fomoTime);
}
| 20,130 |
4 | // Emitted upon collateral withdrawaltoAddress where the USDC token withdrawal is directed collateralAmountThe number of USDC tokens withdrawn tokenAmountThe number of PE tokens burnt / | event Withdrawal(address indexed to, UsdcQuantity collateralAmount, PeQuantity tokenAmount);
| event Withdrawal(address indexed to, UsdcQuantity collateralAmount, PeQuantity tokenAmount);
| 31,112 |
143 | // calculate amount of SNOOP available for claim by depositor_depositor address return pendingPayout_ uint / | function pendingPayoutFor( address _depositor ) external view returns ( uint pendingPayout_ ) {
uint percentVested = percentVestedFor( _depositor );
uint payout = bondInfo[ _depositor ].payout;
if ( percentVested >= 10000 ) {
pendingPayout_ = payout;
} else {
... | function pendingPayoutFor( address _depositor ) external view returns ( uint pendingPayout_ ) {
uint percentVested = percentVestedFor( _depositor );
uint payout = bondInfo[ _depositor ].payout;
if ( percentVested >= 10000 ) {
pendingPayout_ = payout;
} else {
... | 6,251 |
16 | // 修改代数 | function upgradeGeneration(
uint256 _tokenId,
address _owner,
uint256 _generation
| function upgradeGeneration(
uint256 _tokenId,
address _owner,
uint256 _generation
| 5,611 |
21 | // Returns the amount which _spender is still allowed to withdraw from _owner. _owner The address of the account owning tokens. _spender The address of the account able to transfer the tokens. / | function allowance(address _owner,address _spender) external view returns (uint256 _remaining){
_remaining = allowed[_owner][_spender];
}
| function allowance(address _owner,address _spender) external view returns (uint256 _remaining){
_remaining = allowed[_owner][_spender];
}
| 17,296 |
35 | // _authorityAddress of the Olympus Authority contract | constructor(IOlympusAuthority _authority) OlympusAccessControlled(_authority) {
OHMV1BackingInDAIRemaining = OHMV1.totalSupply() * 1e9;
}
| constructor(IOlympusAuthority _authority) OlympusAccessControlled(_authority) {
OHMV1BackingInDAIRemaining = OHMV1.totalSupply() * 1e9;
}
| 30,751 |
19 | // Returns _destory function | function destroy(uint256 amount) external {
_destroy(msg.sender, amount);
}
| function destroy(uint256 amount) external {
_destroy(msg.sender, amount);
}
| 19,495 |
193 | // 0.75% of sold tokens go to BS account: | uint bsTokens = tokensE18.mul(75).div(10000);
token.sell(bsWallet, bsTokens);
| uint bsTokens = tokensE18.mul(75).div(10000);
token.sell(bsWallet, bsTokens);
| 44,637 |
132 | // Locks WETH amount into the CDP and generates debt | frob(manager, cdp, toInt(msg.value), _getDrawDart(vat, jug, urn, ilk, wadD));
| frob(manager, cdp, toInt(msg.value), _getDrawDart(vat, jug, urn, ilk, wadD));
| 9,688 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.