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 |
|---|---|---|---|---|
175 | // The SASHIMI TOKEN! | SashimiToken public sashimi;
| SashimiToken public sashimi;
| 31,191 |
20 | // Used to change the flag _allowAllTransfers flag value / | function changeAllowAllTransfers(bool _allowAllTransfers) public withPerm(FLAGS) {
allowAllTransfers = _allowAllTransfers;
emit LogAllowAllTransfers(_allowAllTransfers);
}
| function changeAllowAllTransfers(bool _allowAllTransfers) public withPerm(FLAGS) {
allowAllTransfers = _allowAllTransfers;
emit LogAllowAllTransfers(_allowAllTransfers);
}
| 11,725 |
30 | // Accept application to allow them to take the task./_taskId Id of the task./_applications Indexes of the applications to accept. | function acceptApplications(
uint256 _taskId,
uint16[] calldata _applications
) external;
| function acceptApplications(
uint256 _taskId,
uint16[] calldata _applications
) external;
| 26,603 |
157 | // Repays the position and sends tokens back for FL/_data Amount and exchange data [amount, minPrice, exchangeType, gasCost, 0xPrice]/_addrData cTokens addreses and exchange [cCollAddress, cBorrowAddress, exchangeAddress]/_callData 0x callData/_flashLoanData Data about FL [amount, fee] | function flashRepay(
uint[5] memory _data, // amount, minPrice, exchangeType, gasCost, 0xPrice
address[3] memory _addrData, // cCollAddress, cBorrowAddress, exchangeAddress
bytes memory _callData,
uint[2] memory _flashLoanData // amount, fee
| function flashRepay(
uint[5] memory _data, // amount, minPrice, exchangeType, gasCost, 0xPrice
address[3] memory _addrData, // cCollAddress, cBorrowAddress, exchangeAddress
bytes memory _callData,
uint[2] memory _flashLoanData // amount, fee
| 13,130 |
241 | // DAI token | IERC20 internal constant investmentToken =
IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F);
| IERC20 internal constant investmentToken =
IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F);
| 76,942 |
46 | // private method for registering an interface / | function _registerInterface(bytes4 _interfaceId)
internal
| function _registerInterface(bytes4 _interfaceId)
internal
| 25,876 |
24 | // Send message to destination chain via LayerZero Only called by sendXChainMessageInternal that can be called by Portfolio _payloadPayload to sendreturnuint256Message Fee / | function lzSend(bytes memory _payload) private returns (uint256) {
require(address(this).balance > 0, "PB-CBIZ-01");
return
lzSend(
_payload, // bytes payload
payable(this)
);
}
| function lzSend(bytes memory _payload) private returns (uint256) {
require(address(this).balance > 0, "PB-CBIZ-01");
return
lzSend(
_payload, // bytes payload
payable(this)
);
}
| 34,674 |
195 | // The mintAuthority is an address that can sign mint requests. | address public mintAuthority;
| address public mintAuthority;
| 11,434 |
55 | // Returns tokens locked for a specified address for a specified reason at a specified time_of The address whose tokens are locked _reason The reason to query the lock tokens for _time The timestamp to query the lock tokens for / | function tokensLocked(address _of, bytes32 _reason, uint256 _time)
public
view
returns (uint256 amount)
| function tokensLocked(address _of, bytes32 _reason, uint256 _time)
public
view
returns (uint256 amount)
| 15,944 |
9 | // The number of passes to sell | uint256 public passesToSell;
| uint256 public passesToSell;
| 21,412 |
171 | // // Calculates minimum of two numbers x Left hand input y Right hand inputreturnMinimum of the two inputs / | function min(uint256 x, uint256 y) internal pure returns (uint256) {
return x > y ? y : x;
}
| function min(uint256 x, uint256 y) internal pure returns (uint256) {
return x > y ? y : x;
}
| 11,853 |
3 | // 2. check claim amount | uint256 balAfter = STAKED_TOKEN.balanceOf(address(this));
uint256 claimed = balAfter - balBefore;
require(claimed > 0, "Must compound something");
| uint256 balAfter = STAKED_TOKEN.balanceOf(address(this));
uint256 claimed = balAfter - balBefore;
require(claimed > 0, "Must compound something");
| 87,741 |
82 | // Send ethers into WALLET | WALLET.transfer(weiAmount);
| WALLET.transfer(weiAmount);
| 47,288 |
57 | // For deriving contracts to override, so that operator filtering/ can be turned on / off./ Returns true by default. | function _operatorFilteringEnabled() internal view virtual returns (bool) {
return true;
}
| function _operatorFilteringEnabled() internal view virtual returns (bool) {
return true;
}
| 19,595 |
162 | // current stakes of the user per token | mapping(address => uint256) stakedAmount;
| mapping(address => uint256) stakedAmount;
| 30,970 |
440 | // Remove last element from index. | documentsIndex.length --;
| documentsIndex.length --;
| 13,599 |
18 | // Give your vote (including votes delegated to you)/ to proposal `proposals[proposal].name`. | function vote(uint proposal) {
Voter storage sender = voters[msg.sender];
require(!sender.voted);
sender.voted = true;
sender.vote = proposal;
// If `proposal` is out of the range of the array,
// this will throw automatically and revert all
// changes.
... | function vote(uint proposal) {
Voter storage sender = voters[msg.sender];
require(!sender.voted);
sender.voted = true;
sender.vote = proposal;
// If `proposal` is out of the range of the array,
// this will throw automatically and revert all
// changes.
... | 31,995 |
87 | // Withdraw ETH collateral from an open loanthe C-Ratio after should not be less than the Liquidation RatioloanID the ID of the loan withdrawAmount the amount to withdraw from the current collateral/ | function withdrawCollateral(uint256 loanID, uint256 withdrawAmount) external nonReentrant {
require(withdrawAmount > 0, "Amount to withdraw must be greater than 0");
// Get the loan from storage
SynthLoanStruct memory synthLoan = _getLoanFromStorage(msg.sender, loanID);
// Check l... | function withdrawCollateral(uint256 loanID, uint256 withdrawAmount) external nonReentrant {
require(withdrawAmount > 0, "Amount to withdraw must be greater than 0");
// Get the loan from storage
SynthLoanStruct memory synthLoan = _getLoanFromStorage(msg.sender, loanID);
// Check l... | 36,304 |
192 | // Throws if called by any account without `MINTER_ROLE`. / | modifier onlyMinter() {
require(hasRole(MINTER_ROLE, _msgSender()), "CsfERC20: MINTER role required");
_;
}
| modifier onlyMinter() {
require(hasRole(MINTER_ROLE, _msgSender()), "CsfERC20: MINTER role required");
_;
}
| 849 |
46 | // For querying balance of a particular account/_owner The address for balance query/Required for ERC-721 compliance. | function balanceOf(address _owner) public view returns (uint256 balance) {
return ownershipTokenCount[_owner];
}
| function balanceOf(address _owner) public view returns (uint256 balance) {
return ownershipTokenCount[_owner];
}
| 10,039 |
24 | // Reset the winner | lastFunder = address(0);
| lastFunder = address(0);
| 54,741 |
679 | // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such that denominatorinv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for four bits. That is, denominatorinv = 1 mod 2^4. | uint256 inverse = (3 * denominator) ^ 2;
| uint256 inverse = (3 * denominator) ^ 2;
| 26,286 |
48 | // solium-disable-next-line | require(block.number > ends, "presale has not yet ended");
require(block.number > claimBlocks[_period], "claim period is not live yet");
require(investors[msg.sender].periods[_period] == 0, "Tokens already claimed for this period");
uint256 amount = investors[msg.sender].percent20;
| require(block.number > ends, "presale has not yet ended");
require(block.number > claimBlocks[_period], "claim period is not live yet");
require(investors[msg.sender].periods[_period] == 0, "Tokens already claimed for this period");
uint256 amount = investors[msg.sender].percent20;
| 3,129 |
5 | // delegatecall returns 0 on error. | case 0 { revert(0, returndatasize()) }
| case 0 { revert(0, returndatasize()) }
| 8,432 |
10 | // Define a Patient struct at the contract level | struct Patient {
string name;
uint256 age;
string diseaseName;
Prescription prescription; //new struct, kinda define chesa
bool medicationDelivered;
bool testRequested;
}
| struct Patient {
string name;
uint256 age;
string diseaseName;
Prescription prescription; //new struct, kinda define chesa
bool medicationDelivered;
bool testRequested;
}
| 7,687 |
130 | // The contract has an owner address, and provides basic authorization control whitchsimplifies the implementation of user permissions. This contract is based on the source code / | contract Ownable {
address public owner;
/**
* @dev An event which is triggered when the owner is changed.
* @param previousOwner The address of the previous owner.
* @param newOwner The address of the new owner.
*/
event OwnershipTransferred(
address indexed previousOwner,
address indexed ne... | contract Ownable {
address public owner;
/**
* @dev An event which is triggered when the owner is changed.
* @param previousOwner The address of the previous owner.
* @param newOwner The address of the new owner.
*/
event OwnershipTransferred(
address indexed previousOwner,
address indexed ne... | 20,109 |
3 | // index mapping of `classId` to recipients (so we can loop the map) | mapping(uint256 => address[]) private _recipients;
| mapping(uint256 => address[]) private _recipients;
| 6,037 |
5 | // Initialize outcomes | _uint32Storage["heads"] = 0;
_uint32Storage["tails"] = 1;
| _uint32Storage["heads"] = 0;
_uint32Storage["tails"] = 1;
| 41,161 |
324 | // Accumulate the amount FIN mined by depositing between _lastBlock and _currentBlock / | function calculateDepositFIN(uint256 _lastBlock, address _token, address _accountAddr, uint256 _currentBlock) internal {
Bank bank = globalConfig.bank();
uint256 indexDifference = bank.depositFINRateIndex(_token, _currentBlock)
.sub(bank.depositFINRateIndex(_token, _lastBlock));
... | function calculateDepositFIN(uint256 _lastBlock, address _token, address _accountAddr, uint256 _currentBlock) internal {
Bank bank = globalConfig.bank();
uint256 indexDifference = bank.depositFINRateIndex(_token, _currentBlock)
.sub(bank.depositFINRateIndex(_token, _lastBlock));
... | 15,140 |
166 | // Generate Links function createCampaignMeta( address _tokenAddress, uint256 _linksAmount, uint256 _amountPerLink | // ) external returns (uint256) {
// return _createCampaign(_tokenAddress, _linksAmount, _amountPerLink);
// }
| // ) external returns (uint256) {
// return _createCampaign(_tokenAddress, _linksAmount, _amountPerLink);
// }
| 25,973 |
16 | // We cannot send to free addresses, but maybe the restrictions have been removed and we can clean the flag? | failOrCleanup(from);
| failOrCleanup(from);
| 33,422 |
74 | // burn neumarks corresponding to unspent funds | NEUMARK.burnNeumark(a.neumarksDue);
| NEUMARK.burnNeumark(a.neumarksDue);
| 53,400 |
285 | // Test that matron and sire are a valid mating pair. | require(
_isValidMatingPair(matron, _matronId, sire, _sireId),
"CryptoDODO: Matron and Sire are not valid mating pair"
);
| require(
_isValidMatingPair(matron, _matronId, sire, _sireId),
"CryptoDODO: Matron and Sire are not valid mating pair"
);
| 24,474 |
29 | // Used if more tokens are transferred to be locked | function syncBalance() external {
require(msg.sender == _beneficiary);
_totalTokens = _token.balanceOf(address(this));
}
| function syncBalance() external {
require(msg.sender == _beneficiary);
_totalTokens = _token.balanceOf(address(this));
}
| 31,957 |
0 | // Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually forspecific token ids via {_setTokenRoyalty}. The latter takes precedence over the first./ See {IERC165-supportsInterface}. / | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721A, ERC2981)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
| function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721A, ERC2981)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
| 12,819 |
3 | // Allows the owner to update the Genesis Artwork address./genesisArtworkAddress The new Genesis Artwork address to use for the renderer. Must conform to IOKPCGenesisArtwork. | function setGenesisArtworkAddress(address genesisArtworkAddress)
public
onlyOwner
| function setGenesisArtworkAddress(address genesisArtworkAddress)
public
onlyOwner
| 77,188 |
7 | // Divides two low precision decimals. Since the two numbers are assumed to be fixed point numbers,(xUNIT) / (yUNIT) = x / y (Decimal representation is lost),x is first scaled up to end up with a decimal representation. / | function divDecimal(uint256 x, uint256 y) internal pure returns (uint256 z) {
return (x * UNIT) / y;
}
| function divDecimal(uint256 x, uint256 y) internal pure returns (uint256 z) {
return (x * UNIT) / y;
}
| 26,210 |
50 | // Returns number of Schains on a node. / | function getLengthOfSchainsForNode(uint nodeIndex) external view returns (uint) {
return schainsForNodes[nodeIndex].length;
}
| function getLengthOfSchainsForNode(uint nodeIndex) external view returns (uint) {
return schainsForNodes[nodeIndex].length;
}
| 52,706 |
6 | // Create a new node. Child nodes can specify an group node that/ will be used to determine ownership, and a separate logical parent that/ expresses the entity relationship.Child nodes can only be created if/ msg.sender is an authorized manager of the parent node. | function createNode(
NodeType nodeType,
uint64 owner,
uint64 parent,
uint64 groupNode,
address[] memory initialControllers,
string memory metadata
) external returns (uint64 id);
| function createNode(
NodeType nodeType,
uint64 owner,
uint64 parent,
uint64 groupNode,
address[] memory initialControllers,
string memory metadata
) external returns (uint64 id);
| 28,227 |
16 | // Returns the address of the Pool proxy.return The Pool proxy address // Updates the implementation of the Pool, or creates a proxysetting the new `pool` implementation when the function is called for the first time. newPoolImpl The new Pool implementation // Returns the address of the PoolConfigurator proxy.return Th... | function getPriceOracle() external view returns (address);
| function getPriceOracle() external view returns (address);
| 5,119 |
102 | // Initializes the ownership slot minted at 'index' for efficiency purposes. / | function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
| function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
| 44,248 |
15 | // Called by the owner to unlock. / | function unlock() onlyOwner public {
if (locked) {
locked = false;
unlockedOnce = true;
emit Unlocked();
}
}
| function unlock() onlyOwner public {
if (locked) {
locked = false;
unlockedOnce = true;
emit Unlocked();
}
}
| 23,846 |
23 | // verify royalty percentage is zero if receiver is also zero | require(_royaltyReceiver != address(0) || _royaltyPercentage == 0, "invalid receiver");
| require(_royaltyReceiver != address(0) || _royaltyPercentage == 0, "invalid receiver");
| 24,687 |
269 | // User supplies assets into the market and receives cTokens in exchange Assumes interest has already been accrued up to the current block minter The address of the account which is supplying the assets mintAmount The amount of the underlying asset to supplyreturn (uint, uint) An error code (0=success, otherwise a fail... | function mintFresh(address minter, uint mintAmount, uint mintTokens) internal returns (uint, uint) {
/* Fail if mint not allowed */
if (mintTokens == 0) {
uint allowed = comptroller.mintAllowed(address(this), minter, mintAmount);
if (allowed != 0) {
return (f... | function mintFresh(address minter, uint mintAmount, uint mintTokens) internal returns (uint, uint) {
/* Fail if mint not allowed */
if (mintTokens == 0) {
uint allowed = comptroller.mintAllowed(address(this), minter, mintAmount);
if (allowed != 0) {
return (f... | 5,116 |
74 | // EIP20 Transfer event / | event Transfer(address indexed from, address indexed to, uint256 amount);
| event Transfer(address indexed from, address indexed to, uint256 amount);
| 27,337 |
16 | // This function will return the details for a transaction | function getTransaction(uint _transactionId) public view returns (
uint buyerId,
uint sellerId,
uint256 transactionValue,
uint itemId,
uint blockId
| function getTransaction(uint _transactionId) public view returns (
uint buyerId,
uint sellerId,
uint256 transactionValue,
uint itemId,
uint blockId
| 15,749 |
29 | // we emit the CampaignStatusChanged event to notify the blockchain that the campaign status has been changed | emit CampaignStatusChanged(_id, 2);
| emit CampaignStatusChanged(_id, 2);
| 17,623 |
25 | // require(_delay != orders.delay, 'TD01');Comment out to save size | orders.delay = _delay;
emit DelaySet(_delay);
| orders.delay = _delay;
emit DelaySet(_delay);
| 28,493 |
19 | // / | function aaurghMintGoblinFren(uint256 count) external payable {
require(! isPauzzd , "iZz PauZZdddsss!");
require(count <= GOLBI_PER_TARNSECTIURGH, "To mUChy ate OncE!");
require(msg.sender == tx.origin,"nO duMp coMtaRcT siLLLi uhMEn!");
require(totalSupply() + count <= MAK... | function aaurghMintGoblinFren(uint256 count) external payable {
require(! isPauzzd , "iZz PauZZdddsss!");
require(count <= GOLBI_PER_TARNSECTIURGH, "To mUChy ate OncE!");
require(msg.sender == tx.origin,"nO duMp coMtaRcT siLLLi uhMEn!");
require(totalSupply() + count <= MAK... | 18,574 |
7 | // Emit when the token ticker expiry is changed | event ChangeExpiryLimit(uint256 _oldExpiry, uint256 _newExpiry);
| event ChangeExpiryLimit(uint256 _oldExpiry, uint256 _newExpiry);
| 153 |
8 | // Removes previously verified addresseses to the Security Token whitelist _blacklistAddresses Array of addresses attempting to join ST whitelistreturn bool success / | function addToBlacklistMulti(address[] _blacklistAddresses) public returns (bool success);
| function addToBlacklistMulti(address[] _blacklistAddresses) public returns (bool success);
| 40,311 |
3 | // Lazy Mint / | function mintTo(address _to, string memory) public virtual override {
uint256 quantity = 1;
require(
nextTokenIdToMint() + quantity <= nextTokenIdToLazyMint,
"Not enough lazy minted tokens."
);
_safeMint(_to, quantity, "");
}
| function mintTo(address _to, string memory) public virtual override {
uint256 quantity = 1;
require(
nextTokenIdToMint() + quantity <= nextTokenIdToLazyMint,
"Not enough lazy minted tokens."
);
_safeMint(_to, quantity, "");
}
| 14,525 |
1 | // cliff period in seconds | uint256 cliff;
| uint256 cliff;
| 4,202 |
149 | // Creates first epoch and init contract / | constructor(IERC20 _coin) public {
coin = _coin;
}
| constructor(IERC20 _coin) public {
coin = _coin;
}
| 3,562 |
55 | // Allows the current owner or proposed owner to cancel transferring control of the contract to a proposedOwner / | function disregardProposeOwner() public {
require(msg.sender == proposedOwner || msg.sender == owner, "only proposedOwner or owner");
require(proposedOwner != address(0), "can only disregard a proposed owner that was previously set");
address _oldProposedOwner = proposedOwner;
propos... | function disregardProposeOwner() public {
require(msg.sender == proposedOwner || msg.sender == owner, "only proposedOwner or owner");
require(proposedOwner != address(0), "can only disregard a proposed owner that was previously set");
address _oldProposedOwner = proposedOwner;
propos... | 17,830 |
28 | // Initializes the contract setting the deployer as the initial ownerand privileged. / | constructor () internal {
_owner = _msgSender();
_privileged = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
| constructor () internal {
_owner = _msgSender();
_privileged = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
| 17,476 |
148 | // ------------Collateral Balance------------ Free Collateral | uint256 free_collateral = collateral_token.balanceOf(address(this));
| uint256 free_collateral = collateral_token.balanceOf(address(this));
| 10,901 |
78 | // bnb address of the charity wallet | address private _charityWalletAddress = 0x8a9c04eF43F82113AAe56C8880F5e7E733941aA9;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1000000000 * 10**8; //Total supply
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = "... | address private _charityWalletAddress = 0x8a9c04eF43F82113AAe56C8880F5e7E733941aA9;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1000000000 * 10**8; //Total supply
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = "... | 26,865 |
16 | // ---------------------------------------------------------------------------- Safe maths ---------------------------------------------------------------------------- | contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) public pure returns (uint c... | contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) public pure returns (uint c... | 2,600 |
184 | // emitEvent(_Weight_, "returnDisinvestment", bytes32(0), weightNew, weightOld, reserve_+_eth, reserve_, supply, supply, reserve_1 ether/weightOld1 ether/supply); reserve.depositShares.value(_eth)(); | IEtherToken(getBA(_ETHER_)).destroy(project, _eth);
reserve.project2Shares(_eth);
| IEtherToken(getBA(_ETHER_)).destroy(project, _eth);
reserve.project2Shares(_eth);
| 34,156 |
29 | // Internal function for handling eth deposits during contract stage one. | function _ethDeposit () internal {
assert (contractStage == 1);
uint size;
address addr = msg.sender;
assembly { size := extcodesize(addr) }
require (size == 0);
require (this.balance <= maxContractBalance);
var c = contributorMap[msg.sender];
uint newBalance = c.balance.add(msg.valu... | function _ethDeposit () internal {
assert (contractStage == 1);
uint size;
address addr = msg.sender;
assembly { size := extcodesize(addr) }
require (size == 0);
require (this.balance <= maxContractBalance);
var c = contributorMap[msg.sender];
uint newBalance = c.balance.add(msg.valu... | 37,918 |
30 | // Reports the Witnet-provided result to a previously posted request. /Will assume `block.timestamp` as the timestamp at which the request was solved./Fails if:/- the `_queryId` is not in 'Posted' status./- provided `_drTxHash` is zero;/- length of provided `_result` is zero./_queryId The unique identifier of the data ... | function reportResult(
uint256 _queryId,
bytes32 _drTxHash,
bytes calldata _cborBytes
)
external
override
onlyReporters
inStatus(_queryId, Witnet.QueryStatus.Posted)
| function reportResult(
uint256 _queryId,
bytes32 _drTxHash,
bytes calldata _cborBytes
)
external
override
onlyReporters
inStatus(_queryId, Witnet.QueryStatus.Posted)
| 26,417 |
64 | // Calculate x + y.Revert on overflow.x signed 64.64-bit fixed point number y signed 64.64-bit fixed point numberreturn signed 64.64-bit fixed point number / | function add(int128 x, int128 y) internal pure returns (int128) {
unchecked {
int256 result = int256(x) + y;
require(result >= MIN_64x64 && result <= MAX_64x64);
return int128(result);
}
}
| function add(int128 x, int128 y) internal pure returns (int128) {
unchecked {
int256 result = int256(x) + y;
require(result >= MIN_64x64 && result <= MAX_64x64);
return int128(result);
}
}
| 22,239 |
392 | // setPool _pid the pool id _allocPoint the pool allocation point _registered does this pool is registered (default true). _depositPause pause pool deposit (default false).This parameter can be used by the UI to include or exclude the pool _descriptionHash the hash of the pool description. / | function setPool(uint256 _pid,
uint256 _allocPoint,
bool _registered,
bool _depositPause,
string memory _descriptionHash)
| function setPool(uint256 _pid,
uint256 _allocPoint,
bool _registered,
bool _depositPause,
string memory _descriptionHash)
| 46,138 |
3 | // start timestamp of the program | uint256 start;
| uint256 start;
| 21,426 |
83 | // key for open interest in tokens | bytes32 public constant OPEN_INTEREST_IN_TOKENS = keccak256(abi.encode("OPEN_INTEREST_IN_TOKENS"));
| bytes32 public constant OPEN_INTEREST_IN_TOKENS = keccak256(abi.encode("OPEN_INTEREST_IN_TOKENS"));
| 30,790 |
459 | // increase the total borrows by the compounded interest | reserve.increaseTotalBorrowsStableAndUpdateAverageRate(
_balanceIncrease,
user.stableBorrowRate
);
| reserve.increaseTotalBorrowsStableAndUpdateAverageRate(
_balanceIncrease,
user.stableBorrowRate
);
| 12,207 |
24 | // utility for mapping bytes32=>Content. Keys must be unique. It can be updated until it is locked. | struct ContentMapping {
mapping(bytes32=>Content) data;
bytes32[] keys;
bool locked;
}
| struct ContentMapping {
mapping(bytes32=>Content) data;
bytes32[] keys;
bool locked;
}
| 32,467 |
127 | // fire a burnt event | emit Burnt(msg.sender, _from, _value);
| emit Burnt(msg.sender, _from, _value);
| 1,779 |
11 | // Pre-sale minting cannot happen until the designated time. | require(isPreSaleOpen == true, "presale is not open");
| require(isPreSaleOpen == true, "presale is not open");
| 28,148 |
13 | // Their capitol | uint capitol;
| uint capitol;
| 53,500 |
0 | // Contract Constants / |
address constant ZERO_ADDRESS = 0x0000000000000000000000000000000000000000;
|
address constant ZERO_ADDRESS = 0x0000000000000000000000000000000000000000;
| 21,000 |
595 | // Check address isn't already being used | require(employeeIds[_accountAddress] == uint256(0), ERROR_EMPLOYEE_ALREADY_EXIST);
employees[_employeeId].accountAddress = _accountAddress;
| require(employeeIds[_accountAddress] == uint256(0), ERROR_EMPLOYEE_ALREADY_EXIST);
employees[_employeeId].accountAddress = _accountAddress;
| 14,390 |
18 | // Allow lending pool convert DAI deposited on this contract to aDAI on lending pool | uint MAX_ALLOWANCE = 2**256 - 1;
daiToken.approve(address(lendingPool), MAX_ALLOWANCE);
| uint MAX_ALLOWANCE = 2**256 - 1;
daiToken.approve(address(lendingPool), MAX_ALLOWANCE);
| 53,660 |
15 | // Callback function used by VRF Coordinator/ | function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
gameState.chosenNumberAsig = true;
chosenNumber = randomness.mod((gameInfo.poolNumber.mul(gameInfo.pointsPerPool)).add(1));
}
| function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
gameState.chosenNumberAsig = true;
chosenNumber = randomness.mod((gameInfo.poolNumber.mul(gameInfo.pointsPerPool)).add(1));
}
| 42,696 |
62 | // External view function to check the account currently holding thecanceller role. The canceller can expire a timelock related to accountrecovery or account recovery disablement prior to its execution.return The address of the current canceller, or the null address if noneis set. / | function getCanceller() external view returns (address canceller) {
canceller = _roles[uint256(Role.CANCELLER)].account;
}
| function getCanceller() external view returns (address canceller) {
canceller = _roles[uint256(Role.CANCELLER)].account;
}
| 43,720 |
46 | // mint all tokensbalances[msg.sender] = totalSupply.sub(adminAllowance);Transfer(address(0x0), msg.sender, totalSupply.sub(adminAllowance)); |
balances[_admin] = adminAllowance;
Transfer(address(0x0), _admin, adminAllowance);
adminAddr = _admin;
approve(adminAddr, adminAllowance);
|
balances[_admin] = adminAllowance;
Transfer(address(0x0), _admin, adminAllowance);
adminAddr = _admin;
approve(adminAddr, adminAllowance);
| 11,061 |
0 | // Storage//Events//Functions// Constructor which sets the sender as the default admin and the base roles/ | constructor () {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setRoleAdmin(REPORTER_ROLE, DEFAULT_ADMIN_ROLE);
}
| constructor () {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setRoleAdmin(REPORTER_ROLE, DEFAULT_ADMIN_ROLE);
}
| 18,660 |
153 | // the Metadata extension, but not including the Enumerable extension. This does random batch minting. / | contract ERC721r is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
mapping(uint => uint) private _availableTokens;
uint256 private _numAvailableTokens;
... | contract ERC721r is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
mapping(uint => uint) private _availableTokens;
uint256 private _numAvailableTokens;
... | 35,955 |
44 | // See {IPerpetualPool}.{getParameters} / | function getParameters() public view override returns (
uint256 multiplier,
uint256 feeRatio,
uint256 minPoolMarginRatio,
uint256 minInitialMarginRatio,
uint256 minMaintenanceMarginRatio,
uint256 minAddLiquidity,
uint256 redemptionFeeRatio,
uint256 fun... | function getParameters() public view override returns (
uint256 multiplier,
uint256 feeRatio,
uint256 minPoolMarginRatio,
uint256 minInitialMarginRatio,
uint256 minMaintenanceMarginRatio,
uint256 minAddLiquidity,
uint256 redemptionFeeRatio,
uint256 fun... | 48,732 |
62 | // Repay `amount` debt using `underlyingToken` to credit the account owned by `recipient`.//`amount` will be limited up to the amount of debt that `recipient` currently holds.//`amount` must be greater than zero or this call will revert with a {IllegalArgument} error./`recipient` must be non-zero or this call will reve... | function repay(
address underlyingToken,
uint256 amount,
address recipient
) external returns (uint256 amountRepaid);
| function repay(
address underlyingToken,
uint256 amount,
address recipient
) external returns (uint256 amountRepaid);
| 56,624 |
17 | // Get the address of a network contract by name (returns address(0x0) instead of reverting if contract does not exist) | function getContractAddressUnsafe(string memory _contractName) internal view returns (address) {
// Get the current contract address
address contractAddress = getAddress(keccak256(abi.encodePacked("contract.address", _contractName)));
// Return
return contractAddress;
}
| function getContractAddressUnsafe(string memory _contractName) internal view returns (address) {
// Get the current contract address
address contractAddress = getAddress(keccak256(abi.encodePacked("contract.address", _contractName)));
// Return
return contractAddress;
}
| 45,360 |
15 | // Minting event | constructor() public{
balanceOf[msg.sender] = totalSupply;
name = "BRUH";
symbol = "uMad";
emit Transfer(address(0), msg.sender, totalSupply);
}
| constructor() public{
balanceOf[msg.sender] = totalSupply;
name = "BRUH";
symbol = "uMad";
emit Transfer(address(0), msg.sender, totalSupply);
}
| 16,871 |
15 | // Emitted when `value` tokens are moved from one account (`from`) toanother (`to`). Note that `value` may be zero. / | event Transfer(address indexed from, address indexed to, uint256 value);
| event Transfer(address indexed from, address indexed to, uint256 value);
| 32,244 |
241 | // It's not perfect filtering against CA, but the owners can handle it cautiously./ @custom:error (AE2) - Contract address not acceptable | require(codeSize == 0, 'AE2');
_;
| require(codeSize == 0, 'AE2');
_;
| 67,049 |
35 | // send token's worth of ethers to the owner | sendTo.transfer(msg.value);
| sendTo.transfer(msg.value);
| 8,427 |
488 | // Read length of nested bytes | uint256 nestedBytesLength = readUint256(b, index);
index += 32;
| uint256 nestedBytesLength = readUint256(b, index);
index += 32;
| 23,950 |
51 | // Mapping for open order ETH | mapping(address=>uint256) private _openOrderETHAmountByAddress;
| mapping(address=>uint256) private _openOrderETHAmountByAddress;
| 12,816 |
6 | // The mapping below maps all bidders' IDs to their userID | mapping(uint256 => uint256[]) public bidOwners;
| mapping(uint256 => uint256[]) public bidOwners;
| 47,933 |
60 | // PausableBase contract which allows children to implement an emergency stop mechanism. / | contract Pausable is PauserRole {
event Paused(address indexed account);
event Unpaused(address indexed account);
bool private _paused;
constructor() internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns(bool) {
... | contract Pausable is PauserRole {
event Paused(address indexed account);
event Unpaused(address indexed account);
bool private _paused;
constructor() internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns(bool) {
... | 33,046 |
110 | // bytes4(keccak256('name()')) == 0x06fdde03 bytes4(keccak256('symbol()')) == 0x95d89b41 bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f/ | bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
| bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
| 68,558 |
22 | // calc user reward | uint256 userReward = reward - userInviteReward;
| uint256 userReward = reward - userInviteReward;
| 41,942 |
9 | // Cancel the task that was created through the given resolver./_resolverAddress The resolver that created the task./_executionData The task data to be canceled. | function cancelTask(address _resolverAddress, bytes calldata _executionData)
external
override
| function cancelTask(address _resolverAddress, bytes calldata _executionData)
external
override
| 35,812 |
382 | // Helper to parse the canonical sender of a tx based on whether it has been relayed | function __msgSender() internal view returns (address payable canonicalSender_) {
if (msg.data.length >= 24 && msg.sender == getGasRelayTrustedForwarder()) {
assembly {
canonicalSender_ := shr(96, calldataload(sub(calldatasize(), 20)))
}
| function __msgSender() internal view returns (address payable canonicalSender_) {
if (msg.data.length >= 24 && msg.sender == getGasRelayTrustedForwarder()) {
assembly {
canonicalSender_ := shr(96, calldataload(sub(calldatasize(), 20)))
}
| 72,952 |
136 | // revoke an `account` owner access (while ensuring at least one owner remains) | function removeOwner(address owner) external onlyOwner {
require(isOwner[owner], 'only owners can be removed');
require(owners.length > 1, 'can not remove last owner');
isOwner[owner] = false;
for (uint i = 0; i < owners.length; i++) {
if (owners[i] == owner) {
owners[i] = owners[owners.... | function removeOwner(address owner) external onlyOwner {
require(isOwner[owner], 'only owners can be removed');
require(owners.length > 1, 'can not remove last owner');
isOwner[owner] = false;
for (uint i = 0; i < owners.length; i++) {
if (owners[i] == owner) {
owners[i] = owners[owners.... | 15,218 |
2 | // modifier to check if caller is the lottery operator | modifier isOperator() {
require(
(msg.sender == lotteryOperator),
"Caller is not the lottery operator"
);
_;
}
| modifier isOperator() {
require(
(msg.sender == lotteryOperator),
"Caller is not the lottery operator"
);
_;
}
| 21,388 |
41 | // Gets the number of managers./ return The numer of managers. | function numManagers()
public
view
returns (uint)
| function numManagers()
public
view
returns (uint)
| 1,255 |
51 | // Add new pool | poolInfo.push(
PoolInfo({
stakedToken: stakedToken,
lpToken: lpToken,
allocPoint: allocPoint,
lastRewardBlock: block.number,
totalStaked: 0,
rewardsPerShare: 0,
vipAmount: vipAmount,
... | poolInfo.push(
PoolInfo({
stakedToken: stakedToken,
lpToken: lpToken,
allocPoint: allocPoint,
lastRewardBlock: block.number,
totalStaked: 0,
rewardsPerShare: 0,
vipAmount: vipAmount,
... | 44,898 |
39 | // 获取校验 | User user = UserMap[ID];
if(user.ID == 0x0){
return (false, "The ID is not exist!",value);
}
| User user = UserMap[ID];
if(user.ID == 0x0){
return (false, "The ID is not exist!",value);
}
| 39,264 |
9 | // WETH GATEWAY | string public constant WG_DESTINATION_IS_NOT_WETH_COMPATIBLE = "WG1";
string public constant WG_RECEIVE_IS_NOT_ALLOWED = "WG2";
string public constant WG_NOT_ENOUGH_FUNDS = "WG3";
| string public constant WG_DESTINATION_IS_NOT_WETH_COMPATIBLE = "WG1";
string public constant WG_RECEIVE_IS_NOT_ALLOWED = "WG2";
string public constant WG_NOT_ENOUGH_FUNDS = "WG3";
| 28,770 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.