Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 380 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Complete Sprint | 21426666 | 53 days ago | IN | 0 ETH | 0.0015672 | ||||
Complete Sprint | 21426662 | 53 days ago | IN | 0 ETH | 0.00166778 | ||||
Complete Sprint | 21426658 | 53 days ago | IN | 0 ETH | 0.0016657 | ||||
Complete Sprint | 21418494 | 54 days ago | IN | 0 ETH | 0.00138777 | ||||
Send Deposit Wit... | 21416799 | 54 days ago | IN | 0 ETH | 0.00306187 | ||||
Send Deposit Wit... | 21338198 | 65 days ago | IN | 0 ETH | 0.00375719 | ||||
Start Project | 21031072 | 108 days ago | IN | 0 ETH | 0.0011085 | ||||
Complete Sprint | 21031068 | 108 days ago | IN | 0 ETH | 0.00126137 | ||||
Complete Sprint | 21031066 | 108 days ago | IN | 0 ETH | 0.00146605 | ||||
Send Deposit Wit... | 20971627 | 117 days ago | IN | 0 ETH | 0.00500714 | ||||
Start Project | 20893982 | 127 days ago | IN | 0 ETH | 0.0008126 | ||||
Complete Sprint | 20873438 | 130 days ago | IN | 0 ETH | 0.00138192 | ||||
Complete Sprint | 20873435 | 130 days ago | IN | 0 ETH | 0.00148147 | ||||
Complete Sprint | 20873432 | 130 days ago | IN | 0 ETH | 0.00139868 | ||||
Complete Sprint | 20873430 | 130 days ago | IN | 0 ETH | 0.00145626 | ||||
Send Deposit Wit... | 20873145 | 130 days ago | IN | 0 ETH | 0.00323432 | ||||
Complete Sprint | 20856334 | 133 days ago | IN | 0 ETH | 0.00133073 | ||||
Send Deposit Wit... | 20835533 | 136 days ago | IN | 0 ETH | 0.00397235 | ||||
Start Project | 20830543 | 136 days ago | IN | 0 ETH | 0.00206342 | ||||
Complete Sprint | 20671693 | 158 days ago | IN | 0 ETH | 0.00027532 | ||||
Complete Sprint | 20671690 | 158 days ago | IN | 0 ETH | 0.00027231 | ||||
Complete Sprint | 20671688 | 158 days ago | IN | 0 ETH | 0.0002853 | ||||
Complete Sprint | 20671685 | 158 days ago | IN | 0 ETH | 0.00027811 | ||||
Complete Sprint | 20671681 | 158 days ago | IN | 0 ETH | 0.00026662 | ||||
Complete Sprint | 20671678 | 158 days ago | IN | 0 ETH | 0.00027813 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
IndieBrokerV1
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; import "openzeppelin-contracts/utils/cryptography/ECDSA.sol"; import "openzeppelin-contracts/utils/cryptography/EIP712.sol"; import "openzeppelin-contracts/access/Ownable.sol"; import "openzeppelin-contracts/security/Pausable.sol"; import "openzeppelin-contracts/security/ReentrancyGuard.sol"; import "./IUSDC.sol"; /** * @title IndieBrokerV1 * @author IndieDAO * @notice The Indie Protocol contract */ contract IndieBrokerV1 is EIP712, Ownable, Pausable, ReentrancyGuard { struct Project { uint256 projectId; address leadAddress; address clientAddress; address salesAddress; } struct SprintPayments { uint256 totalAmount; uint256 totalTreasuryAmount; uint256 totalCashVestingAmount; uint256 totalLeadAmount; uint256 totalSalesAmount; uint256[] payeeAmounts; uint256[] treasuryAmounts; uint256[] leadAmounts; uint256[] salesAmounts; uint256[] cashVestingAmounts; } error ExceededMaxFees(); error ZeroAddress(); error InvalidFee(); error FeeTooLow(); error FeeTooHigh(); error NotAuthorized(); error PayeeAmountMismatch(); error SprintAlreadyCompleted(); error InvalidClientSignature(); error ProjectAlreadyExists(); error ProjectNotFound(); error InvalidProjectId(); error InvalidSprintId(); error LeadNotOnAllowList(); error InsufficientBalance(); event StartProject( uint256 indexed projectId, address indexed leadAddress, address indexed clientAddress, address salesAddress ); event CompleteProjectSprint(uint256 indexed projectId, uint256 indexed sprintId, uint256 totalAmount); event SendDeposit(uint256 indexed projectId, address indexed sender, uint256 amount); event DistributePayment( address indexed payee, uint256 indexed projectId, uint256 totalAmount, uint256 payeeAmount, uint256 treasuryAmount, uint256 leadAmount, uint256 salesAmount, uint256 cashVestingAmount ); event SetFee(Fees indexed f, uint256 fee); event SetFeeRecipient(Fees indexed f, address recipient); event ReassignProjectLead(uint256 indexed projectId, address newLeadAddress); event ReassignProjectSales(uint256 indexed projectId, address newSalesAddress); event ReassignProjectClient(uint256 indexed projectId, address newClientAddress); event SetIndividualTreasuryFee(address indexed addr, uint256 fee); event SetMinMaxIndividualTreasuryFees(uint256 minFee, uint256 maxFee); event SetAllowedLead(address indexed addr, bool allowed); event WithdrawFromProject(uint256 indexed projectId, uint256 amount, address indexed recipient); enum Fees { Treasury, Sales, Lead, CashVesting } /** * @notice Mapping of project IDs to project structs */ mapping(uint256 => Project) public projects; /** * @notice Mapping of project IDs to project balances * @dev projectId => USDC balance */ mapping(uint256 => uint256) public projectBalances; /** * @notice Mapping of project/sprint tuples to project sprint completion status * @dev projectId => sprintId => completed */ mapping(uint256 => mapping(uint256 => bool)) public completedSprints; /** * @notice Mapping of fee types to fee percentages * @dev Fees => fee percentage */ mapping(Fees => uint256) public fees; /** * @notice Mapping of fee types to fee recipients * @dev Fees => fee recipient address */ mapping(Fees => address) public feeRecipients; /** * @notice Mapping of individual treasury fees * @dev address => fee percentage */ mapping(address => uint256) public individualTreasuryFees; /** * @notice Mapping of allowed leads * @dev address => allowed */ mapping(address => bool) public allowedLeads; /** * @notice Reference to the USDC contract */ IUSDC public usdc; /** * @notice The minimum possible individual treasury fee */ uint256 public minIndividualTreasuryFee = 20_00; // 20% /** * @notice The maximum possible individual treasury fee */ uint256 public maxIndividualTreasuryFee = 20_00; // 20% uint256 internal constant MAX_FEES = 100_00; // The sum of fees cannot exceed 100% uint256 internal constant FEE_DENOMINATOR = 100_00; /** * @notice Constructor * @param usdc_ The USDC contract address * @param treasuryAddress_ The treasury address * @param cashVestingAddress_ The cash vesting address */ constructor(IUSDC usdc_, address treasuryAddress_, address cashVestingAddress_) EIP712("IndieBroker", "1") { usdc = usdc_; feeRecipients[Fees.Treasury] = treasuryAddress_; feeRecipients[Fees.CashVesting] = cashVestingAddress_; fees[Fees.Treasury] = 20_00; // 20% fees[Fees.Lead] = 10_00; // 10% fees[Fees.Sales] = 10_00; // 10% fees[Fees.CashVesting] = 5_00; // 5% } /** * @notice Starts a project * @param projectId The reference project identifier from the off-chain Indie Protocol database * @param leadAddress The project lead address * @param clientAddress The project client address * @param salesAddress The project sales referrer address */ function startProject(uint256 projectId, address leadAddress, address clientAddress, address salesAddress) external whenNotPaused nonReentrant { if (projectId == 0) { revert InvalidProjectId(); } if (leadAddress == address(0)) { revert ZeroAddress(); } if (clientAddress == address(0)) { revert ZeroAddress(); } if (salesAddress == address(0)) { revert ZeroAddress(); } if (msg.sender != leadAddress) { revert NotAuthorized(); } if (!allowedLeads[leadAddress]) { revert LeadNotOnAllowList(); } if (projects[projectId].projectId != 0) { revert ProjectAlreadyExists(); } projects[projectId] = Project(projectId, leadAddress, clientAddress, salesAddress); emit StartProject(projectId, leadAddress, clientAddress, salesAddress); } /** * @notice Sends a deposit to the Indie Protocol contract for a specific project * @dev See USDC contract `receiveWithAuthorization` function for more details * @param projectId The reference project identifier from the off-chain Indie Protocol database * @param from The address to transfer the USDC from * @param amount The amount of USDC to transfer * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce A unique nonce * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function sendDepositWithAuthorization( uint256 projectId, address from, uint256 amount, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) external whenNotPaused nonReentrant { _sendDeposit(projectId, from, amount); usdc.receiveWithAuthorization(from, address(this), amount, validAfter, validBefore, nonce, v, r, s); } /** * @notice Sends a deposit to the Indie Protocol contract for a specific project * @dev See USDC contract `transferFrom` function for more details * @param projectId The reference project identifier from the off-chain Indie Protocol database * @param from The address to transfer the USDC from * @param amount The amount of USDC to transfer */ function sendDeposit(uint256 projectId, address from, uint256 amount) external whenNotPaused nonReentrant { _sendDeposit(projectId, from, amount); usdc.transferFrom(from, address(this), amount); } /** * @notice Calculates payment amounts given a set of payees and amounts * @param payees The addresses of the payees * @param amounts The amounts of USDC expected to be distributed for each payee * @return sprintPayments The calculated sprint payments (see `SprintPayments` struct) */ function calculateSprintPayments(address[] calldata payees, uint256[] calldata amounts) public view returns (SprintPayments memory sprintPayments) { sprintPayments = SprintPayments( 0, // totalAmount 0, // totalTreasuryAmount 0, // totalCashVestingAmount 0, // totalLeadAmount 0, // totalSalesAmount new uint256[](payees.length), // payeeAmounts new uint256[](payees.length), // treasuryAmounts new uint256[](payees.length), // leadAmounts new uint256[](payees.length), // salesAmounts new uint256[](payees.length) // cashVestingAmounts ); uint256 payeeAmount; uint256 treasuryAmount; uint256 leadAmount; uint256 salesAmount; uint256 cashVestingAmount; for (uint256 i = 0; i < payees.length;) { sprintPayments.totalAmount += amounts[i]; (payeeAmount, treasuryAmount, leadAmount, salesAmount, cashVestingAmount) = calculatePayment(payees[i], amounts[i]); sprintPayments.totalTreasuryAmount += treasuryAmount; sprintPayments.totalLeadAmount += leadAmount; sprintPayments.totalSalesAmount += salesAmount; sprintPayments.totalCashVestingAmount += cashVestingAmount; sprintPayments.payeeAmounts[i] = payeeAmount; sprintPayments.treasuryAmounts[i] = treasuryAmount; sprintPayments.leadAmounts[i] = leadAmount; sprintPayments.salesAmounts[i] = salesAmount; sprintPayments.cashVestingAmounts[i] = cashVestingAmount; unchecked { i++; } } } /** * @notice Calculates payment distributions given a payee and amount * @param payee The address of the payee * @param amount The amount of USDC expected to be distributed * @return payeeAmount The amount of USDC expected to be distributed to the payee after rewards are deducted * @return treasuryAmount The amount of USDC expected to be distributed to the treasury * @return leadAmount The amount of USDC expected to be distributed to the project lead (only includes the lead reward) * @return salesAmount The amount of USDC expected to be distributed to the project sales referrer * @return cashVestingAmount The amount of USDC expected to be distributed to the cash vesting address */ function calculatePayment(address payee, uint256 amount) public view returns ( uint256 payeeAmount, uint256 treasuryAmount, uint256 leadAmount, uint256 salesAmount, uint256 cashVestingAmount ) { uint256 treasuryFee = _getTreasuryFeeForIndividual(payee); treasuryAmount = (amount * treasuryFee) / FEE_DENOMINATOR; leadAmount = (amount * fees[Fees.Lead]) / FEE_DENOMINATOR; salesAmount = (amount * fees[Fees.Sales]) / FEE_DENOMINATOR; cashVestingAmount = (amount * fees[Fees.CashVesting]) / FEE_DENOMINATOR; payeeAmount = amount - treasuryAmount - leadAmount - salesAmount - cashVestingAmount; } /** * @notice Completes a sprint and distributes the funds to the payees and reward recipients * @param projectId The reference project identifier from the off-chain Indie Protocol database * @param sprintId The reference sprint identifier from the off-chain Indie Protocol database * @param payees The addresses of the payees * @param amounts The amounts of USDC expected to be distributed for each payee * @param v The recovery byte of the client's acceptance signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function completeSprint( uint256 projectId, uint256 sprintId, address[] calldata payees, uint256[] calldata amounts, uint8 v, bytes32 r, bytes32 s ) external whenNotPaused nonReentrant { if (sprintId == 0) { revert InvalidSprintId(); } if (payees.length != amounts.length) { revert PayeeAmountMismatch(); } if (completedSprints[projectId][sprintId]) { revert SprintAlreadyCompleted(); } Project memory project = projects[projectId]; if (msg.sender != project.leadAddress) { revert NotAuthorized(); } SprintPayments memory sprintPayments = calculateSprintPayments(payees, amounts); bytes32 structHash = keccak256( abi.encode( keccak256("CompleteSprint(uint256 projectId,uint256 sprintId,uint256 totalAmount)"), projectId, sprintId, sprintPayments.totalAmount ) ); bytes32 digest = _hashTypedDataV4(structHash); if (!_verifySignature(digest, v, r, s, project.clientAddress)) { revert InvalidClientSignature(); } for (uint256 i = 0; i < sprintPayments.payeeAmounts.length;) { if (payees[i] == address(0)) { revert ZeroAddress(); } emit DistributePayment( payees[i], projectId, amounts[i], sprintPayments.payeeAmounts[i], sprintPayments.treasuryAmounts[i], sprintPayments.leadAmounts[i], sprintPayments.salesAmounts[i], sprintPayments.cashVestingAmounts[i] ); if (sprintPayments.payeeAmounts[i] > 0) { usdc.transfer(payees[i], sprintPayments.payeeAmounts[i]); } unchecked { i++; } } if (sprintPayments.totalTreasuryAmount > 0) { usdc.transfer(feeRecipients[Fees.Treasury], sprintPayments.totalTreasuryAmount); } if (sprintPayments.totalCashVestingAmount > 0) { usdc.transfer(feeRecipients[Fees.CashVesting], sprintPayments.totalCashVestingAmount); } if (sprintPayments.totalLeadAmount > 0) { usdc.transfer(project.leadAddress, sprintPayments.totalLeadAmount); } if (sprintPayments.totalSalesAmount > 0) { usdc.transfer(project.salesAddress, sprintPayments.totalSalesAmount); } projectBalances[projectId] -= sprintPayments.totalAmount; completedSprints[projectId][sprintId] = true; emit CompleteProjectSprint(projectId, sprintId, sprintPayments.totalAmount); } /** * @notice Sets the fee for an individual payee address * @param addr The address of the payee * @param fee The fee to be set where the value has a denominator of 10000 (e.g. `500` yields a 5% fee). See `minIndividualTreasuryFee` and `maxIndividualTreasuryFee` for limits. */ function setIndividualTreasuryFee(address addr, uint256 fee) external { if (addr != msg.sender) { revert NotAuthorized(); } if (fee < minIndividualTreasuryFee) { revert FeeTooLow(); } if (fee > maxIndividualTreasuryFee) { revert FeeTooHigh(); } individualTreasuryFees[addr] = fee; emit SetIndividualTreasuryFee(addr, fee); } /** * @notice Sets the fee for a given fee type * @param f The fee type to be set * @param fee The fee to be set where the value has a denominator of 10000 (e.g. `500` yields a 5% fee) */ function setFee(Fees f, uint256 fee) external onlyOwner { fees[f] = fee; // Ensure the sum of all possible fees does not exceed the max possible // Must account for the possibility of an individual maxing out their invididual treasury fee uint256 maxTreasuryFee = Math.max(fees[Fees.Treasury], maxIndividualTreasuryFee); if (maxTreasuryFee + fees[Fees.Lead] + fees[Fees.Sales] + fees[Fees.CashVesting] > MAX_FEES) { revert ExceededMaxFees(); } emit SetFee(f, fee); } /** * @notice Sets the fee recipient for a given fee type * @param f The fee type to be set must be Treasury or CashVesting * @param recipient The address of the recipient */ function setFeeRecipient(Fees f, address recipient) external onlyOwner { if (recipient == address(0)) { revert ZeroAddress(); } if (f != Fees.Treasury && f != Fees.CashVesting) { revert InvalidFee(); } feeRecipients[f] = recipient; emit SetFeeRecipient(f, recipient); } /** * @notice Sets the minimum and maximum individual treasury fees * @param minFee The minimum fee to be set where the value has a denominator of 10000 (e.g. `500` yields a 5% fee) * @param maxFee The maximum fee to be set where the value has a denominator of 10000 (e.g. `500` yields a 5% fee) */ function setMinMaxIndividualTreasuryFees(uint256 minFee, uint256 maxFee) external onlyOwner { if (minFee < 0) { revert FeeTooLow(); } if (minFee > maxFee) { revert FeeTooHigh(); } // Max individual fee plus all other (non-treasury) fees cannot exceed max fees if (maxFee + fees[Fees.Lead] + fees[Fees.Sales] + fees[Fees.CashVesting] > MAX_FEES) { revert ExceededMaxFees(); } minIndividualTreasuryFee = minFee; maxIndividualTreasuryFee = maxFee; emit SetMinMaxIndividualTreasuryFees(minFee, maxFee); } /** * @notice Reassigns the project lead for a project. Can only be called by the current project lead or the contract owner. * @param projectId The reference project identifier from the off-chain Indie Protocol database * @param newLeadAddress The address of the new project lead */ function reassignProjectLead(uint256 projectId, address newLeadAddress) external { if (newLeadAddress == address(0)) { revert ZeroAddress(); } if (!allowedLeads[newLeadAddress]) { revert LeadNotOnAllowList(); } Project memory project = projects[projectId]; if (project.projectId == 0) { revert ProjectNotFound(); } if (msg.sender != project.leadAddress && msg.sender != owner()) { revert NotAuthorized(); } projects[projectId].leadAddress = newLeadAddress; emit ReassignProjectLead(projectId, newLeadAddress); } /** * @notice Reassigns the project sales referrer for a project. Can only be called by the current project sales referrer or the contract owner. * @param projectId The reference project identifier from the off-chain Indie Protocol database * @param newSalesAddress The address of the new project sales referrer */ function reassignProjectSales(uint256 projectId, address newSalesAddress) external { if (newSalesAddress == address(0)) { revert ZeroAddress(); } Project memory project = projects[projectId]; if (project.projectId == 0) { revert ProjectNotFound(); } if (msg.sender != project.salesAddress && msg.sender != owner()) { revert NotAuthorized(); } projects[projectId].salesAddress = newSalesAddress; emit ReassignProjectSales(projectId, newSalesAddress); } /** * @notice Reassigns the project client for a project. Can only be called by the current project lead, client or the contract owner. * @param projectId The reference project identifier from the off-chain Indie Protocol database * @param newClientAddress The address of the new project client */ function reassignProjectClient(uint256 projectId, address newClientAddress) external { if (newClientAddress == address(0)) { revert ZeroAddress(); } Project memory project = projects[projectId]; if (project.projectId == 0) { revert ProjectNotFound(); } if (msg.sender != project.clientAddress && msg.sender != project.leadAddress && msg.sender != owner()) { revert NotAuthorized(); } projects[projectId].clientAddress = newClientAddress; emit ReassignProjectClient(projectId, newClientAddress); } /** * @notice Enables/disables an address from being a project lead and being able to create projects * @param addr The address of the individual * @param allowed Whether or not the address is allowed to be a project lead */ function setAllowedLead(address addr, bool allowed) external onlyOwner { if (addr == address(0)) { revert ZeroAddress(); } allowedLeads[addr] = allowed; emit SetAllowedLead(addr, allowed); } /** * @notice Withdraws funds from a project's balance * @param projectId The reference project identifier from the off-chain Indie Protocol database * @param amount The amount to withdraw * @param recipient The address to send the funds to */ function withdrawFromProject(uint256 projectId, uint256 amount, address recipient) external onlyOwner nonReentrant { if (recipient == address(0)) { revert ZeroAddress(); } if (projectBalances[projectId] < amount) { revert InsufficientBalance(); } projectBalances[projectId] -= amount; usdc.transfer(recipient, amount); emit WithdrawFromProject(projectId, amount, recipient); } /** * @notice Pauses the contract */ function pause() external onlyOwner { _pause(); } /** * @notice Unpauses the contract */ function unpause() external onlyOwner { _unpause(); } function _verifySignature(bytes32 digest, uint8 v, bytes32 r, bytes32 s, address signerAddress) internal pure returns (bool) { (address signedHashAddress, ECDSA.RecoverError error) = ECDSA.tryRecover(digest, v, r, s); return error == ECDSA.RecoverError.NoError && signedHashAddress == signerAddress; } function _getTreasuryFeeForIndividual(address addr) internal view returns (uint256) { return individualTreasuryFees[addr] == 0 ? fees[Fees.Treasury] : individualTreasuryFees[addr]; } function _sendDeposit(uint256 projectId, address from, uint256 amount) internal { if (projects[projectId].projectId == 0) { revert ProjectNotFound(); } projectBalances[projectId] += amount; emit SendDeposit(projectId, from, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; import "openzeppelin-contracts/token/ERC20/IERC20.sol"; interface IUSDC is IERC20 { function receiveWithAuthorization( address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) external; }
{ "remappings": [ "ds-test/=contracts/lib/forge-std/lib/ds-test/src/", "forge-std/=contracts/lib/forge-std/src/", "openzeppelin-contracts/=contracts/lib/openzeppelin-contracts/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IUSDC","name":"usdc_","type":"address"},{"internalType":"address","name":"treasuryAddress_","type":"address"},{"internalType":"address","name":"cashVestingAddress_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ExceededMaxFees","type":"error"},{"inputs":[],"name":"FeeTooHigh","type":"error"},{"inputs":[],"name":"FeeTooLow","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidClientSignature","type":"error"},{"inputs":[],"name":"InvalidFee","type":"error"},{"inputs":[],"name":"InvalidProjectId","type":"error"},{"inputs":[],"name":"InvalidSprintId","type":"error"},{"inputs":[],"name":"LeadNotOnAllowList","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"PayeeAmountMismatch","type":"error"},{"inputs":[],"name":"ProjectAlreadyExists","type":"error"},{"inputs":[],"name":"ProjectNotFound","type":"error"},{"inputs":[],"name":"SprintAlreadyCompleted","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"sprintId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"CompleteProjectSprint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"payeeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"leadAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"salesAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cashVestingAmount","type":"uint256"}],"name":"DistributePayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"address","name":"newClientAddress","type":"address"}],"name":"ReassignProjectClient","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"address","name":"newLeadAddress","type":"address"}],"name":"ReassignProjectLead","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"address","name":"newSalesAddress","type":"address"}],"name":"ReassignProjectSales","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SendDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"SetAllowedLead","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"enum IndieBrokerV1.Fees","name":"f","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"enum IndieBrokerV1.Fees","name":"f","type":"uint8"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"SetFeeRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetIndividualTreasuryFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxFee","type":"uint256"}],"name":"SetMinMaxIndividualTreasuryFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":true,"internalType":"address","name":"leadAddress","type":"address"},{"indexed":true,"internalType":"address","name":"clientAddress","type":"address"},{"indexed":false,"internalType":"address","name":"salesAddress","type":"address"}],"name":"StartProject","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"WithdrawFromProject","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowedLeads","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculatePayment","outputs":[{"internalType":"uint256","name":"payeeAmount","type":"uint256"},{"internalType":"uint256","name":"treasuryAmount","type":"uint256"},{"internalType":"uint256","name":"leadAmount","type":"uint256"},{"internalType":"uint256","name":"salesAmount","type":"uint256"},{"internalType":"uint256","name":"cashVestingAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"calculateSprintPayments","outputs":[{"components":[{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"totalTreasuryAmount","type":"uint256"},{"internalType":"uint256","name":"totalCashVestingAmount","type":"uint256"},{"internalType":"uint256","name":"totalLeadAmount","type":"uint256"},{"internalType":"uint256","name":"totalSalesAmount","type":"uint256"},{"internalType":"uint256[]","name":"payeeAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"treasuryAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"leadAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"salesAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"cashVestingAmounts","type":"uint256[]"}],"internalType":"struct IndieBrokerV1.SprintPayments","name":"sprintPayments","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"uint256","name":"sprintId","type":"uint256"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"completeSprint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"completedSprints","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum IndieBrokerV1.Fees","name":"","type":"uint8"}],"name":"feeRecipients","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum IndieBrokerV1.Fees","name":"","type":"uint8"}],"name":"fees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"individualTreasuryFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxIndividualTreasuryFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minIndividualTreasuryFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"projectBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"projects","outputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address","name":"leadAddress","type":"address"},{"internalType":"address","name":"clientAddress","type":"address"},{"internalType":"address","name":"salesAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address","name":"newClientAddress","type":"address"}],"name":"reassignProjectClient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address","name":"newLeadAddress","type":"address"}],"name":"reassignProjectLead","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address","name":"newSalesAddress","type":"address"}],"name":"reassignProjectSales","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sendDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"validAfter","type":"uint256"},{"internalType":"uint256","name":"validBefore","type":"uint256"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"sendDepositWithAuthorization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"setAllowedLead","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IndieBrokerV1.Fees","name":"f","type":"uint8"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IndieBrokerV1.Fees","name":"f","type":"uint8"},{"internalType":"address","name":"recipient","type":"address"}],"name":"setFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setIndividualTreasuryFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minFee","type":"uint256"},{"internalType":"uint256","name":"maxFee","type":"uint256"}],"name":"setMinMaxIndividualTreasuryFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"address","name":"leadAddress","type":"address"},{"internalType":"address","name":"clientAddress","type":"address"},{"internalType":"address","name":"salesAddress","type":"address"}],"name":"startProject","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdc","outputs":[{"internalType":"contract IUSDC","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"withdrawFromProject","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101406040526107d0600a556107d0600b553480156200001e57600080fd5b5060405162002fa638038062002fa68339810160408190526200004191620002dd565b604080518082018252600b81526a24b73234b2a13937b5b2b960a91b6020808301918252835180850190945260018452603160f81b908401528151902060e08190527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66101008190524660a0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620001228184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6080523060c05261012052506200014592506200013f9150503390565b62000274565b6000805460ff60a01b1916815560018055600980546001600160a01b039586166001600160a01b0319918216179091557f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f88054948616948216949094179093557f75f96ab15d697e93042dc45b5c896c4b27e89bb6eaf39475c5c371cb2513f7d280549093169190931617905560056020526107d07f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc556103e87f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a8190557f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b55600390526101f47fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc05562000331565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620002da57600080fd5b50565b600080600060608486031215620002f357600080fd5b83516200030081620002c4565b60208501519093506200031381620002c4565b60408501519092506200032681620002c4565b809150509250925092565b60805160a05160c05160e0516101005161012051612c25620003816000396000612492015260006124e1015260006124bc015260006124150152600061243f015260006124690152612c256000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80636f09d07f1161010f57806399cf3049116100a2578063ee207b9511610071578063ee207b95146104d4578063f2fde38b146104f4578063f4620a1114610507578063fea868131461052757600080fd5b806399cf304914610488578063bf4390981461049b578063d4f5f83b146104ae578063d968edac146104c157600080fd5b806387ea9915116100de57806387ea99151461043e5780638c6aa3f5146104515780638da5cb5b14610464578063999fb6ec1461047557600080fd5b80636f09d07f14610412578063715018a61461042557806380024af81461042d5780638456cb591461043657600080fd5b80633a75f9d5116101875780634cd33dff116101565780634cd33dff1461038f5780635c975abb146103b25780636202834f146103c45780636be377d1146103ff57600080fd5b80633a75f9d51461032a5780633e413bee1461036b5780633f4ba83a1461037e57806345d89b951461038657600080fd5b80631b1967ce116101c35780631b1967ce146102a65780631c700236146102e45780632a24c9ae146102f7578063357c13541461030a57600080fd5b80630f746323146101ea578063107046bd146101ff5780631442454814610278575b600080fd5b6101fd6101f836600461260f565b61053a565b005b61024461020d36600461263b565b6002602081905260009182526040909120805460018201549282015460039092015490926001600160a01b03908116928116911684565b604080519485526001600160a01b039384166020860152918316918401919091521660608201526080015b60405180910390f35b610298610286366004612654565b60076020526000908152604090205481565b60405190815260200161026f565b6102d46102b436600461266f565b600460209081526000928352604080842090915290825290205460ff1681565b604051901515815260200161026f565b6101fd6102f236600461260f565b6106bf565b6101fd610305366004612691565b610824565b6102986103183660046126ca565b60056020526000908152604090205481565b6103536103383660046126ca565b6006602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161026f565b600954610353906001600160a01b031681565b6101fd6108ec565b610298600b5481565b6102d461039d366004612654565b60086020526000908152604090205460ff1681565b600054600160a01b900460ff166102d4565b6103d76103d2366004612691565b6108fe565b604080519586526020860194909452928401919091526060830152608082015260a00161026f565b6101fd61040d36600461260f565b610a38565b6101fd6104203660046126e5565b610b7b565b6101fd610c22565b610298600a5481565b6101fd610c34565b6101fd61044c36600461271a565b610c44565b6101fd61045f36600461274f565b610d92565b6000546001600160a01b0316610353565b6101fd61048336600461277c565b610f05565b6101fd61049636600461266f565b610fce565b6101fd6104a93660046127f3565b6110f1565b6101fd6104bc366004612840565b6112f2565b6101fd6104cf3660046128b6565b611418565b6102986104e236600461263b565b60036020526000908152604090205481565b6101fd610502366004612654565b611b68565b61051a61051536600461295c565b611be6565b60405161026f9190612a03565b6101fd610535366004612ae4565b611f8b565b6001600160a01b0381166105615760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03811660009081526008602052604090205460ff1661059a57604051639f022a6b60e01b815260040160405180910390fd5b60008281526002602081815260408084208151608081018352815480825260018301546001600160a01b039081169583019590955294820154841692810192909252600301549091166060820152910361060757604051632627b46560e11b815260040160405180910390fd5b80602001516001600160a01b0316336001600160a01b03161415801561063857506000546001600160a01b03163314155b156106565760405163ea8e4eb560e01b815260040160405180910390fd5b60008381526002602090815260409182902060010180546001600160a01b0319166001600160a01b038616908117909155915191825284917ff5ed10b48c58392a4ea07a207195834da8e9497f6f465c22824ded644ee896b691015b60405180910390a2505050565b6001600160a01b0381166106e65760405163d92e233d60e01b815260040160405180910390fd5b60008281526002602081815260408084208151608081018352815480825260018301546001600160a01b039081169583019590955294820154841692810192909252600301549091166060820152910361075357604051632627b46560e11b815260040160405180910390fd5b80604001516001600160a01b0316336001600160a01b03161415801561078f575080602001516001600160a01b0316336001600160a01b031614155b80156107a657506000546001600160a01b03163314155b156107c45760405163ea8e4eb560e01b815260040160405180910390fd5b60008381526002602081815260409283902090910180546001600160a01b0319166001600160a01b038616908117909155915191825284917f7b54b20d47827c99258c332394149a48212c457399de3e483fa1be178834a6a191016106b2565b6001600160a01b038216331461084d5760405163ea8e4eb560e01b815260040160405180910390fd5b600a548110156108705760405163732f941360e01b815260040160405180910390fd5b600b548111156108935760405163cd4e616760e01b815260040160405180910390fd5b6001600160a01b03821660008181526007602052604090819020839055517fb477f99762829001b02cd5afbb50828c60f474e4b38afc9df24a68fb9aec40c8906108e09084815260200190565b60405180910390a25050565b6108f4612012565b6108fc61206c565b565b600080600080600080610910886120c1565b905061271061091f8289612b31565b6109299190612b48565b600260005260056020527f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a54909550612710906109669089612b31565b6109709190612b48565b600160005260056020527f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b54909450612710906109ad9089612b31565b6109b79190612b48565b600360005260056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc054909350612710906109f49089612b31565b6109fe9190612b48565b9150818385610a0d888b612b80565b610a179190612b80565b610a219190612b80565b610a2b9190612b80565b9550509295509295909350565b6001600160a01b038116610a5f5760405163d92e233d60e01b815260040160405180910390fd5b60008281526002602081815260408084208151608081018352815480825260018301546001600160a01b0390811695830195909552948201548416928101929092526003015490911660608201529103610acc57604051632627b46560e11b815260040160405180910390fd5b80606001516001600160a01b0316336001600160a01b031614158015610afd57506000546001600160a01b03163314155b15610b1b5760405163ea8e4eb560e01b815260040160405180910390fd5b60008381526002602090815260409182902060030180546001600160a01b0319166001600160a01b038616908117909155915191825284917f96486a54feef09628614d2fadacdb468819983681e47c62ee6ca8a7e5e7f649191016106b2565b610b8361212f565b610b8b61217c565b610b968383836121d5565b6009546040516323b872dd60e01b81526001600160a01b03848116600483015230602483015260448201849052909116906323b872dd906064016020604051808303816000875af1158015610bef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c139190612b93565b50610c1d60018055565b505050565b610c2a612012565b6108fc600061226b565b610c3c612012565b6108fc6122bb565b610c4c612012565b610c5461217c565b6001600160a01b038116610c7b5760405163d92e233d60e01b815260040160405180910390fd5b600083815260036020526040902054821115610caa57604051631e9acf1760e31b815260040160405180910390fd5b60008381526003602052604081208054849290610cc8908490612b80565b909155505060095460405163a9059cbb60e01b81526001600160a01b038381166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af1158015610d20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d449190612b93565b50806001600160a01b0316837fb1a47149fb1b958647a4cc00d6adbdc4fe1b0981dbe185a952c5c191fa420a3884604051610d8191815260200190565b60405180910390a3610c1d60018055565b610d9a612012565b8060056000846003811115610db157610db1612b6a565b6003811115610dc257610dc2612b6a565b8152602080820192909252604001600090812092909255818052600590527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc54600b54610e0f91906122fe565b60056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc0547f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b5460026000527f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a5492935061271092610e909085612bb0565b610e9a9190612bb0565b610ea49190612bb0565b1115610ec35760405163597a902960e11b815260040160405180910390fd5b826003811115610ed557610ed5612b6a565b6040518381527fa7eb1a94cc3e2fa58da62f449380025f163b7648f0754617e0e186781ae82ef2906020016106b2565b610f0d61212f565b610f1561217c565b610f208989896121d5565b6009546040516377aadf6360e11b81526001600160a01b038a81166004830152306024830152604482018a9052606482018990526084820188905260a4820187905260ff861660c483015260e4820185905261010482018490529091169063ef55bec69061012401600060405180830381600087803b158015610fa257600080fd5b505af1158015610fb6573d6000803e3d6000fd5b50505050610fc360018055565b505050505050505050565b610fd6612012565b80821115610ff75760405163cd4e616760e01b815260040160405180910390fd5b60056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc0547f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b5460026000527f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a546127109291906110779085612bb0565b6110819190612bb0565b61108b9190612bb0565b11156110aa5760405163597a902960e11b815260040160405180910390fd5b600a829055600b81905560408051838152602081018390527f7013d42e1cb4362b60b45337d1357208bfea803e9c8a697bab0429b32bd17989910160405180910390a15050565b6110f961212f565b61110161217c565b8360000361112257604051632af342d760e21b815260040160405180910390fd5b6001600160a01b0383166111495760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382166111705760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0381166111975760405163d92e233d60e01b815260040160405180910390fd5b336001600160a01b038416146111c05760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b03831660009081526008602052604090205460ff166111f957604051639f022a6b60e01b815260040160405180910390fd5b6000848152600260205260409020541561122657604051632d8306b960e21b815260040160405180910390fd5b604080516080810182528581526001600160a01b0385811660208084018281528784168587018181528886166060880181815260008e81526002808852908b902099518a55945160018a018054918a166001600160a01b03199283161790559251948901805495891695841695909517909455925160039097018054979096169616959095179093559351918252919287917ff3a683cd649b0cb84a07ae370671145c6227d109805ece1f98ce3197ef1ad4a1910160405180910390a46112ec60018055565b50505050565b6112fa612012565b6001600160a01b0381166113215760405163d92e233d60e01b815260040160405180910390fd5b600082600381111561133557611335612b6a565b141580156113555750600382600381111561135257611352612b6a565b14155b15611373576040516358d620b360e01b815260040160405180910390fd5b806006600084600381111561138a5761138a612b6a565b600381111561139b5761139b612b6a565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160038111156113df576113df612b6a565b6040516001600160a01b03831681527fa431c021cf006627dcdfb8a50687f4bba78d512d59ad5069410a6f3158ccba4f906020016108e0565b61142061212f565b61142861217c565b876000036114495760405163298fcc9760e01b815260040160405180910390fd5b8584146114695760405163575d219360e11b815260040160405180910390fd5b60008981526004602090815260408083208b845290915290205460ff16156114a457604051638be1900960e01b815260040160405180910390fd5b60008981526002602081815260409283902083516080810185528154815260018201546001600160a01b039081169382018490529382015484169481019490945260030154909116606083015233146115105760405163ea8e4eb560e01b815260040160405180910390fd5b600061151e89898989611be6565b8051604080517ffffb2b049cd2abbfc87fae4c8825d7e55adc048c4703e2aa70d62d8447dfc3e860208201529081018e9052606081018d9052608081019190915290915060009060a001604051602081830303815290604052805190602001209050600061158b82612316565b905061159e818888888860400151612364565b6115bb5760405163dfd8f8f160e01b815260040160405180910390fd5b60005b8360a001515181101561184a5760008c8c838181106115df576115df612bc3565b90506020020160208101906115f49190612654565b6001600160a01b03160361161b5760405163d92e233d60e01b815260040160405180910390fd5b8d8c8c8381811061162e5761162e612bc3565b90506020020160208101906116439190612654565b6001600160a01b03167f7a860f98c77c3c309b5f9248e11bf8df30907d213ef0c86bc7b3efae33139ddf8c8c8581811061167f5761167f612bc3565b905060200201358760a00151858151811061169c5761169c612bc3565b60200260200101518860c0015186815181106116ba576116ba612bc3565b60200260200101518960e0015187815181106116d8576116d8612bc3565b60200260200101518a610100015188815181106116f7576116f7612bc3565b60200260200101518b6101200151898151811061171657611716612bc3565b60209081029190910181015160408051978852918701959095528501929092526060840152608083015260a082015260c00160405180910390a360008460a00151828151811061176857611768612bc3565b60200260200101511115611842576009546001600160a01b031663a9059cbb8d8d8481811061179957611799612bc3565b90506020020160208101906117ae9190612654565b8660a0015184815181106117c4576117c4612bc3565b60200260200101516040518363ffffffff1660e01b81526004016117fd9291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af115801561181c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118409190612b93565b505b6001016115be565b50602083015115611905576009546000808052600660209081527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f854868201516040805163a9059cbb60e01b81526001600160a01b039384166004820152602481019290925251919094169363a9059cbb93604480830194939283900301908290875af11580156118df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119039190612b93565b505b6040830151156119c25760095460036000908152600660209081527f75f96ab15d697e93042dc45b5c896c4b27e89bb6eaf39475c5c371cb2513f7d254604087810151815163a9059cbb60e01b81526001600160a01b03938416600482015260248101919091529051919094169363a9059cbb93604480830194939283900301908290875af115801561199c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c09190612b93565b505b606083015115611a4f576009546020850151606085015160405163a9059cbb60e01b81526001600160a01b039283166004820152602481019190915291169063a9059cbb906044016020604051808303816000875af1158015611a29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4d9190612b93565b505b608083015115611adc576009546060850151608085015160405163a9059cbb60e01b81526001600160a01b039283166004820152602481019190915291169063a9059cbb906044016020604051808303816000875af1158015611ab6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ada9190612b93565b505b825160008e81526003602052604081208054909190611afc908490612b80565b909155505060008d81526004602090815260408083208f8452825291829020805460ff19166001179055845191519182528d918f917e26d11598a6b3e9cb227c9bcea05a29d198a8bfae83155b855c0ce976768adf910160405180910390a350505050610fc360018055565b611b70612012565b6001600160a01b038116611bda5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b611be38161226b565b50565b611c3c604051806101400160405280600081526020016000815260200160008152602001600081526020016000815260200160608152602001606081526020016060815260200160608152602001606081525090565b60405180610140016040528060008152602001600081526020016000815260200160008152602001600081526020018686905067ffffffffffffffff811115611c8757611c87612bd9565b604051908082528060200260200182016040528015611cb0578160200160208202803683370190505b5081526020018567ffffffffffffffff811115611ccf57611ccf612bd9565b604051908082528060200260200182016040528015611cf8578160200160208202803683370190505b5081526020018567ffffffffffffffff811115611d1757611d17612bd9565b604051908082528060200260200182016040528015611d40578160200160208202803683370190505b5081526020018567ffffffffffffffff811115611d5f57611d5f612bd9565b604051908082528060200260200182016040528015611d88578160200160208202803683370190505b5081526020018567ffffffffffffffff811115611da757611da7612bd9565b604051908082528060200260200182016040528015611dd0578160200160208202803683370190505b5090529050600080808080805b89811015611f7d57888882818110611df757611df7612bc3565b9050602002013587600001818151611e0f9190612bb0565b905250611e5a8b8b83818110611e2757611e27612bc3565b9050602002016020810190611e3c9190612654565b8a8a84818110611e4e57611e4e612bc3565b905060200201356108fe565b60208c018051959b50939950919750955093508691611e7a908390612bb0565b905250606087018051859190611e91908390612bb0565b905250608087018051849190611ea8908390612bb0565b905250604087018051839190611ebf908390612bb0565b90525060a0870151805187919083908110611edc57611edc612bc3565b602002602001018181525050848760c001518281518110611eff57611eff612bc3565b602002602001018181525050838760e001518281518110611f2257611f22612bc3565b602002602001018181525050828761010001518281518110611f4657611f46612bc3565b602002602001018181525050818761012001518281518110611f6a57611f6a612bc3565b6020908102919091010152600101611ddd565b505050505050949350505050565b611f93612012565b6001600160a01b038216611fba5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020908152604091829020805460ff191685151590811790915591519182527f729f44f03472c59080eb4fa76cc3248e0ac9260f8c38f961f5522e19f543171391016108e0565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611bd1565b6120746123b8565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038116600090815260076020526040812054156120fd576001600160a01b038216600090815260076020526040902054612129565b6000805260056020527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc545b92915050565b600054600160a01b900460ff16156108fc5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401611bd1565b6002600154036121ce5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611bd1565b6002600155565b600083815260026020526040812054900361220357604051632627b46560e11b815260040160405180910390fd5b60008381526003602052604081208054839290612221908490612bb0565b90915550506040518181526001600160a01b0383169084907f760961e06879ac0f22f38d77f132f705abfcbadbeb8e3161ed149351307c3af69060200160405180910390a3505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6122c361212f565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120a43390565b600081831161230d578161230f565b825b9392505050565b6000612129612323612408565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006123758888888861252f565b9092509050600081600481111561238e5761238e612b6a565b1480156123ac5750836001600160a01b0316826001600160a01b0316145b98975050505050505050565b600054600160a01b900460ff166108fc5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401611bd1565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561246157507f000000000000000000000000000000000000000000000000000000000000000046145b1561248b57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561256657506000905060036125ea565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156125ba573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166125e3576000600192509250506125ea565b9150600090505b94509492505050565b80356001600160a01b038116811461260a57600080fd5b919050565b6000806040838503121561262257600080fd5b82359150612632602084016125f3565b90509250929050565b60006020828403121561264d57600080fd5b5035919050565b60006020828403121561266657600080fd5b61230f826125f3565b6000806040838503121561268257600080fd5b50508035926020909101359150565b600080604083850312156126a457600080fd5b6126ad836125f3565b946020939093013593505050565b80356004811061260a57600080fd5b6000602082840312156126dc57600080fd5b61230f826126bb565b6000806000606084860312156126fa57600080fd5b8335925061270a602085016125f3565b9150604084013590509250925092565b60008060006060848603121561272f57600080fd5b8335925060208401359150612746604085016125f3565b90509250925092565b6000806040838503121561276257600080fd5b6126ad836126bb565b803560ff8116811461260a57600080fd5b60008060008060008060008060006101208a8c03121561279b57600080fd5b893598506127ab60208b016125f3565b975060408a0135965060608a0135955060808a0135945060a08a013593506127d560c08b0161276b565b925060e08a013591506101008a013590509295985092959850929598565b6000806000806080858703121561280957600080fd5b84359350612819602086016125f3565b9250612827604086016125f3565b9150612835606086016125f3565b905092959194509250565b6000806040838503121561285357600080fd5b61285c836126bb565b9150612632602084016125f3565b60008083601f84011261287c57600080fd5b50813567ffffffffffffffff81111561289457600080fd5b6020830191508360208260051b85010111156128af57600080fd5b9250929050565b600080600080600080600080600060e08a8c0312156128d457600080fd5b8935985060208a0135975060408a013567ffffffffffffffff808211156128fa57600080fd5b6129068d838e0161286a565b909950975060608c013591508082111561291f57600080fd5b5061292c8c828d0161286a565b909650945061293f905060808b0161276b565b925060a08a0135915060c08a013590509295985092959850929598565b6000806000806040858703121561297257600080fd5b843567ffffffffffffffff8082111561298a57600080fd5b6129968883890161286a565b909650945060208701359150808211156129af57600080fd5b506129bc8782880161286a565b95989497509550505050565b600081518084526020808501945080840160005b838110156129f8578151875295820195908201906001016129dc565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a0820152600060a08301516101408060c0850152612a546101608501836129c8565b915060c0850151601f19808685030160e0870152612a7284836129c8565b935060e08701519150610100818786030181880152612a9185846129c8565b945080880151925050610120818786030181880152612ab085846129c8565b908801518782039092018488015293509050612acc83826129c8565b9695505050505050565b8015158114611be357600080fd5b60008060408385031215612af757600080fd5b612b00836125f3565b91506020830135612b1081612ad6565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761212957612129612b1b565b600082612b6557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052602160045260246000fd5b8181038181111561212957612129612b1b565b600060208284031215612ba557600080fd5b815161230f81612ad6565b8082018082111561212957612129612b1b565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220c2c4188d13fd531459030aa87f8cdf7e35df8f0e8cbb4c8bfc02594d71f914ec64736f6c63430008110033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000762c0cefbdc51d3ca0553b81792d82fca96ef7a30000000000000000000000003f3bae2e57db3401a98d807121a2d1460055a2ee
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80636f09d07f1161010f57806399cf3049116100a2578063ee207b9511610071578063ee207b95146104d4578063f2fde38b146104f4578063f4620a1114610507578063fea868131461052757600080fd5b806399cf304914610488578063bf4390981461049b578063d4f5f83b146104ae578063d968edac146104c157600080fd5b806387ea9915116100de57806387ea99151461043e5780638c6aa3f5146104515780638da5cb5b14610464578063999fb6ec1461047557600080fd5b80636f09d07f14610412578063715018a61461042557806380024af81461042d5780638456cb591461043657600080fd5b80633a75f9d5116101875780634cd33dff116101565780634cd33dff1461038f5780635c975abb146103b25780636202834f146103c45780636be377d1146103ff57600080fd5b80633a75f9d51461032a5780633e413bee1461036b5780633f4ba83a1461037e57806345d89b951461038657600080fd5b80631b1967ce116101c35780631b1967ce146102a65780631c700236146102e45780632a24c9ae146102f7578063357c13541461030a57600080fd5b80630f746323146101ea578063107046bd146101ff5780631442454814610278575b600080fd5b6101fd6101f836600461260f565b61053a565b005b61024461020d36600461263b565b6002602081905260009182526040909120805460018201549282015460039092015490926001600160a01b03908116928116911684565b604080519485526001600160a01b039384166020860152918316918401919091521660608201526080015b60405180910390f35b610298610286366004612654565b60076020526000908152604090205481565b60405190815260200161026f565b6102d46102b436600461266f565b600460209081526000928352604080842090915290825290205460ff1681565b604051901515815260200161026f565b6101fd6102f236600461260f565b6106bf565b6101fd610305366004612691565b610824565b6102986103183660046126ca565b60056020526000908152604090205481565b6103536103383660046126ca565b6006602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161026f565b600954610353906001600160a01b031681565b6101fd6108ec565b610298600b5481565b6102d461039d366004612654565b60086020526000908152604090205460ff1681565b600054600160a01b900460ff166102d4565b6103d76103d2366004612691565b6108fe565b604080519586526020860194909452928401919091526060830152608082015260a00161026f565b6101fd61040d36600461260f565b610a38565b6101fd6104203660046126e5565b610b7b565b6101fd610c22565b610298600a5481565b6101fd610c34565b6101fd61044c36600461271a565b610c44565b6101fd61045f36600461274f565b610d92565b6000546001600160a01b0316610353565b6101fd61048336600461277c565b610f05565b6101fd61049636600461266f565b610fce565b6101fd6104a93660046127f3565b6110f1565b6101fd6104bc366004612840565b6112f2565b6101fd6104cf3660046128b6565b611418565b6102986104e236600461263b565b60036020526000908152604090205481565b6101fd610502366004612654565b611b68565b61051a61051536600461295c565b611be6565b60405161026f9190612a03565b6101fd610535366004612ae4565b611f8b565b6001600160a01b0381166105615760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03811660009081526008602052604090205460ff1661059a57604051639f022a6b60e01b815260040160405180910390fd5b60008281526002602081815260408084208151608081018352815480825260018301546001600160a01b039081169583019590955294820154841692810192909252600301549091166060820152910361060757604051632627b46560e11b815260040160405180910390fd5b80602001516001600160a01b0316336001600160a01b03161415801561063857506000546001600160a01b03163314155b156106565760405163ea8e4eb560e01b815260040160405180910390fd5b60008381526002602090815260409182902060010180546001600160a01b0319166001600160a01b038616908117909155915191825284917ff5ed10b48c58392a4ea07a207195834da8e9497f6f465c22824ded644ee896b691015b60405180910390a2505050565b6001600160a01b0381166106e65760405163d92e233d60e01b815260040160405180910390fd5b60008281526002602081815260408084208151608081018352815480825260018301546001600160a01b039081169583019590955294820154841692810192909252600301549091166060820152910361075357604051632627b46560e11b815260040160405180910390fd5b80604001516001600160a01b0316336001600160a01b03161415801561078f575080602001516001600160a01b0316336001600160a01b031614155b80156107a657506000546001600160a01b03163314155b156107c45760405163ea8e4eb560e01b815260040160405180910390fd5b60008381526002602081815260409283902090910180546001600160a01b0319166001600160a01b038616908117909155915191825284917f7b54b20d47827c99258c332394149a48212c457399de3e483fa1be178834a6a191016106b2565b6001600160a01b038216331461084d5760405163ea8e4eb560e01b815260040160405180910390fd5b600a548110156108705760405163732f941360e01b815260040160405180910390fd5b600b548111156108935760405163cd4e616760e01b815260040160405180910390fd5b6001600160a01b03821660008181526007602052604090819020839055517fb477f99762829001b02cd5afbb50828c60f474e4b38afc9df24a68fb9aec40c8906108e09084815260200190565b60405180910390a25050565b6108f4612012565b6108fc61206c565b565b600080600080600080610910886120c1565b905061271061091f8289612b31565b6109299190612b48565b600260005260056020527f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a54909550612710906109669089612b31565b6109709190612b48565b600160005260056020527f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b54909450612710906109ad9089612b31565b6109b79190612b48565b600360005260056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc054909350612710906109f49089612b31565b6109fe9190612b48565b9150818385610a0d888b612b80565b610a179190612b80565b610a219190612b80565b610a2b9190612b80565b9550509295509295909350565b6001600160a01b038116610a5f5760405163d92e233d60e01b815260040160405180910390fd5b60008281526002602081815260408084208151608081018352815480825260018301546001600160a01b0390811695830195909552948201548416928101929092526003015490911660608201529103610acc57604051632627b46560e11b815260040160405180910390fd5b80606001516001600160a01b0316336001600160a01b031614158015610afd57506000546001600160a01b03163314155b15610b1b5760405163ea8e4eb560e01b815260040160405180910390fd5b60008381526002602090815260409182902060030180546001600160a01b0319166001600160a01b038616908117909155915191825284917f96486a54feef09628614d2fadacdb468819983681e47c62ee6ca8a7e5e7f649191016106b2565b610b8361212f565b610b8b61217c565b610b968383836121d5565b6009546040516323b872dd60e01b81526001600160a01b03848116600483015230602483015260448201849052909116906323b872dd906064016020604051808303816000875af1158015610bef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c139190612b93565b50610c1d60018055565b505050565b610c2a612012565b6108fc600061226b565b610c3c612012565b6108fc6122bb565b610c4c612012565b610c5461217c565b6001600160a01b038116610c7b5760405163d92e233d60e01b815260040160405180910390fd5b600083815260036020526040902054821115610caa57604051631e9acf1760e31b815260040160405180910390fd5b60008381526003602052604081208054849290610cc8908490612b80565b909155505060095460405163a9059cbb60e01b81526001600160a01b038381166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af1158015610d20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d449190612b93565b50806001600160a01b0316837fb1a47149fb1b958647a4cc00d6adbdc4fe1b0981dbe185a952c5c191fa420a3884604051610d8191815260200190565b60405180910390a3610c1d60018055565b610d9a612012565b8060056000846003811115610db157610db1612b6a565b6003811115610dc257610dc2612b6a565b8152602080820192909252604001600090812092909255818052600590527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc54600b54610e0f91906122fe565b60056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc0547f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b5460026000527f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a5492935061271092610e909085612bb0565b610e9a9190612bb0565b610ea49190612bb0565b1115610ec35760405163597a902960e11b815260040160405180910390fd5b826003811115610ed557610ed5612b6a565b6040518381527fa7eb1a94cc3e2fa58da62f449380025f163b7648f0754617e0e186781ae82ef2906020016106b2565b610f0d61212f565b610f1561217c565b610f208989896121d5565b6009546040516377aadf6360e11b81526001600160a01b038a81166004830152306024830152604482018a9052606482018990526084820188905260a4820187905260ff861660c483015260e4820185905261010482018490529091169063ef55bec69061012401600060405180830381600087803b158015610fa257600080fd5b505af1158015610fb6573d6000803e3d6000fd5b50505050610fc360018055565b505050505050505050565b610fd6612012565b80821115610ff75760405163cd4e616760e01b815260040160405180910390fd5b60056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc0547f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b5460026000527f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a546127109291906110779085612bb0565b6110819190612bb0565b61108b9190612bb0565b11156110aa5760405163597a902960e11b815260040160405180910390fd5b600a829055600b81905560408051838152602081018390527f7013d42e1cb4362b60b45337d1357208bfea803e9c8a697bab0429b32bd17989910160405180910390a15050565b6110f961212f565b61110161217c565b8360000361112257604051632af342d760e21b815260040160405180910390fd5b6001600160a01b0383166111495760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382166111705760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0381166111975760405163d92e233d60e01b815260040160405180910390fd5b336001600160a01b038416146111c05760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b03831660009081526008602052604090205460ff166111f957604051639f022a6b60e01b815260040160405180910390fd5b6000848152600260205260409020541561122657604051632d8306b960e21b815260040160405180910390fd5b604080516080810182528581526001600160a01b0385811660208084018281528784168587018181528886166060880181815260008e81526002808852908b902099518a55945160018a018054918a166001600160a01b03199283161790559251948901805495891695841695909517909455925160039097018054979096169616959095179093559351918252919287917ff3a683cd649b0cb84a07ae370671145c6227d109805ece1f98ce3197ef1ad4a1910160405180910390a46112ec60018055565b50505050565b6112fa612012565b6001600160a01b0381166113215760405163d92e233d60e01b815260040160405180910390fd5b600082600381111561133557611335612b6a565b141580156113555750600382600381111561135257611352612b6a565b14155b15611373576040516358d620b360e01b815260040160405180910390fd5b806006600084600381111561138a5761138a612b6a565b600381111561139b5761139b612b6a565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160038111156113df576113df612b6a565b6040516001600160a01b03831681527fa431c021cf006627dcdfb8a50687f4bba78d512d59ad5069410a6f3158ccba4f906020016108e0565b61142061212f565b61142861217c565b876000036114495760405163298fcc9760e01b815260040160405180910390fd5b8584146114695760405163575d219360e11b815260040160405180910390fd5b60008981526004602090815260408083208b845290915290205460ff16156114a457604051638be1900960e01b815260040160405180910390fd5b60008981526002602081815260409283902083516080810185528154815260018201546001600160a01b039081169382018490529382015484169481019490945260030154909116606083015233146115105760405163ea8e4eb560e01b815260040160405180910390fd5b600061151e89898989611be6565b8051604080517ffffb2b049cd2abbfc87fae4c8825d7e55adc048c4703e2aa70d62d8447dfc3e860208201529081018e9052606081018d9052608081019190915290915060009060a001604051602081830303815290604052805190602001209050600061158b82612316565b905061159e818888888860400151612364565b6115bb5760405163dfd8f8f160e01b815260040160405180910390fd5b60005b8360a001515181101561184a5760008c8c838181106115df576115df612bc3565b90506020020160208101906115f49190612654565b6001600160a01b03160361161b5760405163d92e233d60e01b815260040160405180910390fd5b8d8c8c8381811061162e5761162e612bc3565b90506020020160208101906116439190612654565b6001600160a01b03167f7a860f98c77c3c309b5f9248e11bf8df30907d213ef0c86bc7b3efae33139ddf8c8c8581811061167f5761167f612bc3565b905060200201358760a00151858151811061169c5761169c612bc3565b60200260200101518860c0015186815181106116ba576116ba612bc3565b60200260200101518960e0015187815181106116d8576116d8612bc3565b60200260200101518a610100015188815181106116f7576116f7612bc3565b60200260200101518b6101200151898151811061171657611716612bc3565b60209081029190910181015160408051978852918701959095528501929092526060840152608083015260a082015260c00160405180910390a360008460a00151828151811061176857611768612bc3565b60200260200101511115611842576009546001600160a01b031663a9059cbb8d8d8481811061179957611799612bc3565b90506020020160208101906117ae9190612654565b8660a0015184815181106117c4576117c4612bc3565b60200260200101516040518363ffffffff1660e01b81526004016117fd9291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af115801561181c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118409190612b93565b505b6001016115be565b50602083015115611905576009546000808052600660209081527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f854868201516040805163a9059cbb60e01b81526001600160a01b039384166004820152602481019290925251919094169363a9059cbb93604480830194939283900301908290875af11580156118df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119039190612b93565b505b6040830151156119c25760095460036000908152600660209081527f75f96ab15d697e93042dc45b5c896c4b27e89bb6eaf39475c5c371cb2513f7d254604087810151815163a9059cbb60e01b81526001600160a01b03938416600482015260248101919091529051919094169363a9059cbb93604480830194939283900301908290875af115801561199c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c09190612b93565b505b606083015115611a4f576009546020850151606085015160405163a9059cbb60e01b81526001600160a01b039283166004820152602481019190915291169063a9059cbb906044016020604051808303816000875af1158015611a29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4d9190612b93565b505b608083015115611adc576009546060850151608085015160405163a9059cbb60e01b81526001600160a01b039283166004820152602481019190915291169063a9059cbb906044016020604051808303816000875af1158015611ab6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ada9190612b93565b505b825160008e81526003602052604081208054909190611afc908490612b80565b909155505060008d81526004602090815260408083208f8452825291829020805460ff19166001179055845191519182528d918f917e26d11598a6b3e9cb227c9bcea05a29d198a8bfae83155b855c0ce976768adf910160405180910390a350505050610fc360018055565b611b70612012565b6001600160a01b038116611bda5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b611be38161226b565b50565b611c3c604051806101400160405280600081526020016000815260200160008152602001600081526020016000815260200160608152602001606081526020016060815260200160608152602001606081525090565b60405180610140016040528060008152602001600081526020016000815260200160008152602001600081526020018686905067ffffffffffffffff811115611c8757611c87612bd9565b604051908082528060200260200182016040528015611cb0578160200160208202803683370190505b5081526020018567ffffffffffffffff811115611ccf57611ccf612bd9565b604051908082528060200260200182016040528015611cf8578160200160208202803683370190505b5081526020018567ffffffffffffffff811115611d1757611d17612bd9565b604051908082528060200260200182016040528015611d40578160200160208202803683370190505b5081526020018567ffffffffffffffff811115611d5f57611d5f612bd9565b604051908082528060200260200182016040528015611d88578160200160208202803683370190505b5081526020018567ffffffffffffffff811115611da757611da7612bd9565b604051908082528060200260200182016040528015611dd0578160200160208202803683370190505b5090529050600080808080805b89811015611f7d57888882818110611df757611df7612bc3565b9050602002013587600001818151611e0f9190612bb0565b905250611e5a8b8b83818110611e2757611e27612bc3565b9050602002016020810190611e3c9190612654565b8a8a84818110611e4e57611e4e612bc3565b905060200201356108fe565b60208c018051959b50939950919750955093508691611e7a908390612bb0565b905250606087018051859190611e91908390612bb0565b905250608087018051849190611ea8908390612bb0565b905250604087018051839190611ebf908390612bb0565b90525060a0870151805187919083908110611edc57611edc612bc3565b602002602001018181525050848760c001518281518110611eff57611eff612bc3565b602002602001018181525050838760e001518281518110611f2257611f22612bc3565b602002602001018181525050828761010001518281518110611f4657611f46612bc3565b602002602001018181525050818761012001518281518110611f6a57611f6a612bc3565b6020908102919091010152600101611ddd565b505050505050949350505050565b611f93612012565b6001600160a01b038216611fba5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b038216600081815260086020908152604091829020805460ff191685151590811790915591519182527f729f44f03472c59080eb4fa76cc3248e0ac9260f8c38f961f5522e19f543171391016108e0565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611bd1565b6120746123b8565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038116600090815260076020526040812054156120fd576001600160a01b038216600090815260076020526040902054612129565b6000805260056020527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc545b92915050565b600054600160a01b900460ff16156108fc5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401611bd1565b6002600154036121ce5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611bd1565b6002600155565b600083815260026020526040812054900361220357604051632627b46560e11b815260040160405180910390fd5b60008381526003602052604081208054839290612221908490612bb0565b90915550506040518181526001600160a01b0383169084907f760961e06879ac0f22f38d77f132f705abfcbadbeb8e3161ed149351307c3af69060200160405180910390a3505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6122c361212f565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120a43390565b600081831161230d578161230f565b825b9392505050565b6000612129612323612408565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006123758888888861252f565b9092509050600081600481111561238e5761238e612b6a565b1480156123ac5750836001600160a01b0316826001600160a01b0316145b98975050505050505050565b600054600160a01b900460ff166108fc5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401611bd1565b6000306001600160a01b037f00000000000000000000000072a78d4da171fbf382af0c3dae94949e1459852f1614801561246157507f000000000000000000000000000000000000000000000000000000000000000146145b1561248b57507f2c088db5628ac474891a4b7bed9a9949a646b5454dc663510562de3b2920480290565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527fd5e3f562345e2dd95ef9b6a033b45ac48627a97b8ffd1388fec7fe7fa223dc61828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561256657506000905060036125ea565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156125ba573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166125e3576000600192509250506125ea565b9150600090505b94509492505050565b80356001600160a01b038116811461260a57600080fd5b919050565b6000806040838503121561262257600080fd5b82359150612632602084016125f3565b90509250929050565b60006020828403121561264d57600080fd5b5035919050565b60006020828403121561266657600080fd5b61230f826125f3565b6000806040838503121561268257600080fd5b50508035926020909101359150565b600080604083850312156126a457600080fd5b6126ad836125f3565b946020939093013593505050565b80356004811061260a57600080fd5b6000602082840312156126dc57600080fd5b61230f826126bb565b6000806000606084860312156126fa57600080fd5b8335925061270a602085016125f3565b9150604084013590509250925092565b60008060006060848603121561272f57600080fd5b8335925060208401359150612746604085016125f3565b90509250925092565b6000806040838503121561276257600080fd5b6126ad836126bb565b803560ff8116811461260a57600080fd5b60008060008060008060008060006101208a8c03121561279b57600080fd5b893598506127ab60208b016125f3565b975060408a0135965060608a0135955060808a0135945060a08a013593506127d560c08b0161276b565b925060e08a013591506101008a013590509295985092959850929598565b6000806000806080858703121561280957600080fd5b84359350612819602086016125f3565b9250612827604086016125f3565b9150612835606086016125f3565b905092959194509250565b6000806040838503121561285357600080fd5b61285c836126bb565b9150612632602084016125f3565b60008083601f84011261287c57600080fd5b50813567ffffffffffffffff81111561289457600080fd5b6020830191508360208260051b85010111156128af57600080fd5b9250929050565b600080600080600080600080600060e08a8c0312156128d457600080fd5b8935985060208a0135975060408a013567ffffffffffffffff808211156128fa57600080fd5b6129068d838e0161286a565b909950975060608c013591508082111561291f57600080fd5b5061292c8c828d0161286a565b909650945061293f905060808b0161276b565b925060a08a0135915060c08a013590509295985092959850929598565b6000806000806040858703121561297257600080fd5b843567ffffffffffffffff8082111561298a57600080fd5b6129968883890161286a565b909650945060208701359150808211156129af57600080fd5b506129bc8782880161286a565b95989497509550505050565b600081518084526020808501945080840160005b838110156129f8578151875295820195908201906001016129dc565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a0820152600060a08301516101408060c0850152612a546101608501836129c8565b915060c0850151601f19808685030160e0870152612a7284836129c8565b935060e08701519150610100818786030181880152612a9185846129c8565b945080880151925050610120818786030181880152612ab085846129c8565b908801518782039092018488015293509050612acc83826129c8565b9695505050505050565b8015158114611be357600080fd5b60008060408385031215612af757600080fd5b612b00836125f3565b91506020830135612b1081612ad6565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761212957612129612b1b565b600082612b6557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052602160045260246000fd5b8181038181111561212957612129612b1b565b600060208284031215612ba557600080fd5b815161230f81612ad6565b8082018082111561212957612129612b1b565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220c2c4188d13fd531459030aa87f8cdf7e35df8f0e8cbb4c8bfc02594d71f914ec64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000762c0cefbdc51d3ca0553b81792d82fca96ef7a30000000000000000000000003f3bae2e57db3401a98d807121a2d1460055a2ee
-----Decoded View---------------
Arg [0] : usdc_ (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : treasuryAddress_ (address): 0x762C0cefBdC51D3ca0553b81792D82fcA96EF7a3
Arg [2] : cashVestingAddress_ (address): 0x3f3bAe2e57DB3401a98d807121A2D1460055a2Ee
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] : 000000000000000000000000762c0cefbdc51d3ca0553b81792d82fca96ef7a3
Arg [2] : 0000000000000000000000003f3bae2e57db3401a98d807121a2d1460055a2ee
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.999956 | 12,801 | $12,800.44 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.