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 |
|---|---|---|---|---|
239 | // Allows anyone to buy an amount of tokens at a price which matchesthe signature that the owner or alternate signer has approved / | function mint(
uint256 version,
uint256 amount,
uint256[4] memory pricesAndTimestamps,
bytes memory signature
| function mint(
uint256 version,
uint256 amount,
uint256[4] memory pricesAndTimestamps,
bytes memory signature
| 8,600 |
0 | // _USDTContract = IUSDT(0xdAC17F958D2ee523a2206206994597C13D831ec7); | _pause();
| _pause();
| 17,610 |
278 | // Emitted when fees was compuonded to the pool/amount0 Total amount of fees compounded in terms of token 0/amount1 Total amount of fees compounded in terms of token 1 | event CompoundFees(
uint256 amount0,
uint256 amount1
);
| event CompoundFees(
uint256 amount0,
uint256 amount1
);
| 42,348 |
86 | // RepublicToken. | RepublicToken public ren;
| RepublicToken public ren;
| 22,944 |
34 | // Emits a {CallExecuted} event. / | function _call(
bytes32 id,
uint256 index,
address target,
uint256 value,
bytes calldata data
) private {
(bool success, ) = target.call{value: value}(data);
| function _call(
bytes32 id,
uint256 index,
address target,
uint256 value,
bytes calldata data
) private {
(bool success, ) = target.call{value: value}(data);
| 37,690 |
2 | // assert(a == bc + a % b);There is no case in which this doesn't hold | return c;
| return c;
| 279 |
14 | // Minimum points in ring is 3. (minimum cells is 6). | require(points.length >= CELLS_PER_POINT * MIN_POINTS_AMOUNT_PER_RING);
require(points.length % CELLS_PER_POINT == 0);
uint32 _pointsAmount = uint32(points.length / CELLS_PER_POINT);
ringsSizes.push(_pointsAmount);
pointsAmount = pointsAmount.add(_pointsAmount);
rings[u... | require(points.length >= CELLS_PER_POINT * MIN_POINTS_AMOUNT_PER_RING);
require(points.length % CELLS_PER_POINT == 0);
uint32 _pointsAmount = uint32(points.length / CELLS_PER_POINT);
ringsSizes.push(_pointsAmount);
pointsAmount = pointsAmount.add(_pointsAmount);
rings[u... | 20,145 |
6 | // Set the maximum amount of tokens that a user can receive for the entire time amount new maximum amount / | function setMaxReceiveAmount(uint256 amount) external;
| function setMaxReceiveAmount(uint256 amount) external;
| 10,395 |
4 | // Emitted when an admin is removed from the admin list./_initiator The address which initiated this event to be emitted./_removedAdmin The address of the removed admin. | event AdminRemoved(address indexed _initiator, address indexed _removedAdmin);
| event AdminRemoved(address indexed _initiator, address indexed _removedAdmin);
| 25,217 |
20 | // freeze part | function freeze(address _addr, uint256 _value) public onlyOwner returns (bool success) {
require(balances[_addr] >= _value);
require(_value > 0);
balances[_addr] = sub(balances[_addr], _value);
frozen[_addr] = add(frozen[_addr], _value);
emit Freeze(_addr, _value);
re... | function freeze(address _addr, uint256 _value) public onlyOwner returns (bool success) {
require(balances[_addr] >= _value);
require(_value > 0);
balances[_addr] = sub(balances[_addr], _value);
frozen[_addr] = add(frozen[_addr], _value);
emit Freeze(_addr, _value);
re... | 4,647 |
16 | // Set common engagement property | EngagementProperty.Data storage engagement = _engagements[ENGAGEMENT_ID];
engagement.engagementId = ENGAGEMENT_ID;
engagement.takerAddress = takerAddress;
engagement.engagementCreationTimestamp = now;
engagement.engagementDueTimestamp = now.add(_bip.tenorDays * 1 days);
e... | EngagementProperty.Data storage engagement = _engagements[ENGAGEMENT_ID];
engagement.engagementId = ENGAGEMENT_ID;
engagement.takerAddress = takerAddress;
engagement.engagementCreationTimestamp = now;
engagement.engagementDueTimestamp = now.add(_bip.tenorDays * 1 days);
e... | 39,161 |
3 | // Active brains of Governor | address public implementation;
| address public implementation;
| 18,445 |
163 | // compute the fees _expectedAmount amount expected for the requestreturn/ | function collectEstimation(int256 _expectedAmount)
public
view
returns(uint256)
| function collectEstimation(int256 _expectedAmount)
public
view
returns(uint256)
| 47,245 |
1 | // MEMBERS The reference to the active token implementation. | BlackCaspian public BlackCaspian;
| BlackCaspian public BlackCaspian;
| 9,251 |
7 | // Equivalent to require(denominator != 0 && (x == 0 || (xy) / x == y)) | if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
revert(0, 0)
}
| if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
revert(0, 0)
}
| 14,239 |
63 | // Modifier to check if value send fulfills player stake requirements. | modifier onlyValidValue() {
require(minStake <= msg.value && msg.value <= maxStake);
_;
}
| modifier onlyValidValue() {
require(minStake <= msg.value && msg.value <= maxStake);
_;
}
| 35,190 |
466 | // Reads the bytes5 at `mPtr` in memory. | function readBytes5(
MemoryPointer mPtr
| function readBytes5(
MemoryPointer mPtr
| 19,811 |
667 | // Numerator: 1. val = 1. val := mulmod(val, 1, PRIME). Denominator: point^(trace_length / 4096) - trace_generator^(251trace_length / 256). val = denominator_invs[16]. | val := mulmod(val, mload(0x4920), PRIME)
| val := mulmod(val, mload(0x4920), PRIME)
| 21,746 |
118 | // Crowdsale Crowdsale is a base contract for managing a token crowdsale / | contract Crowdsale is Ownable {
using SafeMath for uint256;
using SafeERC20 for RESTOToken;
uint256 hardCap = 50000 * 1 ether;
address myAddress = this;
RESTOToken public token = new RESTOToken(myAddress);
uint64 crowdSaleStartTime = 1537401600; // 20.09.2018
uint64 crowdSaleEndTime = 1... | contract Crowdsale is Ownable {
using SafeMath for uint256;
using SafeERC20 for RESTOToken;
uint256 hardCap = 50000 * 1 ether;
address myAddress = this;
RESTOToken public token = new RESTOToken(myAddress);
uint64 crowdSaleStartTime = 1537401600; // 20.09.2018
uint64 crowdSaleEndTime = 1... | 12,049 |
48 | // If there are no royalties, return the initial amount | if (totalRecipients == 0) return _amount;
| if (totalRecipients == 0) return _amount;
| 19,175 |
29 | // Returns the current time.Useful to abstract calls to "now" for tests./ | function currentTime() public view returns (uint _currentTime) {
return block.timestamp;
}
| function currentTime() public view returns (uint _currentTime) {
return block.timestamp;
}
| 20,543 |
216 | // 正序 | else {
uint index = offset;
uint end = index + count;
if (end > length) {
end = length;
}
| else {
uint index = offset;
uint end = index + count;
if (end > length) {
end = length;
}
| 66,192 |
205 | // Store the length. | mstore(str, length)
| mstore(str, length)
| 3,878 |
90 | // : Squeebo / | abstract contract ERC721B is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
// Mapping from token ID to approved a... | abstract contract ERC721B is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
// Mapping from token ID to approved a... | 19,754 |
18 | // If a token URI resolver is provided, use it to resolve the token URI. | if (address(_resolver) != address(0)) return _resolver.getUri(_tokenId);
| if (address(_resolver) != address(0)) return _resolver.getUri(_tokenId);
| 11,772 |
12 | // Returns true if the caller is the current owner. / | function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
| function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
| 10,600 |
14 | // Returns the scaled balance of the user. The scaled balance is the sum of all theupdated stored balance divided by the reserve's liquidity index at the moment of the update user The user whose balance is calculatedreturn The scaled balance of the user / | function scaledBalanceOf(address user) external view override returns (uint256) {
return super.balanceOf(user);
}
| function scaledBalanceOf(address user) external view override returns (uint256) {
return super.balanceOf(user);
}
| 27,035 |
18 | // Add to presale | function addTopresale(address[] memory newPresale, uint256 mintId) public onlyOwner {
for (uint256 i = 0; i < newPresale.length; i++) {
presale[mintId][newPresale[i]] = 1;
presaleCount = presaleCount + 1;
}
}
| function addTopresale(address[] memory newPresale, uint256 mintId) public onlyOwner {
for (uint256 i = 0; i < newPresale.length; i++) {
presale[mintId][newPresale[i]] = 1;
presaleCount = presaleCount + 1;
}
}
| 26,084 |
86 | // SnapshotTokenAn ERC20 token which enables taking snapshots of accounts' balances. This can be useful to safely implement voting weighed by balance. / | contract SnapshotToken is StandardToken {
using ArrayUtils for uint256[];
// The 0 id represents no snapshot was taken yet.
uint256 public currSnapshotId;
mapping (address => uint256[]) internal snapshotIds;
mapping (address => uint256[]) internal snapshotBalances;
event Snapshot(uint256 id);... | contract SnapshotToken is StandardToken {
using ArrayUtils for uint256[];
// The 0 id represents no snapshot was taken yet.
uint256 public currSnapshotId;
mapping (address => uint256[]) internal snapshotIds;
mapping (address => uint256[]) internal snapshotBalances;
event Snapshot(uint256 id);... | 54,137 |
1 | // assert(b > 0);Solidity automatically throws when dividing by 0 | uint256 c = a / b;
| uint256 c = a / b;
| 942 |
22 | // Register a future flight for insuring./ | function registerFlight(
string memory flightNumber,
uint256 timestamp,
uint256 ticketPrice
| function registerFlight(
string memory flightNumber,
uint256 timestamp,
uint256 ticketPrice
| 36,788 |
68 | // send tokens and ETH for liquidity to contract directly, then call this (not required, can still use Uniswap to add liquidity manually, but this ensures everything is excluded properly and makes for a great stealth launch) | function launch(address[] memory presaleWallets, uint256[] memory amounts) external onlyOwner returns (bool){
require(!tradingActive, "Trading is already active, cannot relaunch.");
require(presaleWallets.length < 200, "Can only airdrop 200 wallets per txn due to gas limits"); // allows for airdrop ... | function launch(address[] memory presaleWallets, uint256[] memory amounts) external onlyOwner returns (bool){
require(!tradingActive, "Trading is already active, cannot relaunch.");
require(presaleWallets.length < 200, "Can only airdrop 200 wallets per txn due to gas limits"); // allows for airdrop ... | 21,800 |
156 | // Update merkle root to reflect changes in Allowlist_id token if for merkle root_newMerkleRoot new merkle root to reflect most recent Allowlist/ | function updateMerkleRoot(uint256 _id, bytes32 _newMerkleRoot) public onlyOwner {
require(_newMerkleRoot != merkleRoot[_id], "Merkle root will be unchanged!");
merkleRoot[_id] = _newMerkleRoot;
}
| function updateMerkleRoot(uint256 _id, bytes32 _newMerkleRoot) public onlyOwner {
require(_newMerkleRoot != merkleRoot[_id], "Merkle root will be unchanged!");
merkleRoot[_id] = _newMerkleRoot;
}
| 28,869 |
25 | // Return the removed accounts so the caller can emit removal events | return removedAccounts;
| return removedAccounts;
| 38,798 |
22 | // Get Ether balance / | function getEtherBalance() public view returns (uint) {
return address(this).balance;
}
| function getEtherBalance() public view returns (uint) {
return address(this).balance;
}
| 46,736 |
33 | // Set up a Token Threshold action action Token threshold action to be configured admin Address that will be granted with admin rights for the Token Threshold action params Params to customize the Token Threshold action / | function setupTokenThresholdAction(
TokenThresholdAction action,
address admin,
TokenThresholdActionParams memory params
| function setupTokenThresholdAction(
TokenThresholdAction action,
address admin,
TokenThresholdActionParams memory params
| 32,149 |
196 | // Declare and check identifier variable within an isolated scope. | {
| {
| 17,453 |
46 | // Source of tokens._beneficiary Address performing the token purchase_tokenAmount Number of tokens to be emitted/ | function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
ISecurityToken(securityToken).issue(_beneficiary, _tokenAmount, "");
}
| function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
ISecurityToken(securityToken).issue(_beneficiary, _tokenAmount, "");
}
| 17,527 |
73 | // internal functions //The following function should be used to update any balances within an epoch, whichwill not be immediately final. E.g. the BatchExchange credits new balances tothe buyers in an auction, but as there are might be better solutions, the updates arenot final. In order to prevent withdraws from non-f... | function addBalanceAndBlockWithdrawForThisBatch(
address user,
address token,
uint256 amount
| function addBalanceAndBlockWithdrawForThisBatch(
address user,
address token,
uint256 amount
| 10,839 |
1 | // Check the signature length | if (sig.length != 65) {
return (address(0));
}
| if (sig.length != 65) {
return (address(0));
}
| 22,961 |
1 | // [address][epoch] | mapping(address => mapping(uint16 => uint256)) public userApplyAmount;
mapping(address => uint256) public userBuybackedAmount;
IBEP20 buybackToken; // BUSD
IBEP20 sellToken; // Gokgweingi
uint256 public buybackPrice;
uint256 public epochBuybackAmount;
uint16 public currentEpoc... | mapping(address => mapping(uint16 => uint256)) public userApplyAmount;
mapping(address => uint256) public userBuybackedAmount;
IBEP20 buybackToken; // BUSD
IBEP20 sellToken; // Gokgweingi
uint256 public buybackPrice;
uint256 public epochBuybackAmount;
uint16 public currentEpoc... | 34,377 |
60 | // else, reduce outstanding value of bond | loans[msg.sender][p].price = loans[msg.sender][p].price - _amount;
| loans[msg.sender][p].price = loans[msg.sender][p].price - _amount;
| 18,976 |
54 | // constructor function that is called once at deployment of the contract.recipient Address to receive initial supply./ | constructor(address initialOwner, address recipient) public Ownable(initialOwner) {
// name of the token
_name = "Finandy";
// symbol of the token
_symbol = "FIN";
// decimals of the token
_decimals = 8;
// creation of initial supply
_mint(recipient,... | constructor(address initialOwner, address recipient) public Ownable(initialOwner) {
// name of the token
_name = "Finandy";
// symbol of the token
_symbol = "FIN";
// decimals of the token
_decimals = 8;
// creation of initial supply
_mint(recipient,... | 15,797 |
4 | // a token controlled by LockedAccount, read ERC20 + extensions to read what token is it (ETH/EUR etc.) | IERC677Token private ASSET_TOKEN;
Neumark private NEUMARK;
| IERC677Token private ASSET_TOKEN;
Neumark private NEUMARK;
| 53,367 |
11 | // check whether the account is a valid country or not | function is_country_check(address address_of_country) public view returns(bool){
for(uint index=0; index<country.length; index++){
if(country[index]==address_of_country)
return true;
}
return false;
}
| function is_country_check(address address_of_country) public view returns(bool){
for(uint index=0; index<country.length; index++){
if(country[index]==address_of_country)
return true;
}
return false;
}
| 27,465 |
15 | // Create a new service_minimumPrice Service starting price._data IPFS 32byte hash./ | function createService(uint256 _minimumPrice, bytes32 _data) public whenNotPaused() {
services[serviceId] = Service({id: serviceId, data: _data, minimumPrice: _minimumPrice, seller: msg.sender});
sellers[serviceId] = msg.sender;
serviceList.push(serviceId);
emit ServiceCreated(servic... | function createService(uint256 _minimumPrice, bytes32 _data) public whenNotPaused() {
services[serviceId] = Service({id: serviceId, data: _data, minimumPrice: _minimumPrice, seller: msg.sender});
sellers[serviceId] = msg.sender;
serviceList.push(serviceId);
emit ServiceCreated(servic... | 32,880 |
3 | // Accrued token per share | uint256 public accTokenPerShare;
| uint256 public accTokenPerShare;
| 22,394 |
19 | // Mark the contract as initialized. | __setInitialized();
emit GroupIdentityManagerRouterImplInitialized(initialGroupIdentityManager);
| __setInitialized();
emit GroupIdentityManagerRouterImplInitialized(initialGroupIdentityManager);
| 16,163 |
12 | // ----- HELPER FUNCTIONS ----- / | function whichSwapCalled() private view returns (SwapRouterVersion version) {
address sender = _msgSender();
if (sender == address(swapRouterV3)) {
return SwapRouterVersion.V3;
} else if (sender == address(swapRouterV2)) {
return SwapRouterVersion.V2;
}
... | function whichSwapCalled() private view returns (SwapRouterVersion version) {
address sender = _msgSender();
if (sender == address(swapRouterV3)) {
return SwapRouterVersion.V3;
} else if (sender == address(swapRouterV2)) {
return SwapRouterVersion.V2;
}
... | 42,713 |
1 | // Token ID -> Royalty | mapping(uint256 => uint256) private royalties;
| mapping(uint256 => uint256) private royalties;
| 23,576 |
41 | // transfer the raw ERC1155s to this contract | raw.safeTransferFrom(
address(msg.sender),
address(this),
(refinery.inputType),
_amount,
""
);
| raw.safeTransferFrom(
address(msg.sender),
address(this),
(refinery.inputType),
_amount,
""
);
| 35,713 |
83 | // Proxy This contract is the base proxy contract that all proxy contracts should useIt deals with the agentManager contract dependency and imports all necessary utilities / | contract BaseProxy is Ownable {
using Address for address;
using SafeMath for uint256;
using SafeERC20 for IERC20;
uint256 public constant FEE_PRECISION = 10**6;
uint256 public actionFee;
address public feeDepositAddress;
IAgentManager internal agentManager;
event feeDeposited(
... | contract BaseProxy is Ownable {
using Address for address;
using SafeMath for uint256;
using SafeERC20 for IERC20;
uint256 public constant FEE_PRECISION = 10**6;
uint256 public actionFee;
address public feeDepositAddress;
IAgentManager internal agentManager;
event feeDeposited(
... | 36,607 |
95 | // See {IERC1155-balanceOfBatch(address[],uint256[])}. | function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) external view virtual override returns (uint256[] memory) {
require(owners.length == ids.length, "Inventory: inconsistent arrays");
uint256[] memory balances = new uint256[](owners.length);
for (uint256 i = 0; i != ... | function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) external view virtual override returns (uint256[] memory) {
require(owners.length == ids.length, "Inventory: inconsistent arrays");
uint256[] memory balances = new uint256[](owners.length);
for (uint256 i = 0; i != ... | 77,211 |
0 | // EVENTS | event NoteCreated(uint64 id, bytes2 publicKey);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
| event NoteCreated(uint64 id, bytes2 publicKey);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
| 10,199 |
40 | // Call the unstake function with the final balance | return unstake(userBalance);
| return unstake(userBalance);
| 18,042 |
95 | // Returns the version string of the {IRelayHub} for which this recipient implementation was built. If{_upgradeRelayHub} is used, the new {IRelayHub} instance should be compatible with this version. / This function is view for future-proofing, it may require reading from storage in the future. | function relayHubVersion() public view virtual returns (string memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return "1.0.0";
}
| function relayHubVersion() public view virtual returns (string memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return "1.0.0";
}
| 6,472 |
121 | // Checks if address is a contract It prevents contract from being targetted / | function _isContract(address addr) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(addr)
}
return size > 0;
}
| function _isContract(address addr) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(addr)
}
return size > 0;
}
| 19,913 |
139 | // Update rewards per block | _updateRewardsPerBlock(endBlock);
uint256 previousEndBlock = endBlock;
| _updateRewardsPerBlock(endBlock);
uint256 previousEndBlock = endBlock;
| 20,060 |
19 | // Check if address is owner / | function isOwner(address account) public view returns (bool) {
return account == owner;
}
| function isOwner(address account) public view returns (bool) {
return account == owner;
}
| 18,546 |
191 | // Governor addresses of the system | Governor private governor;
| Governor private governor;
| 68,969 |
84 | // In case you ever find yourself in a situation like this, just contact the {} support, however nothing precludes you from invoking this method yourself. | function refundBet(uint commit) external {
| function refundBet(uint commit) external {
| 10,475 |
83 | // Loopring Token Exchange Protocol Contract Interface/Daniel Wang - <daniel@loopring.org>/Kongliang Zhong - <kongliang@loopring.org> | contract LoopringProtocol {
////////////////////////////////////////////////////////////////////////////
/// Constants ///
////////////////////////////////////////////////////////////////////////////
uint public constant FEE_SELECT_LRC ... | contract LoopringProtocol {
////////////////////////////////////////////////////////////////////////////
/// Constants ///
////////////////////////////////////////////////////////////////////////////
uint public constant FEE_SELECT_LRC ... | 7,208 |
70 | // do not allow to drain lpToken if less than 3 months after farming | require(_token != bsd, "!bsd");
for (uint256 pid = 0; pid < poolLength; ++pid) {
PoolInfo storage pool = poolInfo[pid];
require(_token != pool.lpToken, "!pool.lpToken");
}
| require(_token != bsd, "!bsd");
for (uint256 pid = 0; pid < poolLength; ++pid) {
PoolInfo storage pool = poolInfo[pid];
require(_token != pool.lpToken, "!pool.lpToken");
}
| 2,167 |
92 | // Update new and old observations if elapsed time is greater than or equal to anchor period | uint timeElapsed = block.timestamp - newObservation.timestamp;
if (timeElapsed >= anchorPeriod) {
oldObservations[symbolHash].timestamp = newObservation.timestamp;
oldObservations[symbolHash].acc = newObservation.acc;
newObservations[symbolHash].timestamp = block.tim... | uint timeElapsed = block.timestamp - newObservation.timestamp;
if (timeElapsed >= anchorPeriod) {
oldObservations[symbolHash].timestamp = newObservation.timestamp;
oldObservations[symbolHash].acc = newObservation.acc;
newObservations[symbolHash].timestamp = block.tim... | 2,092 |
39 | // Mark a store front as (de)activated./ | function storeFrontActivator(uint _sFID, bool status) public ownsStore(_sFID)
| function storeFrontActivator(uint _sFID, bool status) public ownsStore(_sFID)
| 43,929 |
22 | // Construct a new Comp token account The initial account to grant all the tokens / | constructor(address account, uint256 cap) public {
require(cap > 0, "Capped: cap is 0");
_cap = cap;
balances[account] = _totalSupply;
emit Transfer(address(0), account, _totalSupply);
}
| constructor(address account, uint256 cap) public {
require(cap > 0, "Capped: cap is 0");
_cap = cap;
balances[account] = _totalSupply;
emit Transfer(address(0), account, _totalSupply);
}
| 10,578 |
43 | // Get revert error message from a .call method | function getRevertMsg(bytes memory _returnData) internal pure returns (string memory) {
// If the _res length is less than 68, then the transaction failed silently (without a revert message)
if (_returnData.length < 68) return "Transaction reverted silently";
assembly {
// Slice ... | function getRevertMsg(bytes memory _returnData) internal pure returns (string memory) {
// If the _res length is less than 68, then the transaction failed silently (without a revert message)
if (_returnData.length < 68) return "Transaction reverted silently";
assembly {
// Slice ... | 20,870 |
9 | // -------------------- Admin functions |
function getStatus() external view returns(uint)
|
function getStatus() external view returns(uint)
| 48,424 |
37 | // Burns a specific amount of tokens. _value The amount of token to be burned. / | function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address bur... | function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address bur... | 940 |
1 | // Runlog request / | ) public override onlyOwner returns (bytes32 requestId) {
Chainlink.Request memory req = buildChainlinkRequest(
stringToBytes32(jobId),
address(this),
this.fulfillUInt256.selector
);
req.add('url', url);
req.add('path', path);
req.addInt('t... | ) public override onlyOwner returns (bytes32 requestId) {
Chainlink.Request memory req = buildChainlinkRequest(
stringToBytes32(jobId),
address(this),
this.fulfillUInt256.selector
);
req.add('url', url);
req.add('path', path);
req.addInt('t... | 29,636 |
51 | // Merge all subtrees to form the shortest possible tree.This function can be called either once to merge all subtrees in asingle transaction, or multiple times to do the same in multipletransactions. If _numSrQueueOps is set to 0, this function will attemptto merge all subtrees in one go. If it is set to a number grea... | function mergeSubRoots(
uint256 _numSrQueueOps
| function mergeSubRoots(
uint256 _numSrQueueOps
| 37,573 |
20 | // The balance of any account can be calculated from the Transfer events history. However, since we need to keep the balances to validate transfer request, there is no extra cost to also privide a querry function. | return balances[_id][_owner];
| return balances[_id][_owner];
| 50,803 |
1 | // Returns if the given address is qualified, implemented on demand. / | function ifQualified (address testee) external view returns (bool);
| function ifQualified (address testee) external view returns (bool);
| 60,445 |
60 | // Function to add minter address. return True if the operation was successful./ | function addMinter(
address _minter)
public
onlyOwner
canMint
returns (bool)
| function addMinter(
address _minter)
public
onlyOwner
canMint
returns (bool)
| 22,299 |
13 | // store the ad, return the index | Ad memory ad = Ad(msg.sender, _x, _y, _width, _height, _title, _link, _ipfsHash, false, true, price);
idx = ads.push(ad) - 1;
| Ad memory ad = Ad(msg.sender, _x, _y, _width, _height, _title, _link, _ipfsHash, false, true, price);
idx = ads.push(ad) - 1;
| 26,004 |
303 | // Whether or not the crowdsale is post-purchase | function isFinished() internal pure returns (bytes32)
| function isFinished() internal pure returns (bytes32)
| 74,608 |
14 | // if not last index, swap with last element | uint256 index = priceFeederIndices[_account];
uint256 lastIndex = priceFeeders.length - 1;
if (index != lastIndex) {
priceFeeders[index] = priceFeeders[lastIndex];
}
| uint256 index = priceFeederIndices[_account];
uint256 lastIndex = priceFeeders.length - 1;
if (index != lastIndex) {
priceFeeders[index] = priceFeeders[lastIndex];
}
| 41,608 |
33 | // PAUSE/ Modifier to make a function callable only when the contract is not paused. / | modifier whenNotPaused() {
if(msg.sender != owner()) {
require(!paused, "Pausable: paused");
}
_;
}
| modifier whenNotPaused() {
if(msg.sender != owner()) {
require(!paused, "Pausable: paused");
}
_;
}
| 30,086 |
41 | // Allows for Limbo to be upgraded 1 user at a time without introducing a system wide security risk | function unstakeFor(
address token,
uint256 amount,
address holder
| function unstakeFor(
address token,
uint256 amount,
address holder
| 36,064 |
215 | // the address that is approved for spending this token | address operator;
| address operator;
| 26,570 |
162 | // Declare a boolean to indicate if call should return early. | bool returnEarly;
| bool returnEarly;
| 33,080 |
2 | // a bitmask for 247 bits where each set bit is blocking and signals closed | function blockedTimes(bytes32 id) public constant returns (uint);
| function blockedTimes(bytes32 id) public constant returns (uint);
| 10,010 |
96 | // A new investor | investorCount++;
| investorCount++;
| 24,914 |
14 | // Stage Transitions | error FunctionInvalidAtThisStage();
error SaleKeyNotSet();
error SaleMaxBatchNotSet();
error SaleMaxPerAddressNotSet();
error SaleTotalAllotmentNotSet();
error SalePriceNotSet();
| error FunctionInvalidAtThisStage();
error SaleKeyNotSet();
error SaleMaxBatchNotSet();
error SaleMaxPerAddressNotSet();
error SaleTotalAllotmentNotSet();
error SalePriceNotSet();
| 16,288 |
7 | // `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. _Available since v4.7._ / | function multiProofVerify(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] calldata leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
| function multiProofVerify(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] calldata leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
| 8,762 |
9 | // This view returns maximum valid deposit/asset_source Contract address for given ERC20 token/ return Maximum valid deposit of given ERC20 token | function get_deposit_maximum(address asset_source) public virtual view returns(uint256);
| function get_deposit_maximum(address asset_source) public virtual view returns(uint256);
| 14,681 |
117 | // when buy | if (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {
require(amount <= maxTransactionAmount, "Buy transfer amount exceeds the maxTransactionAmount.");
require(amount + balanceOf(to) <= maxWallet, "Max wallet exceeded");
... | if (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {
require(amount <= maxTransactionAmount, "Buy transfer amount exceeds the maxTransactionAmount.");
require(amount + balanceOf(to) <= maxWallet, "Max wallet exceeded");
... | 8,187 |
49 | // Updates the execution grace period/_newGracePeriod The new grace period | function updateGracePeriod(uint256 _newGracePeriod) external {
// Ensure the caller is the treasury itself
if (msg.sender != address(this)) revert ONLY_TREASURY();
emit GracePeriodUpdated(settings.gracePeriod, _newGracePeriod);
// Update the grace period
settings.gracePerio... | function updateGracePeriod(uint256 _newGracePeriod) external {
// Ensure the caller is the treasury itself
if (msg.sender != address(this)) revert ONLY_TREASURY();
emit GracePeriodUpdated(settings.gracePeriod, _newGracePeriod);
// Update the grace period
settings.gracePerio... | 16,409 |
6 | // Get address of sender | address payable bettor;
bettor = msg.sender;
| address payable bettor;
bettor = msg.sender;
| 42,010 |
39 | // pragma solidity >=0.5.0; | interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address p... | interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address p... | 78,399 |
35 | // vestedAmount = lockedAmount elapsedBatchCount / batchCount | uint256 vestedAmount =
lockedAmount
.mul(elapsedBatchCount)
.div(incvBatchCount);
if(vestedAmount > lockedAmount){
vestedAmount = lockedAmount;
}
| uint256 vestedAmount =
lockedAmount
.mul(elapsedBatchCount)
.div(incvBatchCount);
if(vestedAmount > lockedAmount){
vestedAmount = lockedAmount;
}
| 25,415 |
35 | // function to get animal details by id / | {
if(animalAgainstId[aid].eggPhase==true)
{
return(animalAgainstId[aid].name,
animalAgainstId[aid].desc,
2**256 - 1,
animalAgainstId[aid].priceForSale,
animalAgainstId[aid].priceForMating,
animalAgainstId[aid].parentId1,
... | {
if(animalAgainstId[aid].eggPhase==true)
{
return(animalAgainstId[aid].name,
animalAgainstId[aid].desc,
2**256 - 1,
animalAgainstId[aid].priceForSale,
animalAgainstId[aid].priceForMating,
animalAgainstId[aid].parentId1,
... | 1,228 |
204 | // Emitted after a successful withdrawal./user The address that withdrew from the Vault./underlyingAmount The amount of underlying tokens that were withdrawn. | event Withdraw(address indexed user, uint256 underlyingAmount);
| event Withdraw(address indexed user, uint256 underlyingAmount);
| 25,862 |
7 | // the token owners | uint256[] private tokenHashes;
| uint256[] private tokenHashes;
| 31,983 |
256 | // Value of newly placed bid on ReserveAuctionV3 item | event PartyBidPlaced(uint256 auctionID, uint256 value);
| event PartyBidPlaced(uint256 auctionID, uint256 value);
| 25,438 |
28 | // future listing | Marketplace.ListingParameters memory listing;
listing.assetContract = address(erc721);
listing.tokenId = tokenId;
listing.startTime = 200 days;
listing.secondsUntilEndTime = 1 * 24 * 60 * 60; // 1 day
listing.quantityToList = 1;
listing.currencyToAccept = NATIVE_T... | Marketplace.ListingParameters memory listing;
listing.assetContract = address(erc721);
listing.tokenId = tokenId;
listing.startTime = 200 days;
listing.secondsUntilEndTime = 1 * 24 * 60 * 60; // 1 day
listing.quantityToList = 1;
listing.currencyToAccept = NATIVE_T... | 51,930 |
1,194 | // This newSettleTime will be set to the new `oldSettleTime`. The bits between 1 and `lastSettleBit` (inclusive) will be shifted out of the bitmap and settled. The reason that lastSettleBit is inclusive is that it refers to newSettleTime which always less than the current block time. | newSettleTime = DateTime.getTimeUTC0(blockTime);
| newSettleTime = DateTime.getTimeUTC0(blockTime);
| 63,521 |
15 | // Writes the property name and boolean value (as a JSON literal "true" or "false") as part of a name/value pair of a JSON object. / | function writeBooleanProperty(
Json memory json,
string memory propertyName,
bool value
| function writeBooleanProperty(
Json memory json,
string memory propertyName,
bool value
| 33,865 |
22 | // returns the number of votes of a given candidate | function getCandidateVotes(address candidateAddress)
public
view
returns (uint256)
| function getCandidateVotes(address candidateAddress)
public
view
returns (uint256)
| 4,472 |
38 | // Collection name | bytes32 name;
| bytes32 name;
| 33,691 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.