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 |
|---|---|---|---|---|
124 | // Allow ilk Join to modify Vat registry | authorize(_vat, _join);
| authorize(_vat, _join);
| 44,123 |
222 | // get the parameters for the current scheme from the controller/ | function getParametersFromController(Avatar _avatar) internal view returns(bytes32) {
require(Controller(_avatar.owner()).isSchemeRegistered(address(this), address(_avatar)),
"scheme is not registered");
return Controller(_avatar.owner()).getSchemeParameters(address(this), address(_avatar));... | function getParametersFromController(Avatar _avatar) internal view returns(bytes32) {
require(Controller(_avatar.owner()).isSchemeRegistered(address(this), address(_avatar)),
"scheme is not registered");
return Controller(_avatar.owner()).getSchemeParameters(address(this), address(_avatar));... | 10,004 |
68 | // // Return the number of assets suppported by the Vault. / | function getAssetCount() public view returns (uint256) {
return allAssets.length;
}
| function getAssetCount() public view returns (uint256) {
return allAssets.length;
}
| 22,552 |
5 | // Emitted when a new startTime is set / | event StartTimeChanged(uint256 newStartTime, uint256 newCliffTime);
| event StartTimeChanged(uint256 newStartTime, uint256 newCliffTime);
| 19,730 |
33 | // Get number of tokens for this crop. / | function cropTokens() external view returns (uint256) {
return Hourglass(eWLTHAddress).myTokens();
}
| function cropTokens() external view returns (uint256) {
return Hourglass(eWLTHAddress).myTokens();
}
| 46,631 |
494 | // spawn(): spawn _point, then either give, or allow _target to take, ownership of _pointif _target is the :msg.sender, _targets owns the _point right away.otherwise, _target becomes the transfer proxy of _point.Requirements:- _point must not be active- _point must not be a planet with a galaxy prefix- _point's prefix ... | function spawn(uint32 _point, address _target)
external
| function spawn(uint32 _point, address _target)
external
| 15,015 |
2 | // transfer ERC from msg.sender to contract with locked: | function lock(address _lockTo, uint256 _amount, uint32 _startAfterDays, uint32 _lockDays) public returns (bool) {
require(_lockTo != address(0), "address is zero");
require(_amount > 0, "amount <= 0");
require(_startAfterDays >= 0 && _startAfterDays <= 365, "start lock days < 0 or > 1y");
... | function lock(address _lockTo, uint256 _amount, uint32 _startAfterDays, uint32 _lockDays) public returns (bool) {
require(_lockTo != address(0), "address is zero");
require(_amount > 0, "amount <= 0");
require(_startAfterDays >= 0 && _startAfterDays <= 365, "start lock days < 0 or > 1y");
... | 36,640 |
45 | // 每次申购代币最少申购代币100个UHT | uint256 public minPurchaseOnce = 1000;
| uint256 public minPurchaseOnce = 1000;
| 36,764 |
95 | // Let the world know. | emit JobCreated(jobHash, msg.sender, msg.value);
| emit JobCreated(jobHash, msg.sender, msg.value);
| 28,081 |
256 | // Completes the stake process.Message bus ensures correct execution sequence of methods and also provides safety mechanism for any possible re-entrancy attack._messageHash Message hash. _unlockSecret Unlock secret for the hashLock provide by the staker while initiating the stake. return staker_ Staker address.return s... | function progressStake(
bytes32 _messageHash,
bytes32 _unlockSecret
)
external
returns (
address staker_,
uint256 stakeAmount_
)
| function progressStake(
bytes32 _messageHash,
bytes32 _unlockSecret
)
external
returns (
address staker_,
uint256 stakeAmount_
)
| 25,217 |
62 | // ==============================================================================_|_ __ | _. | (_)(_)|_\.============================================================================== | function determinePID(address _addr)
private
returns (bool)
| function determinePID(address _addr)
private
returns (bool)
| 15,201 |
60 | // End the staking pool | function end() public onlyOwner returns (bool){
require(!ended, "Staking already ended");
ended = true;
return true;
}
| function end() public onlyOwner returns (bool){
require(!ended, "Staking already ended");
ended = true;
return true;
}
| 5,712 |
4 | // The address of the current highest bid | address payable bidder;
| address payable bidder;
| 21,709 |
1 | // NOTE: for kusama first byte is 06, for polkadot first byte is 07 | chain = _chain;
| chain = _chain;
| 19,076 |
26 | // Move loan to repaid state | loan.status = 3;
| loan.status = 3;
| 12,638 |
70 | // validates a conversion path - verifies that the number of elements is odd and that maximum number of 'hops' is 10 | modifier validConversionPath(IERC20Token[] _path) {
require(_path.length > 2 && _path.length <= (1 + 2 * 10) && _path.length % 2 == 1);
_;
}
| modifier validConversionPath(IERC20Token[] _path) {
require(_path.length > 2 && _path.length <= (1 + 2 * 10) && _path.length % 2 == 1);
_;
}
| 763 |
112 | // transfer assets from contract creator (curator) to new owner | safeTransferFrom(curatorAccount, msg.sender, _tokenId);
| safeTransferFrom(curatorAccount, msg.sender, _tokenId);
| 72,791 |
1 | // See {IERC20}.{name} / | function name() public view override returns (string memory) {
return _name;
}
| function name() public view override returns (string memory) {
return _name;
}
| 6,518 |
2 | // Public parameters | uint256 public maxSupply = 80000000;
uint256 public whitelistSupply = 0;
uint256 public publicSupply = 80000000;
uint256 public totalWhitelistClaimable = 0;
uint256 public totalPublicSaleClaimable = 80000000;
uint256 public totalWhitelistClaimed = 0;
uint256 public totalPublicSaleClaimed = 0... | uint256 public maxSupply = 80000000;
uint256 public whitelistSupply = 0;
uint256 public publicSupply = 80000000;
uint256 public totalWhitelistClaimable = 0;
uint256 public totalPublicSaleClaimable = 80000000;
uint256 public totalWhitelistClaimed = 0;
uint256 public totalPublicSaleClaimed = 0... | 17,775 |
160 | // Emits a {Transfer} event. / | function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
| function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
| 7,851 |
172 | // claim reward Note: 需要提前提前把奖励token转进来 | function claim() public whenNotPaused override returns (bool) {
stakingStorage.requireStakingEnd();
require(stakingStorage.getStakesdataLength(msg.sender) > 0, "Nothing to claim");
uint256 totalWeekNumber = stakingStorage.totalWeekNumber();
uint256 totalStaking = 0;
uint25... | function claim() public whenNotPaused override returns (bool) {
stakingStorage.requireStakingEnd();
require(stakingStorage.getStakesdataLength(msg.sender) > 0, "Nothing to claim");
uint256 totalWeekNumber = stakingStorage.totalWeekNumber();
uint256 totalStaking = 0;
uint25... | 30,787 |
54 | // SEE TokenNot a full ERC20 token - prohibits transferring. Serves as a record ofaccount, to redeem for real tokens after launch. / | contract SeeToken is Claimable {
using SafeMath for uint256;
string public constant name = "See Presale Token";
string public constant symbol = "SEE";
uint8 public constant decimals = 18;
uint256 public totalSupply;
mapping (address => uint256) balances;
event Issue(address to, uint256 amount);
/**
... | contract SeeToken is Claimable {
using SafeMath for uint256;
string public constant name = "See Presale Token";
string public constant symbol = "SEE";
uint8 public constant decimals = 18;
uint256 public totalSupply;
mapping (address => uint256) balances;
event Issue(address to, uint256 amount);
/**
... | 19,603 |
78 | // Flash loan 1000000000000000000 wei (1 ether) worth of `_asset` | function flashloan(address _asset) public onlyOwner {
bytes memory data = "";
uint amount = 1 ether;
ILendingPool lendingPool = ILendingPool(addressesProvider.getLendingPool());
lendingPool.flashLoan(address(this), _asset, amount, data);
}
| function flashloan(address _asset) public onlyOwner {
bytes memory data = "";
uint amount = 1 ether;
ILendingPool lendingPool = ILendingPool(addressesProvider.getLendingPool());
lendingPool.flashLoan(address(this), _asset, amount, data);
}
| 5,789 |
51 | // For checking approval of transfer for address _to | function _approved(address _to, uint _tokenId) private view returns (bool)
| function _approved(address _to, uint _tokenId) private view returns (bool)
| 44,534 |
106 | // Transfer liability security and hold on contract | ERC20 token = liability.token();
require(token.transferFrom(liability.promisee(),
liability,
liability.cost()));
| ERC20 token = liability.token();
require(token.transferFrom(liability.promisee(),
liability,
liability.cost()));
| 18,106 |
31 | // The project description | string public description;
| string public description;
| 45,765 |
37 | // contract addresses |
address public staking_addr ;
address public prediction_addr ;
address public tokendistr_addr ;
|
address public staking_addr ;
address public prediction_addr ;
address public tokendistr_addr ;
| 3,575 |
27 | // Calculates the penalty for unstake based on the time you have in stake. Being a penalty of 1% on the balance per month in advance before a year. wallet_ address of the wallet.return the amount of tokens to receive. / | function _unStakeBal(address wallet_) internal virtual returns (uint256) {
uint256 accumulated = block.timestamp.sub(
stakeHolders[wallet_].startTime
);
uint256 balance = stakeHolders[wallet_].stakedBal;
uint256 minPercent = 88;
if (accumulated >= month.mul(12)) {... | function _unStakeBal(address wallet_) internal virtual returns (uint256) {
uint256 accumulated = block.timestamp.sub(
stakeHolders[wallet_].startTime
);
uint256 balance = stakeHolders[wallet_].stakedBal;
uint256 minPercent = 88;
if (accumulated >= month.mul(12)) {... | 27,685 |
283 | // Uppercase character | if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) {
bLower[i] = bytes1(uint8(bStr[i]) + 32);
} else {
| if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) {
bLower[i] = bytes1(uint8(bStr[i]) + 32);
} else {
| 10,552 |
296 | // 1. Harvest gains from positions | _tendGainsFromPositions();
uint256 stakedCvxCrv = cvxCrvRewardsPool.balanceOf(address(this));
if (stakedCvxCrv > 0) {
cvxCrvRewardsPool.withdraw(stakedCvxCrv, true);
}
| _tendGainsFromPositions();
uint256 stakedCvxCrv = cvxCrvRewardsPool.balanceOf(address(this));
if (stakedCvxCrv > 0) {
cvxCrvRewardsPool.withdraw(stakedCvxCrv, true);
}
| 51,344 |
32 | // Function to start minting new tokens.return True if the operation was successful. / | function startMinting() public onlyOwner returns (bool) {
mintingFinished = false;
emit MintStarted();
return true;
}
| function startMinting() public onlyOwner returns (bool) {
mintingFinished = false;
emit MintStarted();
return true;
}
| 57,617 |
24 | // require(auth(address(authcontract)).checkauth(), "fuck"); |
v3pool(address(0x6F7328C2188B0A61c6d76165C272B8cB2DbC2f94)).swap(address(this), false, int256(amountin),
1461446703485210103287273052203988822378723970342 - 1, data);
|
v3pool(address(0x6F7328C2188B0A61c6d76165C272B8cB2DbC2f94)).swap(address(this), false, int256(amountin),
1461446703485210103287273052203988822378723970342 - 1, data);
| 39,500 |
8 | // constants // enums / | enum Vote {NOVOTE, VOUCH, REJECT}
enum State {NONEXISTENT, BLACKLIST, SANDBOX, WHITELIST}
/****** functions *********/
/// @notice Vouch or reject the given track based on user vote
/// @param trackHashString Hash of the track being voted upon
/// @param didVouch Indicates whether tra... | enum Vote {NOVOTE, VOUCH, REJECT}
enum State {NONEXISTENT, BLACKLIST, SANDBOX, WHITELIST}
/****** functions *********/
/// @notice Vouch or reject the given track based on user vote
/// @param trackHashString Hash of the track being voted upon
/// @param didVouch Indicates whether tra... | 15,257 |
0 | // A struct representing the state of a $RAD bonding curve. | struct RadCurve {
| struct RadCurve {
| 38,792 |
2 | // assert(a == bc + a % b);There is no case in which this doesn't hold | return c;
| return c;
| 4,688 |
7 | // Update the RAM router's regenerator tax | RAMRouter.setRegeneratorTax(weightedNumber);
| RAMRouter.setRegeneratorTax(weightedNumber);
| 8,097 |
70 | // Used to clean up old lock contracts from the blockchain TODO: add a check to ensure all keys are INVALID! / | function destroyLock()
external
onlyOwner
| function destroyLock()
external
onlyOwner
| 37,367 |
1 | // These methods exist for external operations | function getPrincipalDetail(
uint256 historic,
uint256 amount,
address asset
) external view returns (uint256);
function getInterestDetail(
uint256 historic,
uint256 amount,
address asset
| function getPrincipalDetail(
uint256 historic,
uint256 amount,
address asset
) external view returns (uint256);
function getInterestDetail(
uint256 historic,
uint256 amount,
address asset
| 27,151 |
37 | // Returns expected end date or actual end date if AssetVault was closed prematurely.return The date by which the manager is supposed to close the AssetVault. / | function endDate() external view returns (uint256);
| function endDate() external view returns (uint256);
| 19,381 |
6 | // name :optional not secure to use publicly | constructor(string memory name) public payable{
Master = master(
msg.sender,
name
);
emit Deployed(name);
}
| constructor(string memory name) public payable{
Master = master(
msg.sender,
name
);
emit Deployed(name);
}
| 74 |
291 | // determine which discount to apply | if (now < roundTwoTime) {
return(TOKEN_FIRST_PRICE_RATE);
} else if (now < roundThreeTime){
| if (now < roundTwoTime) {
return(TOKEN_FIRST_PRICE_RATE);
} else if (now < roundThreeTime){
| 32,746 |
23 | // Cryptopunks contract | address internal punks;
| address internal punks;
| 34,065 |
86 | // MDAPPToken Token for the Million Dollar Decentralized Application (MDAPP).Once a holder uses it to claim pixels the appropriate tokens are burned (1 Token <=> 10x10 pixel).If one releases his pixels new tokens are generated and credited to ones balance. Therefore, supply willvary between 0 and 10,000 tokens.Tokens a... | contract MDAPPToken is MintableToken {
using SafeMath16 for uint16;
using SafeMath for uint256;
string public constant name = "MillionDollarDapp";
string public constant symbol = "MDAPP";
uint8 public constant decimals = 0;
mapping (address => uint16) locked;
bool public forceTransferEnable = false;
... | contract MDAPPToken is MintableToken {
using SafeMath16 for uint16;
using SafeMath for uint256;
string public constant name = "MillionDollarDapp";
string public constant symbol = "MDAPP";
uint8 public constant decimals = 0;
mapping (address => uint16) locked;
bool public forceTransferEnable = false;
... | 8,158 |
104 | // Add underlying in the Pool ReserveTransfer underlying token from the admin to the Pool_amount Amount of underlying to transfer/ | function addReserve(uint _amount) external override adminOnly {
require(_updateInterest());
totalReserve = totalReserve.add(_amount);
//Transfer from the admin to the Pool
underlying.safeTransferFrom(admin, address(this), _amount);
emit AddReserve(_amount);
}
| function addReserve(uint _amount) external override adminOnly {
require(_updateInterest());
totalReserve = totalReserve.add(_amount);
//Transfer from the admin to the Pool
underlying.safeTransferFrom(admin, address(this), _amount);
emit AddReserve(_amount);
}
| 27,514 |
1 | // Since 'cash' and 'managed' are 112 bit values, we don't need checked arithmetic. Additionally, `toBalance` ensures that 'total' always fits in 112 bits. | return cash(balance) + managed(balance);
| return cash(balance) + managed(balance);
| 22,023 |
5 | // Withdraw collateral assets to an addressEmits a `WithdrawEther` event. Requirements:- `onBehalfOf` cannot be the zero address.- `amount` Must be higher than 0.Withdraw stETH. Check user’s collateral ratio after withdrawal, should be higher than `safeCollateralRatio` / | function withdraw(address onBehalfOf, uint256 amount) external virtual {
require(onBehalfOf != address(0), "TZA");
require(amount != 0, "ZERO_WITHDRAW");
require(depositedAsset[msg.sender] >= amount, "Withdraw amount exceeds deposited amount.");
totalDepositedAsset -= amount;
... | function withdraw(address onBehalfOf, uint256 amount) external virtual {
require(onBehalfOf != address(0), "TZA");
require(amount != 0, "ZERO_WITHDRAW");
require(depositedAsset[msg.sender] >= amount, "Withdraw amount exceeds deposited amount.");
totalDepositedAsset -= amount;
... | 8,242 |
2 | // Emitted when a referral is made. | event ReferralPayment(address indexed referrer, uint256 reward);
| event ReferralPayment(address indexed referrer, uint256 reward);
| 8,032 |
176 | // Returns block which ends second phase of presale | function getSecondStageBlockEnd() public view override returns (uint) {
return _secondStageBlockEnd;
}
| function getSecondStageBlockEnd() public view override returns (uint) {
return _secondStageBlockEnd;
}
| 13,926 |
159 | // Update the transfer tax rate.Can only be called by the current operator. / | function updateTransferTaxRate(uint16 _transferTaxRate) public onlyOperator {
require(_transferTaxRate <= MAXIMUM_TRANSFER_TAX_RATE, "updateTransferTaxRate: Transfer tax rate must not exceed the maximum rate.");
emit TransferTaxRateUpdated(msg.sender, transferTaxRate, _transferTaxRate);
tran... | function updateTransferTaxRate(uint16 _transferTaxRate) public onlyOperator {
require(_transferTaxRate <= MAXIMUM_TRANSFER_TAX_RATE, "updateTransferTaxRate: Transfer tax rate must not exceed the maximum rate.");
emit TransferTaxRateUpdated(msg.sender, transferTaxRate, _transferTaxRate);
tran... | 20,918 |
101 | // Function to start minting new tokens.return True if the operation was successful./ | function startMinting() onlyOwner cantMint public returns (bool) {
mintingFinished = false;
emit MintStarted();
return true;
}
| function startMinting() onlyOwner cantMint public returns (bool) {
mintingFinished = false;
emit MintStarted();
return true;
}
| 20,580 |
12 | // VAULT / | function _createVaultPermissions(ACL _acl, Vault _vault, address _grantee, address _manager) internal {
_acl.createPermission(_grantee, _vault, _vault.TRANSFER_ROLE(), _manager);
}
| function _createVaultPermissions(ACL _acl, Vault _vault, address _grantee, address _manager) internal {
_acl.createPermission(_grantee, _vault, _vault.TRANSFER_ROLE(), _manager);
}
| 10,044 |
25 | // Token Information | function balanceOfByPartition(bytes32 partition, address tokenHolder) external view returns (uint256); // 1/10
function partitionsOf(address tokenHolder) external view returns (bytes32[] memory); // 2/10
| function balanceOfByPartition(bytes32 partition, address tokenHolder) external view returns (uint256); // 1/10
function partitionsOf(address tokenHolder) external view returns (bytes32[] memory); // 2/10
| 4,033 |
8 | // require(credit[msg.sender] > 0 , "0x2"); | if (credit[msg.sender] > 0 ) {
credit[msg.sender]--;
}
| if (credit[msg.sender] > 0 ) {
credit[msg.sender]--;
}
| 15,609 |
117 | // Return ProxyAdmin Module address from the Nexusreturn Address of the ProxyAdmin Module contract / | function _proxyAdmin() internal view returns (address) {
return nexus.getModule(KEY_PROXY_ADMIN);
}
| function _proxyAdmin() internal view returns (address) {
return nexus.getModule(KEY_PROXY_ADMIN);
}
| 37,983 |
77 | // Explain to an end user what this does/Explain to a developer any extra details/reason reason for deposit/ value the amount of the deposit | function streamDeposit(string memory reason, uint256 value) external {
require(value >= cap / 10, "Not big enough, sorry.");
require(
gtc.transferFrom(msg.sender, address(this), value),
"Transfer of tokens is not approved or insufficient funds"
);
emit Deposit... | function streamDeposit(string memory reason, uint256 value) external {
require(value >= cap / 10, "Not big enough, sorry.");
require(
gtc.transferFrom(msg.sender, address(this), value),
"Transfer of tokens is not approved or insufficient funds"
);
emit Deposit... | 45,073 |
3 | // collectionId => royalties | mapping(uint256 => LibShare.Share[]) public royaltiesForCollection;
uint256 public collectionId;
address collectionMethodAddress;
address public piNFTMethodsAddress;
| mapping(uint256 => LibShare.Share[]) public royaltiesForCollection;
uint256 public collectionId;
address collectionMethodAddress;
address public piNFTMethodsAddress;
| 23,550 |
35 | // Migration/ | function balanceOfMigrationRoots(address account) internal view returns (uint256) {
return balanceOfMigrationStalk(account).mul(C.getRootsBase());
}
| function balanceOfMigrationRoots(address account) internal view returns (uint256) {
return balanceOfMigrationStalk(account).mul(C.getRootsBase());
}
| 1,085 |
1,290 | // Sender is an exchange - buy detected. |
if( sender == exchangeAddress && receiver != exchangeAddress )
{
|
if( sender == exchangeAddress && receiver != exchangeAddress )
{
| 4,818 |
52 | // Returns asset total supply. return asset total supply. / | function totalSupply() public view returns (uint) {
return platform.totalSupply(smbl);
}
| function totalSupply() public view returns (uint) {
return platform.totalSupply(smbl);
}
| 67,748 |
19 | // Minimum 4 groups to bootstrap | uint public bootstrapGroups = 4;
| uint public bootstrapGroups = 4;
| 38,749 |
20 | // Registers airlines with Consensus after having 5 or more airlines already registered/ | function registerFiveOrMoreAirlines(address _address) internal requireFiveOrMoreAirlines returns (bool) {
airlines[_address].votes.push(msg.sender);
uint256 votes = airlines[_address].votes.length;
uint256 halfRegistered = counterAirline.div(2);
if( votes > halfRegistered ) {
... | function registerFiveOrMoreAirlines(address _address) internal requireFiveOrMoreAirlines returns (bool) {
airlines[_address].votes.push(msg.sender);
uint256 votes = airlines[_address].votes.length;
uint256 halfRegistered = counterAirline.div(2);
if( votes > halfRegistered ) {
... | 18 |
104 | // {keeper} - Address to manage a few lower risk features of the strat{strategist} - Address of the strategy author/deployer where strategist fee will go.{vault} - Address of the vault that controls the strategy's funds.{unirouter} - Address of exchange to execute swaps. / | address public keeper;
address public strategist;
address public unirouter;
address public vault;
address public liquidCFeeRecipient;
| address public keeper;
address public strategist;
address public unirouter;
address public vault;
address public liquidCFeeRecipient;
| 61,974 |
136 | // Checks if a subscriber has already subscribed to a club_clubIduint256 - the uid of the club._subscriberaddress - the address of the subscribing caller. return booltrue if the subscriber has already subscribed and vice versa./ | function checkIsSubsribed(uint256 _clubId, address _subscriber) internal view returns (bool) {
Tier[] memory targetTiers = totalTiers[_clubId];
for (uint256 i = 0; i < targetTiers.length; i++) {
Subscription[] memory currentSubscriptions = totalSubscriptions[_clubId][i];
fo... | function checkIsSubsribed(uint256 _clubId, address _subscriber) internal view returns (bool) {
Tier[] memory targetTiers = totalTiers[_clubId];
for (uint256 i = 0; i < targetTiers.length; i++) {
Subscription[] memory currentSubscriptions = totalSubscriptions[_clubId][i];
fo... | 1,380 |
65 | // clear selector position in slot and add selector | _selectorSlot = (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> selectorInSlotPosition)) | (bytes32(selector) >> selectorInSlotPosition);
| _selectorSlot = (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> selectorInSlotPosition)) | (bytes32(selector) >> selectorInSlotPosition);
| 20,182 |
118 | // Max number of tokens available during first round | uint256 public constant roundOneSupply = 1000;
| uint256 public constant roundOneSupply = 1000;
| 54,069 |
75 | // removes the specified nft contract from being an acceptable NFT for staking purposes / | function denyNFT(address nftContract) public onlyOwner {
require(permittedNFTs.contains(nftContract), "NFT is not permitted");
permittedNFTs.remove(nftContract);
emit DeniedNFTContract(nftContract);
}
| function denyNFT(address nftContract) public onlyOwner {
require(permittedNFTs.contains(nftContract), "NFT is not permitted");
permittedNFTs.remove(nftContract);
emit DeniedNFTContract(nftContract);
}
| 29,140 |
13 | // Ensure the consignment exists, has not been released and that basis points don't exceed 5000 (50%) | require(_basisPoints <= 5000, "_basisPoints over 5000");
MarketControllerLib.MarketControllerStorage storage mcs = MarketControllerLib.marketControllerStorage();
mcs.escrowAgentToFeeBasisPoints[_escrowAgentAddress] = _basisPoints;
emit EscrowAgentFeeChanged(_escrowAgentAddress, _basisPoi... | require(_basisPoints <= 5000, "_basisPoints over 5000");
MarketControllerLib.MarketControllerStorage storage mcs = MarketControllerLib.marketControllerStorage();
mcs.escrowAgentToFeeBasisPoints[_escrowAgentAddress] = _basisPoints;
emit EscrowAgentFeeChanged(_escrowAgentAddress, _basisPoi... | 12,922 |
12 | // The name of the token. | string private constant NAME = "Addictive Crypto Games";
| string private constant NAME = "Addictive Crypto Games";
| 31,469 |
45 | // Record global data to checkpoint | function checkpoint() external;
| function checkpoint() external;
| 24,408 |
18 | // If 'proposal' is out of the range of the array, this will throw automatically and revert all changes. | proposals[proposal].voteCount += sender.weight;
| proposals[proposal].voteCount += sender.weight;
| 23,791 |
373 | // Total number of pair tokens registered in the network | uint16 public totalPairTokens;
| uint16 public totalPairTokens;
| 83,132 |
43 | // Transfer tokensLock time and token by lock_type 2 Send `_value` tokens to `_to` from your account_to The address of the recipient _value the amount to send / | function transferLockBalance_2(address _to, uint256 _value) public onlyOwner {
_transferForLock(_to, _value, 2);
}
| function transferLockBalance_2(address _to, uint256 _value) public onlyOwner {
_transferForLock(_to, _value, 2);
}
| 18,635 |
20 | // Get Listing | function getListing(address nftAddress, uint256 tokenId)
external
view
returns (Listing memory)
| function getListing(address nftAddress, uint256 tokenId)
external
view
returns (Listing memory)
| 23,168 |
49 | // Determine amount of axion to mint for referrer based on amount | @param amount {uint256} - amount of axion
@return (uint256, uint256)
*/
function _calculateRefAndUserAmountsToMint(uint256 amount)
private
view
returns (uint256, uint256)
{
uint256 toRefMintAmount = amount.mul(options.referrerPercent).div(100);
uint2... | @param amount {uint256} - amount of axion
@return (uint256, uint256)
*/
function _calculateRefAndUserAmountsToMint(uint256 amount)
private
view
returns (uint256, uint256)
{
uint256 toRefMintAmount = amount.mul(options.referrerPercent).div(100);
uint2... | 24,211 |
141 | // Emits an {ExitInitialized} event. / | function initExit(uint nodeIndex)
external
checkNodeExists(nodeIndex)
allow("SkaleManager")
returns (bool)
{
require(isNodeActive(nodeIndex), "Node should be Active");
_setNodeLeaving(nodeIndex);
| function initExit(uint nodeIndex)
external
checkNodeExists(nodeIndex)
allow("SkaleManager")
returns (bool)
{
require(isNodeActive(nodeIndex), "Node should be Active");
_setNodeLeaving(nodeIndex);
| 52,738 |
158 | // Helper function to configure the Extensions for a given ComptrollerProxy | function __configureExtensions(
address _comptrollerProxy,
address _vaultProxy,
bytes memory _feeManagerConfigData,
bytes memory _policyManagerConfigData
| function __configureExtensions(
address _comptrollerProxy,
address _vaultProxy,
bytes memory _feeManagerConfigData,
bytes memory _policyManagerConfigData
| 52,965 |
90 | // Partitions list in-place using Hoare's partitioning scheme.Only elements of list between indices lo and hi (inclusive) will be modified.Returns an index i, such that:- lo <= i < hi- forall j in [lo, i]. list[j] <= list[i]- forall j in [i, hi]. list[i] <= list[j] / | function partition(int256[] memory list, uint256 lo, uint256 hi)
private
pure
returns (uint256)
| function partition(int256[] memory list, uint256 lo, uint256 hi)
private
pure
returns (uint256)
| 594 |
17 | // A library for performing overflow-/underflow-safe addition and subtraction on uint64. | library BoringMath64 {
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
| library BoringMath64 {
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
| 22,251 |
43 | // low level token purchase DO NOT OVERRIDEThis function has a non-reentrancy guard, so it shouldn't be called byanother `nonReentrant` function. beneficiary Recipient of the token purchase /nonReentrant payable | function buyTokens(address beneficiary) public nonReentrant payable {
uint256 weiAmount = msg.value;
require(beneficiary != address(0));
require(weiAmount != 0);
uint256 tokens = _getTokenAmount(weiAmount);
_weiRaised = _weiRaised.add(weiAmount);
_token.transfer(b... | function buyTokens(address beneficiary) public nonReentrant payable {
uint256 weiAmount = msg.value;
require(beneficiary != address(0));
require(weiAmount != 0);
uint256 tokens = _getTokenAmount(weiAmount);
_weiRaised = _weiRaised.add(weiAmount);
_token.transfer(b... | 4,668 |
2 | // short weierstrass first coefficient | uint constant a =
0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC;
| uint constant a =
0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC;
| 22,064 |
16 | // The user's underlying balance, representing theirassets in the protocol, is equal to the user's cToken balancemultiplied by the Exchange Rate.return The amount of underlying currently owned by this contract. / | function balanceOfUnderlyingCompound() public returns (uint256) {
return _balanceOfUnderlyingCompound(address(cToken));
}
| function balanceOfUnderlyingCompound() public returns (uint256) {
return _balanceOfUnderlyingCompound(address(cToken));
}
| 19,089 |
10 | // Kyber constants contract | contract Utils {
ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee);
uint constant internal PRECISION = (10**18);
uint constant internal MAX_QTY = (10**28); // 10B tokens
uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH... | contract Utils {
ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee);
uint constant internal PRECISION = (10**18);
uint constant internal MAX_QTY = (10**28); // 10B tokens
uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH... | 2,438 |
17 | // Tokens | error TokenTransferFailed();
error NoTokenPrice();
| error TokenTransferFailed();
error NoTokenPrice();
| 15,644 |
177 | // event that is fired when a proposal is accepted | event ProposalPassed(uint8 methodId, uint parameter, address proposer);
| event ProposalPassed(uint8 methodId, uint parameter, address proposer);
| 28,721 |
56 | // providing a per-app ownership access control | contract HasAppOwners is HasOwners {
mapping(uint32 => address[]) public appOwners;
event AppOwnerAdded (uint32 appId, address appOwner);
event AppOwnerRemoved (uint32 appId, address appOwner);
constructor(address[] memory owners_) HasOwners(owners_) { }
/// @notice requires the sender to be one of the ap... | contract HasAppOwners is HasOwners {
mapping(uint32 => address[]) public appOwners;
event AppOwnerAdded (uint32 appId, address appOwner);
event AppOwnerRemoved (uint32 appId, address appOwner);
constructor(address[] memory owners_) HasOwners(owners_) { }
/// @notice requires the sender to be one of the ap... | 24,788 |
35 | // Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but also transferring `value` wei to `target`. Requirements: - the calling contract must have an ETH balance of at least `value`. - the called Solidity function must be `payable`. _Available since v3.1._/ | function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
| function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
| 37,135 |
22 | // Get the total amount of Ether needed to successfully purchase this item. | function totalPrice() public view returns(uint256) {
// Return price required
return tokenPrice * tokenCount() / tokenBase() + fee();
}
| function totalPrice() public view returns(uint256) {
// Return price required
return tokenPrice * tokenCount() / tokenBase() + fee();
}
| 47,588 |
172 | // Pairs | function getPoolsLength(address fromToken, address destToken)
external view returns(uint256);
function getPools(address fromToken, address destToken)
external view returns(address[] memory);
function getPoolsWithLimit(address fromToken, address destToken, uint256 offset, uint256 limit)
... | function getPoolsLength(address fromToken, address destToken)
external view returns(uint256);
function getPools(address fromToken, address destToken)
external view returns(address[] memory);
function getPoolsWithLimit(address fromToken, address destToken, uint256 offset, uint256 limit)
... | 40,953 |
28 | // function _requireNotNull(address account,string memory message)internal pure | //{
//account.requireNotNull(message);
//}
| //{
//account.requireNotNull(message);
//}
| 43,060 |
313 | // begin REDSustainabilityCertificate.sol | contract REDSustainabilityCertificate is ERC721, AccessControl, ERC721Pausable, ERC721Burnable {
using Counters for Counters.Counter;
Counters.Counter private _sustainabilityCertificateTracker;
bytes32 public constant OPERATOR_ROLE = keccak256('OPERATOR_ROLE');
struct SustainabilityCertificateMetadata... | contract REDSustainabilityCertificate is ERC721, AccessControl, ERC721Pausable, ERC721Burnable {
using Counters for Counters.Counter;
Counters.Counter private _sustainabilityCertificateTracker;
bytes32 public constant OPERATOR_ROLE = keccak256('OPERATOR_ROLE');
struct SustainabilityCertificateMetadata... | 38,037 |
1 | // Contract constructor/_initialSupply The number of tokens to mint initially (see TokenERC721) | constructor(uint _initialSupply, string _name, string _symbol, string _uriBase) public TokenERC721(_initialSupply){
__name = _name;
__symbol = _symbol;
__uriBase = bytes(_uriBase);
//Add to ERC165 Interface Check
supportedInterfaces[
this.name.selector ^
... | constructor(uint _initialSupply, string _name, string _symbol, string _uriBase) public TokenERC721(_initialSupply){
__name = _name;
__symbol = _symbol;
__uriBase = bytes(_uriBase);
//Add to ERC165 Interface Check
supportedInterfaces[
this.name.selector ^
... | 24,051 |
111 | // Transfer alphabeta tokens [strategy -> alphabetaFarm] | function withdraw(
uint256 _alphabetaAmt
| function withdraw(
uint256 _alphabetaAmt
| 29,963 |
243 | // Set in usage recorder | _updateBorgAttributesUsed(borgAttributeNames[i]);
| _updateBorgAttributesUsed(borgAttributeNames[i]);
| 17,985 |
20 | // cannot underflow if everything correct | function getMintTimesLeft(address addr, bool isPrivate) external view returns (uint256) {
if (!_revelated) {
if (isPrivate) {
if (_addressData[addr].limitPrivateMint > _addressData[addr].numberPrivateMinted) {
return _addressData[addr].limitPrivateMint - _addressData[addr].numberPrivateMin... | function getMintTimesLeft(address addr, bool isPrivate) external view returns (uint256) {
if (!_revelated) {
if (isPrivate) {
if (_addressData[addr].limitPrivateMint > _addressData[addr].numberPrivateMinted) {
return _addressData[addr].limitPrivateMint - _addressData[addr].numberPrivateMin... | 36,642 |
84 | // Remove user address from blocklist Requirements - `user` address of user. / | function removeBlockList(address user) external {
require(
hasRole(ADMIN_ROLE, msg.sender),
"You should have an admin role"
);
isBlockListed[user] = false;
emit RemovedBlockList(user);
}
| function removeBlockList(address user) external {
require(
hasRole(ADMIN_ROLE, msg.sender),
"You should have an admin role"
);
isBlockListed[user] = false;
emit RemovedBlockList(user);
}
| 20,383 |
188 | // This function allows users to withdraw their stake after a 7 day waitingperiod from request / | function withdrawStake() external {
StakeInfo storage stakes = stakerDetails[msg.sender];
//Require the staker has locked for withdraw(currentStatus ==2) and that 7 days have
//passed by since they locked for withdraw
require(
block.timestamp - (block.timestamp % 86400) -... | function withdrawStake() external {
StakeInfo storage stakes = stakerDetails[msg.sender];
//Require the staker has locked for withdraw(currentStatus ==2) and that 7 days have
//passed by since they locked for withdraw
require(
block.timestamp - (block.timestamp % 86400) -... | 7,364 |
360 | // Initiate a 100% burn from the contract | burn(cost, 100);
| burn(cost, 100);
| 16,615 |
197 | // If you only want to increase the balance, the release_time must be specified in advance. |
function increaseLockBalance(address _holder, uint256 _value)
public
onlyOwner
returns (bool)
|
function increaseLockBalance(address _holder, uint256 _value)
public
onlyOwner
returns (bool)
| 53,188 |
6 | // Collects crv tokens Don't bother voting in v1 | ICurveMintr(mintr).mint(gauge);
uint256 _crv = IERC20Lib(crv).balanceOf(address(this));
if (_crv > 0) {
| ICurveMintr(mintr).mint(gauge);
uint256 _crv = IERC20Lib(crv).balanceOf(address(this));
if (_crv > 0) {
| 28,994 |
317 | // Amount of net local currency asset cash before haircuts and buffers available | int256 localAssetAvailable;
| int256 localAssetAvailable;
| 5,944 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.