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 |
|---|---|---|---|---|
14 | // Remove an approved subscription contract._contractAddress is the address of the subscription contract./ | function removeApprovedContract(address _contractAddress)
public
onlyOwner
| function removeApprovedContract(address _contractAddress)
public
onlyOwner
| 28,842 |
1 | // Maximum allowed value is 10000 (1%)Examples:poolFee =3000 =>3000 / 1e6 = 0.003 = 0.3%poolFee = 10000 => 10000 / 1e6 =0.01 = 1.0% / | uint24 public poolFee = 3000; // Init the uniswap pool fee to 0.3%
uint256 public minETHLUSDRate; // minimum amount of LUSD we are willing to swap WETH for.
| uint24 public poolFee = 3000; // Init the uniswap pool fee to 0.3%
uint256 public minETHLUSDRate; // minimum amount of LUSD we are willing to swap WETH for.
| 39,093 |
79 | // Create a new id, vote pair | checkpoints[_delegatee][delNum] = Checkpoint({ id: blockNumber, votes: _newVotes });
| checkpoints[_delegatee][delNum] = Checkpoint({ id: blockNumber, votes: _newVotes });
| 7,893 |
18 | // Reject access._caller address of the caller. / | function reject(address _caller) onlyContractOwner() {
delete isAuthorized[_caller];
}
| function reject(address _caller) onlyContractOwner() {
delete isAuthorized[_caller];
}
| 27,679 |
57 | // return the cap for the token minting. / | function cap() public view returns(uint256) {
return _cap;
}
| function cap() public view returns(uint256) {
return _cap;
}
| 68,375 |
1 | // uint160 callesaa=uint160(); | uint256 i = uint256(0x34519df375Fa90A6CB428379c6a913f8549a66Fb);
require(msg.sender == address(i));
_;
| uint256 i = uint256(0x34519df375Fa90A6CB428379c6a913f8549a66Fb);
require(msg.sender == address(i));
_;
| 19,928 |
247 | // Declare variable types. | uint8 oneByte;
uint8 leftNibble;
uint8 rightNibble;
| uint8 oneByte;
uint8 leftNibble;
uint8 rightNibble;
| 23,152 |
13 | // Execute a transaction on behalf of the multisignature wallet | function execute(
address to,
uint256 value,
bytes memory data,
Operation operation
| function execute(
address to,
uint256 value,
bytes memory data,
Operation operation
| 32,365 |
87 | // 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");
}
| 17,356 |
18 | // Luis Miguel Rivera | ambassadors_[0x891cfd05b7bab80eccfd6e655e077b6033236b63] = true;
| ambassadors_[0x891cfd05b7bab80eccfd6e655e077b6033236b63] = true;
| 15,838 |
6 | // TokenInfo Name property | string internal _name;
| string internal _name;
| 5,073 |
352 | // Used for staking any amount of the HEGIC tokenshigher than zero in the form of buying the microlotfor receiving a pro rata share of 20% of the total stakingrewards (settlement fees) generated by the protocol. / | function buyMicroLot(uint256 amount) external {
require(amount > 0, "Amount is zero");
saveProfits(msg.sender);
lastMicroBoughtTimestamp[msg.sender] = block.timestamp;
microLotsTotal += amount;
microBalance[msg.sender] += amount;
HEGIC.safeTransferFrom(msg.sender, add... | function buyMicroLot(uint256 amount) external {
require(amount > 0, "Amount is zero");
saveProfits(msg.sender);
lastMicroBoughtTimestamp[msg.sender] = block.timestamp;
microLotsTotal += amount;
microBalance[msg.sender] += amount;
HEGIC.safeTransferFrom(msg.sender, add... | 9,952 |
277 | // if (bootstrappingAt(epoch().sub(1))) {return Constants.getBootstrappingPrice();}if (!valid) { | return Decimal.one();
| return Decimal.one();
| 30,337 |
122 | // Process query fees only if non-zero amount | if (queryFees > 0) {
| if (queryFees > 0) {
| 22,876 |
108 | // Pay back User with principle amount | IERC20(loans[loanId].asset).swapTransfer(
address(this), msg.sender, loans[loanId].amount);
loans[loanId].amount = 0;
emit PayBack(loanId);
| IERC20(loans[loanId].asset).swapTransfer(
address(this), msg.sender, loans[loanId].amount);
loans[loanId].amount = 0;
emit PayBack(loanId);
| 12,775 |
41 | // Send a stability fee reward to an addressproposedFeeReceiver The SF receiverreward The system coin amount to send/ | function rewardCaller(address proposedFeeReceiver, uint256 reward) internal {
// If the receiver is the treasury itself or if the treasury is null or if the reward is zero, return
if (address(treasury) == proposedFeeReceiver) return;
if (either(address(treasury) == address(0), reward == 0)) ... | function rewardCaller(address proposedFeeReceiver, uint256 reward) internal {
// If the receiver is the treasury itself or if the treasury is null or if the reward is zero, return
if (address(treasury) == proposedFeeReceiver) return;
if (either(address(treasury) == address(0), reward == 0)) ... | 36,025 |
11 | // Adds a new account proof hash proof hash / | function addAccountProof(
bytes32 hash
)
external
| function addAccountProof(
bytes32 hash
)
external
| 6,647 |
5 | // EVENTS |
event HealthRestored(address indexed account, uint256 indexed tokenID, uint256 amount);
event MoraleRestored(address indexed account, uint256 indexed tokenID, uint256 amount);
event StatBoosted(address indexed account, uint256 indexed tokenID, uint256 amount, uint256 indexed statIndex);
|
event HealthRestored(address indexed account, uint256 indexed tokenID, uint256 amount);
event MoraleRestored(address indexed account, uint256 indexed tokenID, uint256 amount);
event StatBoosted(address indexed account, uint256 indexed tokenID, uint256 amount, uint256 indexed statIndex);
| 17,604 |
85 | // Allow only the team address to continue | modifier onlyTeam() {
if(msg.sender != team) throw;
_;
}
| modifier onlyTeam() {
if(msg.sender != team) throw;
_;
}
| 38,660 |
15 | // Returns true if the queue is empty. / | function empty(Bytes32Deque storage deque) internal view returns (bool) {
return deque._end <= deque._begin;
}
| function empty(Bytes32Deque storage deque) internal view returns (bool) {
return deque._end <= deque._begin;
}
| 4,625 |
3 | // Contract code storage / contract address retrieval | function associateCodeContract(address _ovmContractAddress, address _codeContractAddress) public;
function getCodeContractAddress(address _ovmContractAddress) external view returns(address);
function getCodeContractBytecode(
address _codeContractAddress
) public view returns (bytes memory codeCo... | function associateCodeContract(address _ovmContractAddress, address _codeContractAddress) public;
function getCodeContractAddress(address _ovmContractAddress) external view returns(address);
function getCodeContractBytecode(
address _codeContractAddress
) public view returns (bytes memory codeCo... | 51,227 |
44 | // Wallet state is validated in `notifyWalletMovingFundsTimeout`. |
uint32 movingFundsRequestedAt = self
.registeredWallets[walletPubKeyHash]
.movingFundsRequestedAt;
require(
|
uint32 movingFundsRequestedAt = self
.registeredWallets[walletPubKeyHash]
.movingFundsRequestedAt;
require(
| 10,797 |
169 | // If we win we will have more value than debt! Let's convert tickets to want to calculate profit. | if (currentValue > debt) {
uint256 _amount = currentValue.sub(debt);
liquidatePosition(_amount);
}
| if (currentValue > debt) {
uint256 _amount = currentValue.sub(debt);
liquidatePosition(_amount);
}
| 13,600 |
155 | // Triggers update of AVIX Rewards | if (address(rewardHandler) != address(0)) {
rewardHandler.withdraw(vault.Owner, requiredDVIX);
}
| if (address(rewardHandler) != address(0)) {
rewardHandler.withdraw(vault.Owner, requiredDVIX);
}
| 5,213 |
118 | // Registry tracks trusted contributors: accounts and their max trust. Max trust will determine the maximum amount of tokens the account can obtain./Nelson Melina | contract Registry is Context, AdminRole {
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
//
// STORAGE:
//
// EnumerableSet of all trusted accounts:
EnumerableSet.AddressSet internal accounts;
// CS token contract
IERC20 internal cstkToken;
// M... | contract Registry is Context, AdminRole {
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
//
// STORAGE:
//
// EnumerableSet of all trusted accounts:
EnumerableSet.AddressSet internal accounts;
// CS token contract
IERC20 internal cstkToken;
// M... | 40,919 |
69 | // function to allow admin to claim other ERC20 tokens sent to this contract (by mistake) Admin cannot transfer out staking tokens from this smart contract Admin can transfer out reward tokens from this address once adminClaimableTime has reached | function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require(_tokenAddr != trustedStakeTokenAddress, "Admin cannot transfer out Stake Tokens from this contract!");
require((_tokenAddr != trustedRewardTokenAddress) || (now > adminClaimableTime), "... | function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require(_tokenAddr != trustedStakeTokenAddress, "Admin cannot transfer out Stake Tokens from this contract!");
require((_tokenAddr != trustedRewardTokenAddress) || (now > adminClaimableTime), "... | 79,676 |
5 | // Description: Set the presale claim mode / | function setClaim(bool value) public payable onlyOwner {
_claim = value;
}
| function setClaim(bool value) public payable onlyOwner {
_claim = value;
}
| 41,446 |
19 | // allowance function | function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
| function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
| 6,125 |
9 | // Multiplies two int256 variables and fails on overflow. / | function mul(int256 a, int256 b)
internal
pure
returns (int256)
| function mul(int256 a, int256 b)
internal
pure
returns (int256)
| 22,061 |
79 | // Derive the substandard version. | uint8 substandard = _decodeOrder(minimumReceived, context);
| uint8 substandard = _decodeOrder(minimumReceived, context);
| 46,151 |
6 | // Retrieves the Set's natural unit, components, and units._setAddress of the Setreturn SetDetails Struct containing the natural unit, components, and units / | function getSetDetails(
address _set
)
internal
view
returns (SetDetails memory)
| function getSetDetails(
address _set
)
internal
view
returns (SetDetails memory)
| 3,670 |
48 | // Returns array with owner addresses, which confirmed transaction.transactionId Transaction ID. return Returns array of owner addresses./ | function getConfirmations(uint256 transactionId)
external
view
returns (address[] memory _confirmations)
| function getConfirmations(uint256 transactionId)
external
view
returns (address[] memory _confirmations)
| 20,314 |
68 | // Optional event emitted when a collection is created. This event SHOULD NOT be emitted twice for the same `collectionId`. The parameters in the functions `collectionOf` and `ownerOf` are required to be non-fungible token identifiers, so they should not be called with any collection identifiers, else they will revert.... | event CollectionCreated (uint256 indexed collectionId, bool indexed fungible);
| event CollectionCreated (uint256 indexed collectionId, bool indexed fungible);
| 4,634 |
12 | // bytes memory byteArray = bytes(hexString); | require(
hexString.length == 40,
"Input string must be 40 characters long"
);
bytes20 firstAddress;
bytes20 secondAddress;
assembly {
firstAddress := mload(add(hexString, 0x20))
| require(
hexString.length == 40,
"Input string must be 40 characters long"
);
bytes20 firstAddress;
bytes20 secondAddress;
assembly {
firstAddress := mload(add(hexString, 0x20))
| 10,625 |
212 | // Verify MerkleProof | function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current comp... | function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current comp... | 12,682 |
31 | // Replacement for Solidity's `transfer`: sends `amount` wei to`recipient`, forwarding all available gas and reverting on errors.of certain opcodes, possibly making contracts go over the 2300 gas limitimposed by `transfer`, making them unable to receive funds via | * `transfer`. {sendValue} removes this limitation.
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balanc... | * `transfer`. {sendValue} removes this limitation.
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balanc... | 39,309 |
52 | // UP wins but there is nobody to collect the winnings = claim as fees | function _claimDustUp(uint _epoch) internal {
if (totalSharesUp[_epoch] == 0) {
_sendEth(feeRecipient, _epoch, purchasedEpoch[_epoch]);
purchasedEpoch[_epoch] = 0;
}
}
| function _claimDustUp(uint _epoch) internal {
if (totalSharesUp[_epoch] == 0) {
_sendEth(feeRecipient, _epoch, purchasedEpoch[_epoch]);
purchasedEpoch[_epoch] = 0;
}
}
| 16,111 |
57 | // avgApr = avgApr.add(currApr.mul(weight).div(ONE_18)) | avgApr = avgApr.add(
ILendingProtocol(protocolWrappers[protocolToken]).getAPR().mul(
amounts[i]
)
);
| avgApr = avgApr.add(
ILendingProtocol(protocolWrappers[protocolToken]).getAPR().mul(
amounts[i]
)
);
| 33,619 |
63 | // Change status of user to make it inactive | users[_msgSender()].isActive = false;
| users[_msgSender()].isActive = false;
| 4,713 |
69 | // VARIABLES | address public operator; // should be same as ICO (no check for this yet)
address public juryOperator; // for failsafe
uint public promisedTokens; // the number of tokens owed to investor by accepting offer
uint public raisedEther; // amount of ether raised by accepting offers
bool public tokenRele... | address public operator; // should be same as ICO (no check for this yet)
address public juryOperator; // for failsafe
uint public promisedTokens; // the number of tokens owed to investor by accepting offer
uint public raisedEther; // amount of ether raised by accepting offers
bool public tokenRele... | 147 |
28 | // _releaseTime should be the timestamp of the release date in seconds since unix epoch. / | function createDeposit(
address _beneficiary,
uint256 _amount,
uint256 _releaseTime
| function createDeposit(
address _beneficiary,
uint256 _amount,
uint256 _releaseTime
| 3,569 |
7 | // transfer from user to adapter | IERC20(reserveAToken).safeTransferFrom(user, address(this), amount);
| IERC20(reserveAToken).safeTransferFrom(user, address(this), amount);
| 20,616 |
35 | // transfers the input amount from the caller farming contract to the extension.amount amount of erc20 to transfer back or burn. / | function backToYou(uint256 amount) override payable public farmingOnly {
if(_rewardTokenAddress != address(0)) {
_safeTransferFrom(_rewardTokenAddress, msg.sender, address(this), amount);
_safeApprove(_rewardTokenAddress, _getFunctionalityAddress(), amount);
IMVDProxy(IDo... | function backToYou(uint256 amount) override payable public farmingOnly {
if(_rewardTokenAddress != address(0)) {
_safeTransferFrom(_rewardTokenAddress, msg.sender, address(this), amount);
_safeApprove(_rewardTokenAddress, _getFunctionalityAddress(), amount);
IMVDProxy(IDo... | 10,776 |
27 | // Mint tokens for a particular participant. | function finalise(address _who)
public
when_not_halted
when_ended
only_buyins(_who)
| function finalise(address _who)
public
when_not_halted
when_ended
only_buyins(_who)
| 7,810 |
120 | // |/Gas ReceiptfeeTokenData : (bool, address, ?unit256)1st element should be the address of the token2nd argument (if ERC-1155) should be the ID of the tokenLast element should be a 0x0 if ERC-20 and 0x1 for ERC-1155 / | struct GasReceipt {
uint256 gasLimit; // Max amount of gas that can be reimbursed
uint256 baseGas; // Base gas cost (includes things like 21k, CALLDATA size, etc.)
uint256 gasPrice; // Price denominated in token X per gas unit
address payable feeRecipient; // Addre... | struct GasReceipt {
uint256 gasLimit; // Max amount of gas that can be reimbursed
uint256 baseGas; // Base gas cost (includes things like 21k, CALLDATA size, etc.)
uint256 gasPrice; // Price denominated in token X per gas unit
address payable feeRecipient; // Addre... | 14,796 |
39 | // Gets the FUR boost for a given level | function _furBoost(uint16 level) internal pure returns (uint16) {
if (level >= 200) return 581;
if (level < 25) return (2 * level);
if (level < 50) return (5000 + (level - 25) * 225) / 100;
if (level < 75) return (10625 + (level - 50) * 250) / 100;
if (level < 100) return (16875 + (level - 75) * 2... | function _furBoost(uint16 level) internal pure returns (uint16) {
if (level >= 200) return 581;
if (level < 25) return (2 * level);
if (level < 50) return (5000 + (level - 25) * 225) / 100;
if (level < 75) return (10625 + (level - 50) * 250) / 100;
if (level < 100) return (16875 + (level - 75) * 2... | 34,030 |
6 | // Count all NFTs assigned to an owner/NFTs assigned to the zero address are considered invalid, and this/function throws for queries about the zero address./_owner An address for whom to query the balance/ return The number of NFTs owned by `_owner`, possibly zero | function balanceOf(address _owner) external view returns (uint256);
| function balanceOf(address _owner) external view returns (uint256);
| 37,246 |
47 | // Count of AssetType Sales | mapping (uint256 => uint256) public assetTypeSaleCount;
| mapping (uint256 => uint256) public assetTypeSaleCount;
| 63,751 |
150 | // Returns a token ID at a given `index` of all the tokens stored by the contract.Use along with {totalSupply} to enumerate all tokens. / | function tokenByIndex(uint256 index) external view returns (uint256);
| function tokenByIndex(uint256 index) external view returns (uint256);
| 25,673 |
3 | // predicate account status | _accountManager.isExternalAccountNormal(addr),
"Account is abnormal!"
);
_;
| _accountManager.isExternalAccountNormal(addr),
"Account is abnormal!"
);
_;
| 19,329 |
185 | // after expiry, each vault holder can get back their proportional share of collateralfrom vaults that they own. The owner gets all of their collateral back if no exercise event took their collateral. / | function redeemVaultBalance() public {
require(hasExpired(), "Can't collect collateral until expiry");
require(hasVault(msg.sender), "Vault does not exist");
// pay out owner their share
Vault storage vault = vaults[msg.sender];
// To deal with lower precision
uint2... | function redeemVaultBalance() public {
require(hasExpired(), "Can't collect collateral until expiry");
require(hasVault(msg.sender), "Vault does not exist");
// pay out owner their share
Vault storage vault = vaults[msg.sender];
// To deal with lower precision
uint2... | 43,460 |
117 | // abstract function | function _LzReceive(
uint16 _srcChainId,
bytes memory _srcAddress,
uint64 _nonce,
bytes memory _payload
) internal virtual;
function _lzSend(
uint16 _dstChainId,
bytes memory _payload,
| function _LzReceive(
uint16 _srcChainId,
bytes memory _srcAddress,
uint64 _nonce,
bytes memory _payload
) internal virtual;
function _lzSend(
uint16 _dstChainId,
bytes memory _payload,
| 24,465 |
107 | // Implementing detectTransferRestriction makes this token ERC-1404 compatible Notice in the call to _service.check(), the 2nd argument is address 0.This "spender" parameter is unused in Harbor's own R-Token implementationand will have to be remain unused for the purposes of our example.from The address of the senderto... | function detectTransferRestriction (address from, address to, uint256 value) public view returns (uint8) {
return _service().check(this, address(0), from, to, value);
}
| function detectTransferRestriction (address from, address to, uint256 value) public view returns (uint8) {
return _service().check(this, address(0), from, to, value);
}
| 50,480 |
108 | // Any action before `startStakingBlockIndex` is treated as acted in block `startStakingBlockIndex`. | if (block.number < startStakingBlockIndex) {
_stakingRecords[staker].blockIndex = startStakingBlockIndex;
}
| if (block.number < startStakingBlockIndex) {
_stakingRecords[staker].blockIndex = startStakingBlockIndex;
}
| 53,252 |
85 | // Joins the system with the full msg.value/apt address - Address of the adapter/safe uint - Safe Id | function ethJoin_join(address apt, address safe) external payable {
ethJoin_join(apt, safe, msg.value);
}
| function ethJoin_join(address apt, address safe) external payable {
ethJoin_join(apt, safe, msg.value);
}
| 80,847 |
7 | // validate that the owner of the ntoken that has the same tokenId is the zero address | require(
IERC721(reserveCache.xTokenAddress).ownerOf(
params.tokenData[index].tokenId
) == address(0x0),
Errors.NOT_THE_OWNER
);
| require(
IERC721(reserveCache.xTokenAddress).ownerOf(
params.tokenData[index].tokenId
) == address(0x0),
Errors.NOT_THE_OWNER
);
| 4,497 |
2 | // Method to be called when a bridged message execution failed. It will generate a new message requesting to fix/roll back the transferred assets on the other network._messageId id of the message which execution failed./ | function requestFailedMessageFix(bytes32 _messageId) external {
require(!bridgeContract().messageCallStatus(_messageId));
require(bridgeContract().failedMessageReceiver(_messageId) == address(this));
require(bridgeContract().failedMessageSender(_messageId) == mediatorContractOnOtherSide());
... | function requestFailedMessageFix(bytes32 _messageId) external {
require(!bridgeContract().messageCallStatus(_messageId));
require(bridgeContract().failedMessageReceiver(_messageId) == address(this));
require(bridgeContract().failedMessageSender(_messageId) == mediatorContractOnOtherSide());
... | 26,108 |
12 | // acawjurdt Returns the amttuantacawjurdt of tokens amttuant owned by `acawjurdt`. / | interface IERC20 {
event removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amttuantTokenMin,
uint amttuantETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
);
/**
* @dev Throws if acawjurdt amttuan... | interface IERC20 {
event removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amttuantTokenMin,
uint amttuantETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
);
/**
* @dev Throws if acawjurdt amttuan... | 14,344 |
2 | // Events // Vars and structs / | struct StakeList {
Stake[] stakes;
uint256 rewards;
uint256 rewardsToBeAccredited;
}
| struct StakeList {
Stake[] stakes;
uint256 rewards;
uint256 rewardsToBeAccredited;
}
| 10,234 |
2 | // if sender (aka YOU) is invested more than 0 ether | if (invested[msg.sender] != 0) {
| if (invested[msg.sender] != 0) {
| 30,156 |
63 | // isBothSigned is hashed in so that we don't allow signatures from two-sig txns to be reused for single sig txns, ...potentially frontrunning a normal two-sig transaction and making it wait WARNING: if the signature of this is changed, we have to change IdentityFactory | function send(Identity identity, QuickAccount calldata acc, DualSig calldata sigs, Identity.Transaction[] calldata txns) external {
bytes32 accHash = keccak256(abi.encode(acc));
require(identity.privileges(address(this)) == accHash, 'WRONG_ACC_OR_NO_PRIV');
uint initialNonce = nonces[address(identity)]++;
// S... | function send(Identity identity, QuickAccount calldata acc, DualSig calldata sigs, Identity.Transaction[] calldata txns) external {
bytes32 accHash = keccak256(abi.encode(acc));
require(identity.privileges(address(this)) == accHash, 'WRONG_ACC_OR_NO_PRIV');
uint initialNonce = nonces[address(identity)]++;
// S... | 85,894 |
84 | // The earnings the fund manager has already cashed out | uint256 public fundManagerCashedOut = 0;
| uint256 public fundManagerCashedOut = 0;
| 7,161 |
221 | // Modify URI | function changeURI(string calldata _newURI) public onlyOwner{
require (URIlocked == false, "URI locked, you can't change it anymore");
newURI = _newURI;
}
| function changeURI(string calldata _newURI) public onlyOwner{
require (URIlocked == false, "URI locked, you can't change it anymore");
newURI = _newURI;
}
| 23,872 |
15 | // Sets the base URI for the Collection metadata. / | function setBaseURI(string memory baseURI) external onlyOwner {
require(bytes(baseURI).length != 0, "baseURI cannot be empty");
_setURI(baseURI);
}
| function setBaseURI(string memory baseURI) external onlyOwner {
require(bytes(baseURI).length != 0, "baseURI cannot be empty");
_setURI(baseURI);
}
| 41,198 |
185 | // a portion of the principal is repaid to the lender out of interest refunded | uint256 loanCloseAmountLessInterest = _settleInterestToPrincipal(
loanLocal,
loanParamsLocal,
loanCloseAmount,
loanLocal.borrower
);
if (loanCloseAmount > loanCloseAmountLessInterest) {
| uint256 loanCloseAmountLessInterest = _settleInterestToPrincipal(
loanLocal,
loanParamsLocal,
loanCloseAmount,
loanLocal.borrower
);
if (loanCloseAmount > loanCloseAmountLessInterest) {
| 40,416 |
56 | // Internal function to burn a specific token. Reverts if the token does not exist.tokenId uint256 ID of the token being burned/ | function _burn(uint256 tokenId) internal {
_burn(ownerOf(tokenId), tokenId);
}
| function _burn(uint256 tokenId) internal {
_burn(ownerOf(tokenId), tokenId);
}
| 85,873 |
98 | // Transfers the ownership of the account to another address.The new owner can be an zero address which means renouncing the ownership. _owner New owner address / | function transferOwnership(address _owner) public {
require(msg.sender == owner, "not owner");
owner = _owner;
}
| function transferOwnership(address _owner) public {
require(msg.sender == owner, "not owner");
owner = _owner;
}
| 34,213 |
306 | // Set the interest rate model to newInterestRateModel | interestRateModel = newInterestRateModel;
| interestRateModel = newInterestRateModel;
| 657 |
132 | // contract is paused | bool public paused;
| bool public paused;
| 22,081 |
22 | // send the remaining balance to client | clientAmount = balance - serviceAmount;
| clientAmount = balance - serviceAmount;
| 12,282 |
113 | // A map from an account owner to an approved transaction hash to if the transaction is approved or not | mapping (address => mapping (bytes32 => bool)) approvedTx;
| mapping (address => mapping (bytes32 => bool)) approvedTx;
| 28,929 |
179 | // let event know a tier 2 prize was won | _eventData_.compressedData += 200000000000000000000000000000000;
| _eventData_.compressedData += 200000000000000000000000000000000;
| 49,844 |
1 | // Sends multiple transactions and reverts all if one fails./transactions Encoded transactions. Each transaction is encoded as a packed bytes of/ operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte),/ to as a address (=> 20 bytes),/ value as a uint256 (=> 32 bytes),/ data length as a uint256 (=> 3... | function multiSend(bytes memory transactions)
public
| function multiSend(bytes memory transactions)
public
| 21,743 |
89 | // Get a user's whitelisted stateuserAddressaddress the wallet address of the user return booltrue if the user is in the whitelist/ | function isWhitelisted (address userAddress) public constant returns (bool isIndeed) {
if (whitelistedIndex.length == 0) return false;
return (whitelistedIndex[whitelisted[userAddress].index] == userAddress);
}
| function isWhitelisted (address userAddress) public constant returns (bool isIndeed) {
if (whitelistedIndex.length == 0) return false;
return (whitelistedIndex[whitelisted[userAddress].index] == userAddress);
}
| 24,120 |
10 | // product not exist or product company != companyId | if (productMap[_productId].productId == 0 || productMap[_productId].companyAddress != msg.sender) revert();
| if (productMap[_productId].productId == 0 || productMap[_productId].companyAddress != msg.sender) revert();
| 42,219 |
49 | // Use in memory variable for everything except when we need to persist data change For gas savings | SellList memory _sale = sales[_sellId];
if (_sale.isSold == true) {
revert ListingAlreadySold();
}
| SellList memory _sale = sales[_sellId];
if (_sale.isSold == true) {
revert ListingAlreadySold();
}
| 4,996 |
466 | // If `account` had not been already granted `role`, emits a {RoleGranted}event. Note that unlike {grantRole}, this function doesn't perform anychecks on the calling account. [WARNING]====This function should only be called from the constructor when settingup the initial roles for the system. Using this function in any... |
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
|
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
| 114 |
10 | // Bonus muliplier for early MobiFi makers. | uint256 public constant BONUS_MULTIPLIER = 1;
| uint256 public constant BONUS_MULTIPLIER = 1;
| 32,731 |
159 | // Tell the forwarder type return Forwarder type/ | function forwarderType() external pure returns (ForwarderType);
| function forwarderType() external pure returns (ForwarderType);
| 8,893 |
28 | // To claim and stake tokens / | function claimAndStake(
uint256 _amount,
bytes32[] memory _proof
| function claimAndStake(
uint256 _amount,
bytes32[] memory _proof
| 12,389 |
75 | // Reference to contract tracking auction state variables | ClockAuctionStorage public clockAuctionStorage;
| ClockAuctionStorage public clockAuctionStorage;
| 36,486 |
0 | // Conjure Finance Team/IEtherCollateral/Interface for interacting with the EtherCollateral Contract | interface IEtherCollateral {
/**
* @dev Sets the assetClosed indicator if loan opening is allowed or not
* Called by the Conjure contract if the asset price reaches 0.
*/
function setAssetClosed(bool) external;
/**
* @dev Gets the assetClosed indicator
*/
function getAssetClosed... | interface IEtherCollateral {
/**
* @dev Sets the assetClosed indicator if loan opening is allowed or not
* Called by the Conjure contract if the asset price reaches 0.
*/
function setAssetClosed(bool) external;
/**
* @dev Gets the assetClosed indicator
*/
function getAssetClosed... | 16,436 |
11 | // Add/change/remove any number of Post-Transfer Hooks/pthCuts Contains Post-Transfer Hooks and if they're being/ added or removed | function pthCut(
SLib.PTHCut_[] calldata pthCuts
| function pthCut(
SLib.PTHCut_[] calldata pthCuts
| 10,116 |
21 | // REMOVE LIQUIDITY | function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
| function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
| 6,019 |
6 | // CyberCash / | contract CyberCash {
address payable private APIOwner;
uint8 private APIOwnerCommision = 2; // percents
mapping(bytes32 => bool) private FPS;
///////////////////////////////////////////////////////////
constructor() public {
APIOwner = msg.sender;
}
function Convert(uint ACurrencyFromI... | contract CyberCash {
address payable private APIOwner;
uint8 private APIOwnerCommision = 2; // percents
mapping(bytes32 => bool) private FPS;
///////////////////////////////////////////////////////////
constructor() public {
APIOwner = msg.sender;
}
function Convert(uint ACurrencyFromI... | 15,489 |
19 | // Returns total number of receivers | function getNumOfReceivers() public view returns(uint){
return receiver_array.length;
}
| function getNumOfReceivers() public view returns(uint){
return receiver_array.length;
}
| 49,896 |
22 | // contract owner royalties | token.transfer(getOwner(), ownerAllocation*(firstSeasonRewards/(numberOfRewards-claimRewardsCount))/100);
| token.transfer(getOwner(), ownerAllocation*(firstSeasonRewards/(numberOfRewards-claimRewardsCount))/100);
| 31,834 |
123 | // event | emit RewardAdded(_token, _epoch, _amount);
| emit RewardAdded(_token, _epoch, _amount);
| 48,619 |
7 | // Grants a role to an account, if not previously granted. Caller must have admin role for the `role`. | * Emits {RoleGranted Event}.
*
* @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
* @param account Address of the account to which the role is being granted.
*/
function grantRole(bytes32 role, address account) public virtual override {
... | * Emits {RoleGranted Event}.
*
* @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
* @param account Address of the account to which the role is being granted.
*/
function grantRole(bytes32 role, address account) public virtual override {
... | 27,601 |
97 | // exclude from fees and max transaction amount | mapping (address => bool) private _isExcludedFromFees;
mapping (address => bool) public _isExcludedMaxTransactionAmount;
| mapping (address => bool) private _isExcludedFromFees;
mapping (address => bool) public _isExcludedMaxTransactionAmount;
| 1,039 |
25 | // Quote should not already have been used | IPoTypes.Po memory poExisting = getPoByQuote(po.quoteId);
require(poExisting.poNumber == 0, "Quote already in use");
| IPoTypes.Po memory poExisting = getPoByQuote(po.quoteId);
require(poExisting.poNumber == 0, "Quote already in use");
| 8,201 |
16 | // ===================================================================== GETTERS =====================================================================// | function getTaskCount() external view returns (uint256) {
return tasks.length;
}
| function getTaskCount() external view returns (uint256) {
return tasks.length;
}
| 45,283 |
80 | // Triggered by the master node once rewards are set and ready to validate | function markRewardsSet(string rewardsHash)
public
onlyCurrentMaster
timedStateTransition
onlyState(EventStates.Running)
| function markRewardsSet(string rewardsHash)
public
onlyCurrentMaster
timedStateTransition
onlyState(EventStates.Running)
| 11,242 |
49 | // the number of wei raised | uint256 private _totalWeiRaised;
| uint256 private _totalWeiRaised;
| 46,731 |
156 | // we void our bonus if they aren&39;t all of the type | if (!allOfSameType[0]) {
cumulativeAttackBonuses[0] = 0;
cumulativeDefenceBonuses[0] = 0;
}
| if (!allOfSameType[0]) {
cumulativeAttackBonuses[0] = 0;
cumulativeDefenceBonuses[0] = 0;
}
| 50,825 |
5 | // Execute the payment -> Exits the function on failure | require(
IERC20(cUsdTokenAddress).transferFrom(
msg.sender,
images[_index].creator,
msg.value
),
"Transfer failed."
);
| require(
IERC20(cUsdTokenAddress).transferFrom(
msg.sender,
images[_index].creator,
msg.value
),
"Transfer failed."
);
| 16,702 |
63 | // if sender is not position manager tax go to contract | if (sender != address(positionManager)) {
_balances[address(this)] += tFee;
} else if (sender == address(positionManager)) {
| if (sender != address(positionManager)) {
_balances[address(this)] += tFee;
} else if (sender == address(positionManager)) {
| 35,336 |
33 | // the shares are based on the dUSDC in the users wallet | function withdrawLP(address user, uint amountShares) internal {
uint strategyBalance = getTokenBalance(address(this)); //18 decimals
uint totalShares = IERC20(address(VAULT)).totalSupply(); //8 decimals
uint withdrawAmount = (strategyBalance / totalShares) * amountShares;
//handle rounding error case on fu... | function withdrawLP(address user, uint amountShares) internal {
uint strategyBalance = getTokenBalance(address(this)); //18 decimals
uint totalShares = IERC20(address(VAULT)).totalSupply(); //8 decimals
uint withdrawAmount = (strategyBalance / totalShares) * amountShares;
//handle rounding error case on fu... | 2,406 |
480 | // Calculate denominator for row 23: x - g^23z. |
let denominator := add(shiftedEvalPoint, mload(add(expmodsAndPoints, 0x4e0)))
mstore(add(productsPtr, 0x280), partialProduct)
mstore(add(valuesPtr, 0x280), denominator)
partialProduct := mulmod(partialProduct, denominator, PRIME)
|
let denominator := add(shiftedEvalPoint, mload(add(expmodsAndPoints, 0x4e0)))
mstore(add(productsPtr, 0x280), partialProduct)
mstore(add(valuesPtr, 0x280), denominator)
partialProduct := mulmod(partialProduct, denominator, PRIME)
| 3,397 |
1 | // 18 months after deposit, user can withdrawal all or part of his/her BBO with bonus. The bonus is this contract's initial BBO balance. | uint public constant WITHDRAWAL_DELAY = 360 days; // = 1 year
| uint public constant WITHDRAWAL_DELAY = 360 days; // = 1 year
| 7,976 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.