Source Code
Overview
S Balance
More Info
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x1f91d444...72d9233D0 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
IndividualClaims
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.18; import "../../abstract/MasterAwareV2.sol"; import "../../interfaces/IAssessment.sol"; import "../../interfaces/ICover.sol"; import "../../interfaces/ICoverNFT.sol"; import "../../interfaces/IERC20Detailed.sol"; import "../../interfaces/IIndividualClaims.sol"; import "../../interfaces/ISAFURAToken.sol"; import "../../interfaces/IPool.sol"; import "../../interfaces/IRamm.sol"; import "../../interfaces/ICoverProducts.sol"; import "../../libraries/Math.sol"; import "../../libraries/SafeUintCast.sol"; /// Provides a way for cover owners to submit claims and redeem payouts. It is an entry point to /// the assessment process where the members of the mutual decide the outcome of claims. contract IndividualClaims is IIndividualClaims, MasterAwareV2 { // 0-10000 bps (i.e. double decimal precision percentage) uint internal constant MIN_ASSESSMENT_DEPOSIT_DENOMINATOR = 10000; uint internal constant REWARD_DENOMINATOR = 10000; // Used in operations involving NXM tokens and divisions uint internal constant PRECISION = 10 ** 18; ISAFURAToken public immutable nxm; ICoverNFT public immutable coverNFT; /* ========== STATE VARIABLES ========== */ Configuration public override config; Claim[] public override claims; // Mapping from coverId to claimId used to check if a new claim can be submitted on the given // cover as long as the last submitted claim reached a final state. mapping(uint => ClaimSubmission) public lastClaimSubmissionOnCover; /* ========== CONSTRUCTOR ========== */ constructor(address nxmAddress, address coverNFTAddress) { nxm = ISAFURAToken(nxmAddress); coverNFT = ICoverNFT(coverNFTAddress); } /* ========== VIEWS ========== */ function cover() internal view returns (ICover) { return ICover(internalContracts[uint(ID.CO)]); } function coverProducts() internal view returns (ICoverProducts) { return ICoverProducts(internalContracts[uint(ID.CP)]); } function assessment() internal view returns (IAssessment) { return IAssessment(internalContracts[uint(ID.AS)]); } function pool() internal view returns (IPool) { return IPool(internalContracts[uint(ID.P1)]); } function ramm() internal view returns (IRamm) { return IRamm(internalContracts[uint(ID.RA)]); } function getClaimsCount() external override view returns (uint) { return claims.length; } /// Returns the required assessment deposit and total reward for a new claim /// /// @dev This view is meant to be used either by users or user interfaces to determine the /// minimum assessment deposit value of the submitClaim tx. /// /// @param requestedAmount The amount that is claimed /// @param segmentPeriod The cover period of the segment in days /// @param coverAsset The asset in which the payout would be made function getAssessmentDepositAndReward( uint requestedAmount, uint segmentPeriod, uint coverAsset ) public view returns (uint, uint) { IPool poolContract = pool(); uint nxmPriceInETH = poolContract.getInternalTokenPriceInAsset(0); uint nxmPriceInCoverAsset = coverAsset == 0 ? nxmPriceInETH : poolContract.getInternalTokenPriceInAsset(coverAsset); // Calculate the expected payout in NXM using the NXM price at cover purchase time uint expectedPayoutInNXM = requestedAmount * PRECISION / nxmPriceInCoverAsset; // Determine the total rewards that should be minted for the assessors based on cover period uint totalRewardInNXM = Math.min( uint(config.maxRewardInNXMWad) * PRECISION, expectedPayoutInNXM * uint(config.rewardRatio) * segmentPeriod / 365 days / REWARD_DENOMINATOR ); uint dynamicDeposit = totalRewardInNXM * nxmPriceInETH / PRECISION; uint minDeposit = 1 ether * uint(config.minAssessmentDepositRatio) / MIN_ASSESSMENT_DEPOSIT_DENOMINATOR; // If dynamicDeposit falls below minDeposit use minDeposit instead uint assessmentDepositInETH = Math.max(minDeposit, dynamicDeposit); return (assessmentDepositInETH, totalRewardInNXM); } /// Returns a Claim aggregated in a human-friendly format. /// /// @dev This view is meant to be used in user interfaces to get a claim in a format suitable for /// displaying all relevant information in as few calls as possible. See ClaimDisplay struct. /// /// @param id Claim identifier for which the ClaimDisplay is returned function getClaimDisplay(uint id) internal view returns (ClaimDisplay memory) { Claim memory claim = claims[id]; (IAssessment.Poll memory poll,,) = assessment().assessments(claim.assessmentId); ClaimStatus claimStatus = ClaimStatus.PENDING; PayoutStatus payoutStatus = PayoutStatus.PENDING; { // Determine the claims status if (block.timestamp >= poll.end) { if (poll.accepted > poll.denied) { claimStatus = ClaimStatus.ACCEPTED; } else { claimStatus = ClaimStatus.DENIED; } } // Determine the payout status if (claimStatus == ClaimStatus.ACCEPTED) { if (claim.payoutRedeemed) { payoutStatus = PayoutStatus.COMPLETE; } else { (,,uint8 payoutCooldownInDays,) = assessment().config(); if ( block.timestamp >= poll.end + uint(payoutCooldownInDays) * 1 days + uint(config.payoutRedemptionPeriodInDays) * 1 days ) { payoutStatus = PayoutStatus.UNCLAIMED; } } } else if (claimStatus == ClaimStatus.DENIED) { payoutStatus = PayoutStatus.DENIED; } } CoverData memory coverData = cover().coverData(claim.coverId); CoverSegment memory segment = cover().coverSegmentWithRemainingAmount(claim.coverId, claim.segmentId); uint segmentEnd = segment.start + segment.period; string memory assetSymbol; if (claim.coverAsset == 0) { assetSymbol = "ETH"; } else { address assetAddress = pool().getAsset(claim.coverAsset).assetAddress; try IERC20Detailed(assetAddress).symbol() returns (string memory v) { assetSymbol = v; } catch { // return assetSymbol as an empty string and use claim.coverAsset instead in the UI } } return ClaimDisplay( id, coverData.productId, claim.coverId, claim.assessmentId, claim.amount, assetSymbol, claim.coverAsset, segment.start, segmentEnd, poll.start, poll.end, uint(claimStatus), uint(payoutStatus) ); } /// Returns an array of claims aggregated in a human-friendly format. /// /// @dev This view is meant to be used in user interfaces to get claims in a format suitable for /// displaying all relevant information in as few calls as possible. It can be used to paginate /// claims by providing the following parameters: /// /// @param ids Array of Claim ids which are returned as ClaimDisplay function getClaimsToDisplay (uint[] calldata ids) external view returns (ClaimDisplay[] memory) { ClaimDisplay[] memory claimDisplays = new ClaimDisplay[](ids.length); for (uint i = 0; i < ids.length; i++) { uint id = ids[i]; claimDisplays[i] = getClaimDisplay(id); } return claimDisplays; } /* === MUTATIVE FUNCTIONS ==== */ /// Submits a claim for assessment /// /// @dev This function requires an ETH assessment fee. See: getAssessmentDepositAndReward /// /// @param coverId Cover identifier /// @param requestedAmount The amount expected to be received at payout /// @param ipfsMetadata An IPFS hash that stores metadata about the claim that is emitted as /// an event. It's required for proof of loss. If this string is empty, /// no event is emitted. function submitClaim( uint32 coverId, uint16 segmentId, uint96 requestedAmount, string calldata ipfsMetadata ) external payable override onlyMember whenNotPaused returns (Claim memory claim) { require( coverNFT.isApprovedOrOwner(msg.sender, coverId), "Only the owner or approved addresses can submit a claim" ); return _submitClaim(coverId, segmentId, requestedAmount, ipfsMetadata, msg.sender); } function submitClaimFor( uint32 coverId, uint16 segmentId, uint96 requestedAmount, string calldata ipfsMetadata, address owner ) external payable override onlyInternal whenNotPaused returns (Claim memory claim){ return _submitClaim(coverId, segmentId, requestedAmount, ipfsMetadata, owner); } function _submitClaim( uint32 coverId, uint16 segmentId, uint96 requestedAmount, string calldata ipfsMetadata, address owner ) internal returns (Claim memory) { { ClaimSubmission memory previousSubmission = lastClaimSubmissionOnCover[coverId]; if (previousSubmission.exists) { uint80 assessmentId = claims[previousSubmission.claimId].assessmentId; IAssessment.Poll memory poll = assessment().getPoll(assessmentId); (,,uint8 payoutCooldownInDays,) = assessment().config(); uint payoutCooldown = uint(payoutCooldownInDays) * 1 days; if (block.timestamp >= poll.end + payoutCooldown) { if ( poll.accepted > poll.denied && block.timestamp < uint(poll.end) + payoutCooldown + uint(config.payoutRedemptionPeriodInDays) * 1 days ) { revert("A payout can still be redeemed"); } } else { revert("A claim is already being assessed"); } } lastClaimSubmissionOnCover[coverId] = ClaimSubmission(uint80(claims.length), true); } ICoverProducts coverProductsContract = coverProducts(); CoverData memory coverData = cover().coverData(coverId); CoverSegment memory segment = cover().coverSegmentWithRemainingAmount(coverId, segmentId); { (, ProductType memory productType) = coverProductsContract.getProductWithType(coverData.productId); require( productType.claimMethod == uint8(ClaimMethod.IndividualClaims), "Invalid claim method for this product type" ); require(requestedAmount <= segment.amount, "Covered amount exceeded"); require(block.timestamp > segment.start, "Cannot buy cover and submit claim in the same block"); require( uint(segment.start) + uint(segment.period) + uint(segment.gracePeriod) > block.timestamp, "Cover is outside the grace period" ); emit ClaimSubmitted( owner, // user claims.length, // claimId coverId, // coverId coverData.productId // user ); } (uint assessmentDepositInETH, uint totalRewardInNXM) = getAssessmentDepositAndReward( requestedAmount, segment.period, coverData.coverAsset ); uint newAssessmentId = assessment().startAssessment(totalRewardInNXM, assessmentDepositInETH); Claim memory claim = Claim({ assessmentId: SafeUintCast.toUint80(newAssessmentId), coverId: coverId, segmentId: segmentId, amount: requestedAmount, coverAsset: coverData.coverAsset, payoutRedeemed: false }); claims.push(claim); if (bytes(ipfsMetadata).length > 0) { emit MetadataSubmitted(claims.length - 1, ipfsMetadata); } require(msg.value >= assessmentDepositInETH, "Assessment deposit is insufficient"); if (msg.value > assessmentDepositInETH) { // Refund ETH excess back to the sender ( bool refunded, /* bytes data */ ) = owner.call{value: msg.value - assessmentDepositInETH}(""); require(refunded, "Assessment deposit excess refund failed"); } // Transfer the assessment deposit to the pool ( bool transferSucceeded, /* bytes data */ ) = getInternalContractAddress(ID.P1).call{value: assessmentDepositInETH}(""); require(transferSucceeded, "Assessment deposit transfer to pool failed"); return claim; } /// Redeems payouts for accepted claims /// /// @dev Anyone can call this function, the payout always being transfered to the NFT owner. /// When the tokens are transfered the assessment deposit is also sent back. /// /// @param claimId Claim identifier function redeemClaimPayout(uint104 claimId) external override whenNotPaused { Claim memory claim = claims[claimId]; ( IAssessment.Poll memory poll, /*uint128 totalAssessmentReward*/, uint assessmentDepositInETH ) = assessment().assessments(claim.assessmentId); require(block.timestamp >= poll.end, "The claim is still being assessed"); require(poll.accepted > poll.denied, "The claim needs to be accepted"); (,,uint8 payoutCooldownInDays,) = assessment().config(); uint payoutCooldown = uint(payoutCooldownInDays) * 1 days; require(block.timestamp >= poll.end + payoutCooldown, "The claim is in cooldown period"); require( block.timestamp < uint(poll.end) + payoutCooldown + uint(config.payoutRedemptionPeriodInDays) * 1 days, "The redemption period has expired" ); require(!claim.payoutRedeemed, "Payout has already been redeemed"); claims[claimId].payoutRedeemed = true; ramm().updateTwap(); address payable coverOwner = payable(cover().burnStake( claim.coverId, claim.segmentId, claim.amount )); // Send payout in cover asset pool().sendPayout(claim.coverAsset, coverOwner, claim.amount, assessmentDepositInETH); emit ClaimPayoutRedeemed(coverOwner, claim.amount, claimId, claim.coverId); } /// Updates configurable aprameters through governance /// /// @param paramNames An array of elements from UintParams enum /// @param values An array of the new values, each one corresponding to the parameter /// from paramNames on the same position. function updateUintParameters( UintParams[] calldata paramNames, uint[] calldata values ) external override onlyGovernance { Configuration memory newConfig = config; for (uint i = 0; i < paramNames.length; i++) { if (paramNames[i] == UintParams.payoutRedemptionPeriodInDays) { newConfig.payoutRedemptionPeriodInDays = uint8(values[i]); continue; } if (paramNames[i] == UintParams.rewardRatio) { newConfig.rewardRatio = uint16(values[i]); continue; } if (paramNames[i] == UintParams.maxRewardInNXMWad) { newConfig.maxRewardInNXMWad = uint16(values[i]); continue; } if (paramNames[i] == UintParams.minAssessmentDepositRatio) { newConfig.minAssessmentDepositRatio = uint16(values[i]); continue; } } config = newConfig; } /// @dev Updates internal contract addresses to the ones stored in master. This function is /// automatically called by the master contract when a contract is added or upgraded. function changeDependentContractAddress() external override { internalContracts[uint(ID.TC)] = master.getLatestAddress("TC"); internalContracts[uint(ID.MR)] = master.getLatestAddress("MR"); internalContracts[uint(ID.P1)] = master.getLatestAddress("P1"); internalContracts[uint(ID.CO)] = master.getLatestAddress("CO"); internalContracts[uint(ID.AS)] = master.getLatestAddress("AS"); internalContracts[uint(ID.RA)] = master.getLatestAddress("RA"); internalContracts[uint(ID.CP)] = master.getLatestAddress("CP"); Configuration memory currentConfig = config; bool notInitialized = bytes32( abi.encodePacked( currentConfig.rewardRatio, currentConfig.maxRewardInNXMWad, currentConfig.minAssessmentDepositRatio, currentConfig.payoutRedemptionPeriodInDays ) ) == bytes32(0); if (notInitialized) { // The minimum cover premium per year is 2.6%. 20% of the cover premium is: 2.6% * 20% = 0.52% config.rewardRatio = 130; // 1.3% config.maxRewardInNXMWad = 50; // 50 NXM config.minAssessmentDepositRatio = 100; // 5% i.e. 0.05 ETH assessment minimum flat fee config.payoutRedemptionPeriodInDays = 30; // days to redeem the payout } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.18; import "../interfaces/ISAFURAMaster.sol"; import "../interfaces/IMasterAwareV2.sol"; import "../interfaces/IMemberRoles.sol"; abstract contract MasterAwareV2 is IMasterAwareV2 { ISAFURAMaster public master; mapping(uint => address payable) public internalContracts; modifier onlyMember { require( IMemberRoles(internalContracts[uint(ID.MR)]).checkRole( msg.sender, uint(IMemberRoles.Role.Member) ), "Caller is not a member" ); _; } modifier onlyAdvisoryBoard { require( IMemberRoles(internalContracts[uint(ID.MR)]).checkRole( msg.sender, uint(IMemberRoles.Role.AdvisoryBoard) ), "Caller is not an advisory board member" ); _; } modifier onlyInternal { require(master.isInternal(msg.sender), "Caller is not an internal contract"); _; } modifier onlyMaster { if (address(master) != address(0)) { require(address(master) == msg.sender, "Not master"); } _; } modifier onlyGovernance { require( master.checkIsAuthToGoverned(msg.sender), "Caller is not authorized to govern" ); _; } modifier onlyEmergencyAdmin { require( msg.sender == master.emergencyAdmin(), "Caller is not emergency admin" ); _; } modifier whenPaused { require(master.isPause(), "System is not paused"); _; } modifier whenNotPaused { require(!master.isPause(), "System is paused"); _; } function getInternalContractAddress(ID id) internal view returns (address payable) { return internalContracts[uint(id)]; } function changeMasterAddress(address masterAddress) public onlyMaster { master = ISAFURAMaster(masterAddress); } }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface IAssessment { /* ========== DATA STRUCTURES ========== */ enum UintParams { minVotingPeriodInDays, stakeLockupPeriodInDays, payoutCooldownInDays, silentEndingPeriodInDays } struct Configuration { // The minimum number of days the users can vote on polls uint8 minVotingPeriodInDays; // Number of days the users must wait from their last vote to withdraw their stake. uint8 stakeLockupPeriodInDays; // Number of days the users must wait after a poll closes to redeem payouts. uint8 payoutCooldownInDays; // Number of days representing the silence period. It is used to extend a poll's end date when // a vote is cast during the silence period before the end date. uint8 silentEndingPeriodInDays; } struct Stake { uint96 amount; uint104 rewardsWithdrawableFromIndex; uint16 fraudCount; /*uint32 unused,*/ } // Holds data for a vote belonging to an assessor. // // The structure is used to keep track of user's votes. Each vote is used to determine // a user's share of rewards or to create a fraud resolution which excludes fraudulent votes // from the initial poll. struct Vote { // Identifier of the claim or incident uint80 assessmentId; // If the assessor votes to accept the event it's true otherwise it's false bool accepted; // Date and time when the vote was cast uint32 timestamp; // How many tokens were staked when the vote was cast uint96 stakedAmount; } // Holds poll results for an assessment. // // The structure is used to keep track of all votes on a given assessment such as how many NXM were // used to cast accept and deny votes as well as when the poll started and when it ends. struct Poll { // The amount of NXM from accept votes uint96 accepted; // The amount of NXM from deny votes uint96 denied; // Timestamp of when the poll started. uint32 start; // Timestamp of when the poll ends. uint32 end; } // Holds data for an assessment belonging to an assessable event (individual claims, yield token // incidents etc.). // // The structure is used to keep track of the total reward that should be distributed to // assessors, the assessment deposit the claimants made to start the assessment, and the poll // coresponding to this assessment. struct Assessment { // See Poll struct Poll poll; // The amount of NXM representing the assessment reward which is split among those who voted. uint128 totalRewardInNXM; // An amount of ETH which is sent back to the claimant when the poll result is positive, // otherwise it is kep it the pool to back the assessment rewards. This allows claimants to // open an unlimited amount of claims and prevents unbacked NXM to be minted through the // assessment process. uint128 assessmentDepositInETH; } /* ========== VIEWS ========== */ function getAssessmentsCount() external view returns (uint); function assessments(uint id) external view returns (Poll memory poll, uint128 totalReward, uint128 assessmentDeposit); function getPoll(uint assessmentId) external view returns (Poll memory); function getRewards(address user) external view returns ( uint totalPendingAmount, uint withdrawableAmount, uint withdrawableUntilIndex ); function getVoteCountOfAssessor(address assessor) external view returns (uint); function votesOf(address user, uint id) external view returns (uint80 assessmentId, bool accepted, uint32 timestamp, uint96 stakedAmount); function stakeOf(address user) external view returns (uint96 amount, uint104 rewardsWithdrawableFromIndex, uint16 fraudCount); function config() external view returns ( uint8 minVotingPeriodInDays, uint8 stakeLockupPeriodInDays, uint8 payoutCooldownInDays, uint8 silentEndingPeriodInDays ); function hasAlreadyVotedOn(address voter, uint pollId) external view returns (bool); /* === MUTATIVE FUNCTIONS ==== */ function stake(uint96 amount) external; function unstake(uint96 amount, address to) external; function withdrawRewards( address user, uint104 batchSize ) external returns (uint withdrawn, uint withdrawnUntilIndex); function withdrawRewardsTo( address destination, uint104 batchSize ) external returns (uint withdrawn, uint withdrawnUntilIndex); function startAssessment(uint totalReward, uint assessmentDeposit) external returns (uint); function castVotes( uint[] calldata assessmentIds, bool[] calldata votes, string[] calldata ipfsAssessmentDataHashes, uint96 stakeIncrease ) external; function submitFraud(bytes32 root) external; function processFraud( uint256 rootIndex, bytes32[] calldata proof, address assessor, uint256 lastFraudulentVoteIndex, uint96 burnAmount, uint16 fraudCount, uint256 voteBatchSize ) external; function updateUintParameters(UintParams[] calldata paramNames, uint[] calldata values) external; /* ========== EVENTS ========== */ event StakeDeposited(address user, uint104 amount); event StakeWithdrawn(address indexed user, address to, uint96 amount); event VoteCast(address indexed user, uint256 assessmentId, uint96 stakedAmount, bool accepted, string ipfsAssessmentDataHash); event RewardWithdrawn(address user, address to, uint256 amount); event FraudProcessed(uint assessmentId, address assessor, Poll poll); event FraudSubmitted(bytes32 root); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "./IStakingPoolFactory.sol"; /** * @dev IStakingPoolFactory is missing the changeOperator() and operator() functions. * @dev Any change to the original interface will affect staking pool addresses * @dev This interface is created to add the missing functions so it can be used in other contracts. */ interface ICompleteStakingPoolFactory is IStakingPoolFactory { function operator() external view returns (address); function changeOperator(address newOperator) external; }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "./ICoverNFT.sol"; import "./IStakingNFT.sol"; import "./IStakingPool.sol"; import "./ICompleteStakingPoolFactory.sol"; /* io structs */ enum ClaimMethod { IndividualClaims, YieldTokenIncidents } struct PoolAllocationRequest { uint40 poolId; bool skip; uint coverAmountInAsset; } struct BuyCoverParams { uint coverId; address owner; uint24 productId; uint8 coverAsset; uint96 amount; uint32 period; uint maxPremiumInAsset; uint8 paymentAsset; uint16 commissionRatio; address commissionDestination; string ipfsData; } /* storage structs */ struct PoolAllocation { uint40 poolId; uint96 coverAmountInNXM; uint96 premiumInNXM; uint24 allocationId; } struct CoverData { uint24 productId; uint8 coverAsset; uint96 amountPaidOut; } struct CoverSegment { uint96 amount; uint32 start; uint32 period; // seconds uint32 gracePeriod; // seconds uint24 globalRewardsRatio; uint24 globalCapacityRatio; } interface ICover { /* ========== DATA STRUCTURES ========== */ /* internal structs */ struct RequestAllocationVariables { uint previousPoolAllocationsLength; uint previousPremiumInNXM; uint refund; uint coverAmountInNXM; } /* storage structs */ struct ActiveCover { // Global active cover amount per asset. uint192 totalActiveCoverInAsset; // The last time activeCoverExpirationBuckets was updated uint64 lastBucketUpdateId; } /* ========== VIEWS ========== */ function coverData(uint coverId) external view returns (CoverData memory); function coverDataCount() external view returns (uint); function coverSegmentsCount(uint coverId) external view returns (uint); function coverSegments(uint coverId) external view returns (CoverSegment[] memory); function coverSegmentWithRemainingAmount( uint coverId, uint segmentId ) external view returns (CoverSegment memory); function recalculateActiveCoverInAsset(uint coverAsset) external; function totalActiveCoverInAsset(uint coverAsset) external view returns (uint); function getGlobalCapacityRatio() external view returns (uint); function getGlobalRewardsRatio() external view returns (uint); function getGlobalMinPriceRatio() external pure returns (uint); function getGlobalCapacityAndPriceRatios() external view returns ( uint _globalCapacityRatio, uint _globalMinPriceRatio ); function GLOBAL_MIN_PRICE_RATIO() external view returns (uint); /* === MUTATIVE FUNCTIONS ==== */ function buyCover( BuyCoverParams calldata params, PoolAllocationRequest[] calldata coverChunkRequests ) external payable returns (uint coverId); function burnStake( uint coverId, uint segmentId, uint amount ) external returns (address coverOwner); function changeStakingPoolFactoryOperator() external; function coverNFT() external returns (ICoverNFT); function stakingNFT() external returns (IStakingNFT); function stakingPoolFactory() external returns (ICompleteStakingPoolFactory); /* ========== EVENTS ========== */ event CoverEdited(uint indexed coverId, uint indexed productId, uint indexed segmentId, address buyer, string ipfsMetadata); // Auth error OnlyOwnerOrApproved(); // Cover details error CoverPeriodTooShort(); error CoverPeriodTooLong(); error CoverOutsideOfTheGracePeriod(); error CoverAmountIsZero(); // Products error ProductNotFound(); error ProductDeprecated(); error UnexpectedProductId(); // Cover and payment assets error CoverAssetNotSupported(); error InvalidPaymentAsset(); error UnexpectedCoverAsset(); error UnexpectedEthSent(); error EditNotSupported(); // Price & Commission error PriceExceedsMaxPremiumInAsset(); error CommissionRateTooHigh(); // ETH transfers error InsufficientEthSent(); error SendingEthToPoolFailed(); error SendingEthToCommissionDestinationFailed(); error ReturningEthRemainderToSenderFailed(); // Misc error ExpiredCoversCannotBeEdited(); error CoverNotYetExpired(uint coverId); error InsufficientCoverAmountAllocated(); error UnexpectedPoolId(); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "@openzeppelin/contracts-v4/token/ERC721/IERC721.sol"; interface ICoverNFT is IERC721 { function isApprovedOrOwner(address spender, uint tokenId) external returns (bool); function mint(address to) external returns (uint tokenId); function changeOperator(address newOperator) external; function changeNFTDescriptor(address newNFTDescriptor) external; function totalSupply() external view returns (uint); function name() external view returns (string memory); error NotOperator(); error NotMinted(); error WrongFrom(); error InvalidRecipient(); error InvalidNewOperatorAddress(); error InvalidNewNFTDescriptorAddress(); error NotAuthorized(); error UnsafeRecipient(); error AlreadyMinted(); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "./ICover.sol"; /* io structs */ struct ProductInitializationParams { uint productId; uint8 weight; uint96 initialPrice; uint96 targetPrice; } /* storage structs */ struct Product { uint16 productType; address yieldTokenAddress; // cover assets bitmap. each bit represents whether the asset with // the index of that bit is enabled as a cover asset for this product uint32 coverAssets; uint16 initialPriceRatio; uint16 capacityReductionRatio; bool isDeprecated; bool useFixedPrice; } struct ProductType { uint8 claimMethod; uint32 gracePeriod; } interface ICoverProducts { /* storage structs */ struct Metadata { string ipfsHash; uint timestamp; } /* io structs */ struct ProductParam { string productName; uint productId; string ipfsMetadata; Product product; uint[] allowedPools; } struct ProductTypeParam { string productTypeName; uint productTypeId; string ipfsMetadata; ProductType productType; } /* ========== VIEWS ========== */ function getProductType(uint productTypeId) external view returns (ProductType memory); function getProductTypeName(uint productTypeId) external view returns (string memory); function getProductTypeCount() external view returns (uint); function getProductTypes() external view returns (ProductType[] memory); function getProduct(uint productId) external view returns (Product memory); function getProductName(uint productTypeId) external view returns (string memory); function getProductCount() external view returns (uint); function getProducts() external view returns (Product[] memory); // add grace period function? function getProductWithType(uint productId) external view returns (Product memory, ProductType memory); function getLatestProductMetadata(uint productId) external view returns (Metadata memory); function getLatestProductTypeMetadata(uint productTypeId) external view returns (Metadata memory); function getProductMetadata(uint productId) external view returns (Metadata[] memory); function getProductTypeMetadata(uint productTypeId) external view returns (Metadata[] memory); function getAllowedPools(uint productId) external view returns (uint[] memory _allowedPools); function getAllowedPoolsCount(uint productId) external view returns (uint); function isPoolAllowed(uint productId, uint poolId) external view returns (bool); function requirePoolIsAllowed(uint[] calldata productIds, uint poolId) external view; function getCapacityReductionRatios(uint[] calldata productIds) external view returns (uint[] memory); function getInitialPrices(uint[] calldata productIds) external view returns (uint[] memory); function prepareStakingProductsParams( ProductInitializationParams[] calldata params ) external returns ( ProductInitializationParams[] memory validatedParams ); /* === MUTATIVE FUNCTIONS ==== */ function setProductTypes(ProductTypeParam[] calldata productTypes) external; function setProducts(ProductParam[] calldata params) external; /* ========== EVENTS ========== */ event ProductSet(uint id); event ProductTypeSet(uint id); // Products and product types error ProductNotFound(); error ProductTypeNotFound(); error ProductDeprecated(); error PoolNotAllowedForThisProduct(uint productId); error StakingPoolDoesNotExist(); error MismatchedArrayLengths(); error MetadataRequired(); // Misc error UnsupportedCoverAssets(); error InitialPriceRatioBelowGlobalMinPriceRatio(); error InitialPriceRatioAbove100Percent(); error CapacityReductionRatioAbove100Percent(); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface IERC20Detailed { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function decimals() external view returns (uint8); function symbol() external view returns (string memory); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "@openzeppelin/contracts-v4/token/ERC721/IERC721Receiver.sol"; interface IIndividualClaims { enum ClaimStatus { PENDING, ACCEPTED, DENIED } enum PayoutStatus { PENDING, COMPLETE, UNCLAIMED, DENIED } enum UintParams { payoutRedemptionPeriodInDays, minAssessmentDepositRatio, maxRewardInNXMWad, rewardRatio } struct Configuration { // Number of days in which payouts can be redeemed uint8 payoutRedemptionPeriodInDays; // Ratio out of 1 ETH, used to calculate a flat ETH deposit required for claim submission. // If the claim is accepted, the user will receive the deposit back when the payout is redeemed. // (0-10000 bps i.e. double decimal precision) uint16 minAssessmentDepositRatio; // An amount of NXM representing the maximum reward amount given for any claim assessment. uint16 maxRewardInNXMWad; // Ratio used to calculate assessment rewards. (0-10000 i.e. double decimal precision). uint16 rewardRatio; } // Holds the requested amount, NXM price, submission fee and other relevant details // such as parts of the corresponding cover details and the payout status. // // This structure has snapshots of claim-time states that are considered moving targets // but also parts of cover details that reduce the need of external calls. Everything is fitted // in a single word that contains: struct Claim { // The index of the assessment, stored in Assessment.sol uint80 assessmentId; // The identifier of the cover on which this claim is submitted uint32 coverId; // The index of the cover segment on which this claim is submitted uint16 segmentId; // Amount requested as part of this claim up to the total cover amount uint96 amount; // The index of of the asset address stored at addressOfAsset which is expected at payout. uint8 coverAsset; // True if the payout is already redeemed. Prevents further payouts on the claim if it is // accepted. bool payoutRedeemed; } struct ClaimSubmission { // The index of the claim, stored in Claims.sol uint80 claimId; // True when a previous submission exists bool exists; } // Claim structure but in a human-friendly format. // // Contains aggregated values that give an overall view about the claim and other relevant // pieces of information such as cover period, asset symbol etc. This structure is not used in // any storage variables. struct ClaimDisplay { uint id; uint productId; uint coverId; uint assessmentId; uint amount; string assetSymbol; uint assetIndex; uint coverStart; uint coverEnd; uint pollStart; uint pollEnd; uint claimStatus; uint payoutStatus; } /* ========== VIEWS ========== */ function claims(uint id) external view returns ( uint80 assessmentId, uint32 coverId, uint16 segmentId, uint96 amount, uint8 coverAsset, bool payoutRedeemed ); function config() external view returns ( uint8 payoutRedemptionPeriodInDays, uint16 minAssessmentDepositRatio, uint16 maxRewardRatio, uint16 rewardRatio ); function getClaimsCount() external view returns (uint); /* === MUTATIVE FUNCTIONS ==== */ function submitClaim( uint32 coverId, uint16 segmentId, uint96 requestedAmount, string calldata ipfsMetadata ) external payable returns (Claim memory); function submitClaimFor( uint32 coverId, uint16 segmentId, uint96 requestedAmount, string calldata ipfsMetadata, address owner ) external payable returns (Claim memory); function redeemClaimPayout(uint104 id) external; function updateUintParameters(UintParams[] calldata paramNames, uint[] calldata values) external; /* ========== EVENTS ========== */ event ClaimSubmitted(address indexed user, uint claimId, uint indexed coverId, uint productId); event MetadataSubmitted(uint indexed claimId, string ipfsMetadata); event ClaimPayoutRedeemed(address indexed user, uint amount, uint claimId, uint coverId); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface IMasterAwareV2 { // TODO: if you update this enum, update lib/constants.js as well enum ID { TC, // TokenController.sol P1, // Pool.sol MR, // MemberRoles.sol MC, // MCR.sol CO, // Cover.sol SP, // StakingProducts.sol PS, // LegacyPooledStaking.sol GV, // Governance.sol GW, // LegacyGateway.sol - removed CL, // CoverMigrator.sol - removed AS, // Assessment.sol CI, // IndividualClaims.sol - Claims for Individuals CG, // YieldTokenIncidents.sol - Claims for Groups RA, // Ramm.sol ST, // SafeTracker.sol CP // CoverProducts.sol } function changeMasterAddress(address masterAddress) external; function changeDependentContractAddress() external; function internalContracts(uint) external view returns (address payable); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface IMemberRoles { enum Role {Unassigned, AdvisoryBoard, Member, Owner, Auditor} function join(address _userAddress, uint nonce, bytes calldata signature) external payable; function switchMembership(address _newAddress) external; function switchMembershipAndAssets( address newAddress, uint[] calldata coverIds, uint[] calldata stakingTokenIds ) external; function switchMembershipOf(address member, address _newAddress) external; function totalRoles() external view returns (uint256); function changeAuthorized(uint _roleId, address _newAuthorized) external; function setKycAuthAddress(address _add) external; function members(uint _memberRoleId) external view returns (uint, address[] memory memberArray); function numberOfMembers(uint _memberRoleId) external view returns (uint); function authorized(uint _memberRoleId) external view returns (address); function roles(address _memberAddress) external view returns (uint[] memory); function checkRole(address _memberAddress, uint _roleId) external view returns (bool); function getMemberLengthForAllRoles() external view returns (uint[] memory totalMembers); function memberAtIndex(uint _memberRoleId, uint index) external view returns (address, bool); function membersLength(uint _memberRoleId) external view returns (uint); event MemberRole(uint256 indexed roleId, bytes32 roleName, string roleDescription); event MemberJoined(address indexed newMember, uint indexed nonce); event switchedMembership(address indexed previousMember, address indexed newMember, uint timeStamp); event MembershipWithdrawn(address indexed member, uint timestamp); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "./IPriceFeedOracle.sol"; struct SwapDetails { uint104 minAmount; uint104 maxAmount; uint32 lastSwapTime; // 2 decimals of precision. 0.01% -> 0.0001 -> 1e14 uint16 maxSlippageRatio; } struct Asset { address assetAddress; bool isCoverAsset; bool isAbandoned; } interface IPool { function swapOperator() external view returns (address); function getAsset(uint assetId) external view returns (Asset memory); function getAssets() external view returns (Asset[] memory); function transferAssetToSwapOperator(address asset, uint amount) external; function setSwapDetailsLastSwapTime(address asset, uint32 lastSwapTime) external; function getAssetSwapDetails(address assetAddress) external view returns (SwapDetails memory); function sendPayout(uint assetIndex, address payable payoutAddress, uint amount, uint ethDepositAmount) external; function sendEth(address payoutAddress, uint amount) external; function upgradeCapitalPool(address payable newPoolAddress) external; function priceFeedOracle() external view returns (IPriceFeedOracle); function getPoolValueInEth() external view returns (uint); function calculateMCRRatio(uint totalAssetValue, uint mcrEth) external pure returns (uint); function getInternalTokenPriceInAsset(uint assetId) external view returns (uint tokenPrice); function getInternalTokenPriceInAssetAndUpdateTwap(uint assetId) external returns (uint tokenPrice); function getTokenPrice() external view returns (uint tokenPrice); function getMCRRatio() external view returns (uint); function setSwapValue(uint value) external; }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface Aggregator { function decimals() external view returns (uint8); function latestAnswer() external view returns (int); } interface IPriceFeedOracle { struct OracleAsset { Aggregator aggregator; uint8 decimals; } function ETH() external view returns (address); function assets(address) external view returns (Aggregator, uint8); function getAssetToEthRate(address asset) external view returns (uint); function getAssetForEth(address asset, uint ethIn) external view returns (uint); function getEthForAsset(address asset, uint amount) external view returns (uint); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "./IPool.sol"; import "./ISAFURAToken.sol"; import "./ITokenController.sol"; interface IRamm { // storage structs struct Slot0 { uint128 nxmReserveA; uint128 nxmReserveB; } struct Slot1 { uint128 ethReserve; uint88 budget; uint32 updatedAt; bool swapPaused; // emergency pause } struct Observation { uint32 timestamp; uint112 priceCumulativeAbove; uint112 priceCumulativeBelow; } // memory structs struct State { uint nxmA; uint nxmB; uint eth; uint budget; uint ratchetSpeedB; uint timestamp; } struct Context { uint capital; uint supply; uint mcr; } struct CumulativePriceCalculationProps { uint previousEthReserve; uint currentEthReserve; uint previousNxmA; uint currentNxmA; uint previousNxmB; uint currentNxmB; uint previousTimestamp; uint observationTimestamp; } struct CumulativePriceCalculationTimes { uint secondsUntilBVAbove; uint secondsUntilBVBelow; uint timeElapsed; uint bvTimeBelow; uint bvTimeAbove; uint ratchetTimeAbove; uint ratchetTimeBelow; } /* ========== VIEWS ========== */ function getReserves() external view returns ( uint ethReserve, uint nxmA, uint nxmB, uint remainingBudget ); function getSpotPrices() external view returns (uint spotPriceA, uint spotPriceB); function getBookValue() external view returns (uint bookValue); function getInternalPrice() external view returns (uint internalPrice); /* ==== MUTATIVE FUNCTIONS ==== */ function updateTwap() external; function getInternalPriceAndUpdateTwap() external returns (uint internalPrice); function swap(uint nxmIn, uint minAmountOut, uint deadline) external payable returns (uint amountOut); function removeBudget() external; function setEmergencySwapPause(bool _swapPaused) external; /* ========== EVENTS AND ERRORS ========== */ event EthSwappedForNxm(address indexed member, uint ethIn, uint nxmOut); event NxmSwappedForEth(address indexed member, uint nxmIn, uint ethOut); event ObservationUpdated(uint32 timestamp, uint112 priceCumulativeAbove, uint112 priceCumulativeBelow); event BudgetRemoved(); event SwapPauseConfigured(bool paused); event EthInjected(uint value); event EthExtracted(uint value); // Pause error SystemPaused(); error SwapPaused(); // Input error OneInputOnly(); error OneInputRequired(); // Expiry error SwapExpired(uint deadline, uint blockTimestamp); // Insufficient amount out error InsufficientAmountOut(uint amountOut, uint minAmountOut); // Buffer Zone error NoSwapsInBufferZone(); // ETH Transfer error EthTransferFailed(); // Circuit breakers error EthCircuitBreakerHit(); error NxmCircuitBreakerHit(); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface ISAFURAMaster { function tokenAddress() external view returns (address); function owner() external view returns (address); function emergencyAdmin() external view returns (address); function masterInitialized() external view returns (bool); function isInternal(address _add) external view returns (bool); function isPause() external view returns (bool check); function isMember(address _add) external view returns (bool); function checkIsAuthToGoverned(address _add) external view returns (bool); function getLatestAddress(bytes2 _contractName) external view returns (address payable contractAddress); function contractAddresses(bytes2 code) external view returns (address payable); function upgradeMultipleContracts( bytes2[] calldata _contractCodes, address payable[] calldata newAddresses ) external; function removeContracts(bytes2[] calldata contractCodesToRemove) external; function addNewInternalContracts( bytes2[] calldata _contractCodes, address payable[] calldata newAddresses, uint[] calldata _types ) external; function updateOwnerParameters(bytes8 code, address payable val) external; }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface ISAFURAToken { function burn(uint256 amount) external returns (bool); function burnFrom(address from, uint256 value) external returns (bool); function operatorTransfer(address from, uint256 value) external returns (bool); function mint(address account, uint256 amount) external; function isLockedForMV(address member) external view returns (uint); function whiteListed(address member) external view returns (bool); function addToWhiteList(address _member) external returns (bool); function removeFromWhiteList(address _member) external returns (bool); function changeOperator(address _newOperator) external returns (bool); function lockForMemberVote(address _of, uint _days) external; /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool); /** * @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); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "@openzeppelin/contracts-v4/token/ERC721/IERC721.sol"; interface IStakingNFT is IERC721 { function isApprovedOrOwner(address spender, uint tokenId) external returns (bool); function mint(uint poolId, address to) external returns (uint tokenId); function changeOperator(address newOperator) external; function changeNFTDescriptor(address newNFTDescriptor) external; function totalSupply() external returns (uint); function tokenInfo(uint tokenId) external view returns (uint poolId, address owner); function stakingPoolOf(uint tokenId) external view returns (uint poolId); function stakingPoolFactory() external view returns (address); function name() external view returns (string memory); error NotOperator(); error NotMinted(); error WrongFrom(); error InvalidRecipient(); error InvalidNewOperatorAddress(); error InvalidNewNFTDescriptorAddress(); error NotAuthorized(); error UnsafeRecipient(); error AlreadyMinted(); error NotStakingPool(); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; /* structs for io */ struct AllocationRequest { uint productId; uint coverId; uint allocationId; uint period; uint gracePeriod; bool useFixedPrice; uint previousStart; uint previousExpiration; uint previousRewardsRatio; uint globalCapacityRatio; uint capacityReductionRatio; uint rewardRatio; uint globalMinPrice; } struct BurnStakeParams { uint allocationId; uint productId; uint start; uint period; uint deallocationAmount; } interface IStakingPool { /* structs for storage */ // stakers are grouped in tranches based on the timelock expiration // tranche index is calculated based on the expiration date // the initial proposal is to have 4 tranches per year (1 tranche per quarter) struct Tranche { uint128 stakeShares; uint128 rewardsShares; } struct ExpiredTranche { uint96 accNxmPerRewardShareAtExpiry; uint96 stakeAmountAtExpiry; // nxm total supply is 6.7e24 and uint96.max is 7.9e28 uint128 stakeSharesSupplyAtExpiry; } struct Deposit { uint96 lastAccNxmPerRewardShare; uint96 pendingRewards; uint128 stakeShares; uint128 rewardsShares; } function initialize( bool isPrivatePool, uint initialPoolFee, uint maxPoolFee, uint _poolId, string memory ipfsDescriptionHash ) external; function processExpirations(bool updateUntilCurrentTimestamp) external; function requestAllocation( uint amount, uint previousPremium, AllocationRequest calldata request ) external returns (uint premium, uint allocationId); function burnStake(uint amount, BurnStakeParams calldata params) external; function depositTo( uint amount, uint trancheId, uint requestTokenId, address destination ) external returns (uint tokenId); function withdraw( uint tokenId, bool withdrawStake, bool withdrawRewards, uint[] memory trancheIds ) external returns (uint withdrawnStake, uint withdrawnRewards); function isPrivatePool() external view returns (bool); function isHalted() external view returns (bool); function manager() external view returns (address); function getPoolId() external view returns (uint); function getPoolFee() external view returns (uint); function getMaxPoolFee() external view returns (uint); function getActiveStake() external view returns (uint); function getStakeSharesSupply() external view returns (uint); function getRewardsSharesSupply() external view returns (uint); function getRewardPerSecond() external view returns (uint); function getAccNxmPerRewardsShare() external view returns (uint); function getLastAccNxmUpdate() external view returns (uint); function getFirstActiveTrancheId() external view returns (uint); function getFirstActiveBucketId() external view returns (uint); function getNextAllocationId() external view returns (uint); function getDeposit(uint tokenId, uint trancheId) external view returns ( uint lastAccNxmPerRewardShare, uint pendingRewards, uint stakeShares, uint rewardsShares ); function getTranche(uint trancheId) external view returns ( uint stakeShares, uint rewardsShares ); function getExpiredTranche(uint trancheId) external view returns ( uint accNxmPerRewardShareAtExpiry, uint stakeAmountAtExpiry, uint stakeShareSupplyAtExpiry ); function setPoolFee(uint newFee) external; function setPoolPrivacy(bool isPrivatePool) external; function getActiveAllocations( uint productId ) external view returns (uint[] memory trancheAllocations); function getTrancheCapacities( uint productId, uint firstTrancheId, uint trancheCount, uint capacityRatio, uint reductionRatio ) external view returns (uint[] memory trancheCapacities); /* ========== EVENTS ========== */ event StakeDeposited(address indexed user, uint256 amount, uint256 trancheId, uint256 tokenId); event DepositExtended(address indexed user, uint256 tokenId, uint256 initialTrancheId, uint256 newTrancheId, uint256 topUpAmount); event PoolPrivacyChanged(address indexed manager, bool isPrivate); event PoolFeeChanged(address indexed manager, uint newFee); event PoolDescriptionSet(string ipfsDescriptionHash); event Withdraw(address indexed user, uint indexed tokenId, uint tranche, uint amountStakeWithdrawn, uint amountRewardsWithdrawn); event StakeBurned(uint amount); event Deallocated(uint productId); event BucketExpired(uint bucketId); event TrancheExpired(uint trancheId); // Auth error OnlyCoverContract(); error OnlyStakingProductsContract(); error OnlyManager(); error PrivatePool(); error SystemPaused(); error PoolHalted(); // Fees error PoolFeeExceedsMax(); error MaxPoolFeeAbove100(); // Voting error NxmIsLockedForGovernanceVote(); error ManagerNxmIsLockedForGovernanceVote(); // Deposit error InsufficientDepositAmount(); error RewardRatioTooHigh(); // Staking NFTs error InvalidTokenId(); error NotTokenOwnerOrApproved(); error InvalidStakingPoolForToken(); // Tranche & capacity error NewTrancheEndsBeforeInitialTranche(); error RequestedTrancheIsNotYetActive(); error RequestedTrancheIsExpired(); error InsufficientCapacity(); // Allocation error AlreadyDeallocated(uint allocationId); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface IStakingPoolFactory { function stakingPoolCount() external view returns (uint); function beacon() external view returns (address); function create(address beacon) external returns (uint poolId, address stakingPoolAddress); event StakingPoolCreated(uint indexed poolId, address indexed stakingPoolAddress); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; import "./ISAFURAToken.sol"; interface ITokenController { struct StakingPoolNXMBalances { uint128 rewards; uint128 deposits; } struct CoverInfo { uint16 claimCount; bool hasOpenClaim; bool hasAcceptedClaim; uint96 requestedPayoutAmount; // note: still 128 bits available here, can be used later } struct StakingPoolOwnershipOffer { address proposedManager; uint96 deadline; } function coverInfo(uint id) external view returns ( uint16 claimCount, bool hasOpenClaim, bool hasAcceptedClaim, uint96 requestedPayoutAmount ); function withdrawCoverNote( address _of, uint[] calldata _coverIds, uint[] calldata _indexes ) external; function changeOperator(address _newOperator) external; function operatorTransfer(address _from, address _to, uint _value) external returns (bool); function burnFrom(address _of, uint amount) external returns (bool); function addToWhitelist(address _member) external; function removeFromWhitelist(address _member) external; function mint(address _member, uint _amount) external; function lockForMemberVote(address _of, uint _days) external; function withdrawClaimAssessmentTokens(address[] calldata users) external; function getLockReasons(address _of) external view returns (bytes32[] memory reasons); function totalSupply() external view returns (uint); function totalBalanceOf(address _of) external view returns (uint amount); function totalBalanceOfWithoutDelegations(address _of) external view returns (uint amount); function getTokenPrice() external view returns (uint tokenPrice); function token() external view returns (ISAFURAToken); function getStakingPoolManager(uint poolId) external view returns (address manager); function getManagerStakingPools(address manager) external view returns (uint[] memory poolIds); function isStakingPoolManager(address member) external view returns (bool); function getStakingPoolOwnershipOffer(uint poolId) external view returns (address proposedManager, uint deadline); function transferStakingPoolsOwnership(address from, address to) external; function assignStakingPoolManager(uint poolId, address manager) external; function createStakingPoolOwnershipOffer(uint poolId, address proposedManager, uint deadline) external; function acceptStakingPoolOwnershipOffer(uint poolId) external; function cancelStakingPoolOwnershipOffer(uint poolId) external; function mintStakingPoolNXMRewards(uint amount, uint poolId) external; function burnStakingPoolNXMRewards(uint amount, uint poolId) external; function depositStakedNXM(address from, uint amount, uint poolId) external; function withdrawNXMStakeAndRewards(address to, uint stakeToWithdraw, uint rewardsToWithdraw, uint poolId) external; function burnStakedNXM(uint amount, uint poolId) external; function stakingPoolNXMBalances(uint poolId) external view returns(uint128 rewards, uint128 deposits); function tokensLocked(address _of, bytes32 _reason) external view returns (uint256 amount); function getWithdrawableCoverNotes( address coverOwner ) external view returns ( uint[] memory coverIds, bytes32[] memory lockReasons, uint withdrawableAmount ); function getPendingRewards(address member) external view returns (uint); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.18; /** * @dev Simple library that defines min, max and babylonian sqrt functions */ library Math { function min(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; } function max(uint a, uint b) internal pure returns (uint) { return a > b ? a : b; } function sum(uint[] memory items) internal pure returns (uint) { uint count = items.length; uint total; for (uint i = 0; i < count; i++) { total += items[i]; } return total; } function divRound(uint a, uint b) internal pure returns (uint) { return (a + b / 2) / b; } function divCeil(uint a, uint b) internal pure returns (uint) { return (a + b - 1) / b; } function roundUp(uint a, uint b) internal pure returns (uint) { return divCeil(a, b) * b; } // babylonian method function sqrt(uint y) internal pure returns (uint) { if (y > 3) { uint z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } return z; } if (y != 0) { return 1; } return 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; /** * @dev Wrappers over Solidity's uintXX casting operators with added overflow * checks. * * Downcasting from uint256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeUintCast { /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { require(value < 2**248, "SafeCast: value doesn\'t fit in 248 bits"); return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { require(value < 2**240, "SafeCast: value doesn\'t fit in 240 bits"); return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { require(value < 2**232, "SafeCast: value doesn\'t fit in 232 bits"); return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { require(value < 2**224, "SafeCast: value doesn\'t fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { require(value < 2**216, "SafeCast: value doesn\'t fit in 216 bits"); return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { require(value < 2**208, "SafeCast: value doesn\'t fit in 208 bits"); return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { require(value < 2**200, "SafeCast: value doesn\'t fit in 200 bits"); return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { require(value < 2**192, "SafeCast: value doesn\'t fit in 192 bits"); return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { require(value < 2**184, "SafeCast: value doesn\'t fit in 184 bits"); return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { require(value < 2**176, "SafeCast: value doesn\'t fit in 176 bits"); return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { require(value < 2**168, "SafeCast: value doesn\'t fit in 168 bits"); return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { require(value < 2**160, "SafeCast: value doesn\'t fit in 160 bits"); return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { require(value < 2**152, "SafeCast: value doesn\'t fit in 152 bits"); return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { require(value < 2**144, "SafeCast: value doesn\'t fit in 144 bits"); return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { require(value < 2**136, "SafeCast: value doesn\'t fit in 136 bits"); return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { require(value < 2**120, "SafeCast: value doesn\'t fit in 120 bits"); return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { require(value < 2**112, "SafeCast: value doesn\'t fit in 112 bits"); return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { require(value < 2**104, "SafeCast: value doesn\'t fit in 104 bits"); return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { require(value < 2**96, "SafeCast: value doesn\'t fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { require(value < 2**88, "SafeCast: value doesn\'t fit in 88 bits"); return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { require(value < 2**80, "SafeCast: value doesn\'t fit in 80 bits"); return uint80(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { require(value < 2**56, "SafeCast: value doesn\'t fit in 56 bits"); return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { require(value < 2**48, "SafeCast: value doesn\'t fit in 48 bits"); return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { require(value < 2**40, "SafeCast: value doesn\'t fit in 40 bits"); return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { require(value < 2**24, "SafeCast: value doesn\'t fit in 24 bits"); return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits"); return uint8(value); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"inputs":[{"internalType":"address","name":"nxmAddress","type":"address"},{"internalType":"address","name":"coverNFTAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"coverId","type":"uint256"}],"name":"ClaimPayoutRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"coverId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"productId","type":"uint256"}],"name":"ClaimSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"claimId","type":"uint256"},{"indexed":false,"internalType":"string","name":"ipfsMetadata","type":"string"}],"name":"MetadataSubmitted","type":"event"},{"inputs":[],"name":"changeDependentContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"masterAddress","type":"address"}],"name":"changeMasterAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claims","outputs":[{"internalType":"uint80","name":"assessmentId","type":"uint80"},{"internalType":"uint32","name":"coverId","type":"uint32"},{"internalType":"uint16","name":"segmentId","type":"uint16"},{"internalType":"uint96","name":"amount","type":"uint96"},{"internalType":"uint8","name":"coverAsset","type":"uint8"},{"internalType":"bool","name":"payoutRedeemed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"uint8","name":"payoutRedemptionPeriodInDays","type":"uint8"},{"internalType":"uint16","name":"minAssessmentDepositRatio","type":"uint16"},{"internalType":"uint16","name":"maxRewardInNXMWad","type":"uint16"},{"internalType":"uint16","name":"rewardRatio","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"coverNFT","outputs":[{"internalType":"contract ICoverNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"uint256","name":"segmentPeriod","type":"uint256"},{"internalType":"uint256","name":"coverAsset","type":"uint256"}],"name":"getAssessmentDepositAndReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getClaimsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"getClaimsToDisplay","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"productId","type":"uint256"},{"internalType":"uint256","name":"coverId","type":"uint256"},{"internalType":"uint256","name":"assessmentId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"assetSymbol","type":"string"},{"internalType":"uint256","name":"assetIndex","type":"uint256"},{"internalType":"uint256","name":"coverStart","type":"uint256"},{"internalType":"uint256","name":"coverEnd","type":"uint256"},{"internalType":"uint256","name":"pollStart","type":"uint256"},{"internalType":"uint256","name":"pollEnd","type":"uint256"},{"internalType":"uint256","name":"claimStatus","type":"uint256"},{"internalType":"uint256","name":"payoutStatus","type":"uint256"}],"internalType":"struct IIndividualClaims.ClaimDisplay[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"internalContracts","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastClaimSubmissionOnCover","outputs":[{"internalType":"uint80","name":"claimId","type":"uint80"},{"internalType":"bool","name":"exists","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"master","outputs":[{"internalType":"contract ISAFURAMaster","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nxm","outputs":[{"internalType":"contract ISAFURAToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint104","name":"claimId","type":"uint104"}],"name":"redeemClaimPayout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"coverId","type":"uint32"},{"internalType":"uint16","name":"segmentId","type":"uint16"},{"internalType":"uint96","name":"requestedAmount","type":"uint96"},{"internalType":"string","name":"ipfsMetadata","type":"string"}],"name":"submitClaim","outputs":[{"components":[{"internalType":"uint80","name":"assessmentId","type":"uint80"},{"internalType":"uint32","name":"coverId","type":"uint32"},{"internalType":"uint16","name":"segmentId","type":"uint16"},{"internalType":"uint96","name":"amount","type":"uint96"},{"internalType":"uint8","name":"coverAsset","type":"uint8"},{"internalType":"bool","name":"payoutRedeemed","type":"bool"}],"internalType":"struct IIndividualClaims.Claim","name":"claim","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"coverId","type":"uint32"},{"internalType":"uint16","name":"segmentId","type":"uint16"},{"internalType":"uint96","name":"requestedAmount","type":"uint96"},{"internalType":"string","name":"ipfsMetadata","type":"string"},{"internalType":"address","name":"owner","type":"address"}],"name":"submitClaimFor","outputs":[{"components":[{"internalType":"uint80","name":"assessmentId","type":"uint80"},{"internalType":"uint32","name":"coverId","type":"uint32"},{"internalType":"uint16","name":"segmentId","type":"uint16"},{"internalType":"uint96","name":"amount","type":"uint96"},{"internalType":"uint8","name":"coverAsset","type":"uint8"},{"internalType":"bool","name":"payoutRedeemed","type":"bool"}],"internalType":"struct IIndividualClaims.Claim","name":"claim","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum IIndividualClaims.UintParams[]","name":"paramNames","type":"uint8[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"updateUintParameters","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x6080604052600436106100f35760003560e01c806379502c551161008a578063d46655f411610059578063d46655f41461040f578063db4ebb041461042f578063eb96236014610442578063ee97f7f31461047857600080fd5b806379502c55146102b45780638b79b22d1461031c578063a888c2cd1461037d578063c8d0421f146103ef57600080fd5b80635465ab5a116100c65780635465ab5a146101b257806355732a69146101e7578063745f409d1461026757806376fe67541461029457600080fd5b80630ea9c984146100f857806330e45f051461010f5780633ef8f2ba1461016057806342e53fcf1461017e575b600080fd5b34801561010457600080fd5b5061010d610498565b005b34801561011b57600080fd5b506101437f00000000000000000000000066b90ccff8d22eafc948f263863dc80bf12c1f3681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016c57600080fd5b50600354604051908152602001610157565b34801561018a57600080fd5b506101437f00000000000000000000000005967d134893d9b3f05d4acdbf945b410f7983d081565b3480156101be57600080fd5b506101d26101cd366004612e11565b610a33565b60408051928352602083019190915201610157565b6101fa6101f5366004612ed4565b610c2f565b6040516101579190600060c0820190506001600160501b03835116825263ffffffff602084015116602083015261ffff60408401511660408301526001600160601b03606084015116606083015260ff608084015116608083015260a0830151151560a083015292915050565b34801561027357600080fd5b50610287610282366004612fa5565b610daa565b6040516101579190613036565b3480156102a057600080fd5b5061010d6102af366004613124565b610e6e565b3480156102c057600080fd5b506002546102ee9060ff81169061ffff610100820481169163010000008104821691600160281b9091041684565b6040805160ff909516855261ffff938416602086015291831691840191909152166060820152608001610157565b34801561032857600080fd5b5061035e61033736600461318f565b6004602052600090815260409020546001600160501b03811690600160501b900460ff1682565b604080516001600160501b039093168352901515602083015201610157565b34801561038957600080fd5b5061039d61039836600461318f565b61119c565b604080516001600160501b03909716875263ffffffff909516602087015261ffff909316938501939093526001600160601b0316606084015260ff9091166080830152151560a082015260c001610157565b3480156103fb57600080fd5b5061010d61040a3660046131a8565b611206565b34801561041b57600080fd5b5061010d61042a3660046131d1565b61189e565b6101fa61043d3660046131ee565b611918565b34801561044e57600080fd5b5061014361045d36600461318f565b6001602052600090815260409020546001600160a01b031681565b34801561048457600080fd5b50600054610143906001600160a01b031681565b6000546040516227050b60e31b815261544360f01b60048201526001600160a01b0390911690630138285890602401602060405180830381865afa1580156104e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105089190613269565b600080805260016020527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4980546001600160a01b039384166001600160a01b0319909116179055546040516227050b60e31b81526126a960f11b6004820152911690630138285890602401602060405180830381865afa158015610590573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b49190613269565b6002600090815260016020527fd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f80546001600160a01b039384166001600160a01b0319909116179055546040516227050b60e31b815261503160f01b6004820152911690630138285890602401602060405180830381865afa15801561063e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106629190613269565b600160008181526020919091527fcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f80546001600160a01b039384166001600160a01b0319909116179055546040516227050b60e31b815261434f60f01b6004820152911690630138285890602401602060405180830381865afa1580156106ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107119190613269565b6004600081815260016020527fedc95719e9a3b28dd8e80877cb5880a9be7de1a13fc8b05e7999683b6b56764380546001600160a01b039485166001600160a01b0319909116179055546040516227050b60e31b815261415360f01b9281019290925290911690630138285890602401602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c29190613269565b600a600090815260016020527f2a32391a76c35a36352b711f9152c0d0a340cd686850c8ef25fbb11c71b89e7b80546001600160a01b039384166001600160a01b0319909116179055546040516227050b60e31b815261524160f01b6004820152911690630138285890602401602060405180830381865afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108709190613269565b600d600090815260016020527f86b3fa87ee245373978e0d2d334dbde866c9b8b039036b87c5eb2fd89bcb6bab80546001600160a01b039384166001600160a01b0319909116179055546040516227050b60e31b815261043560f41b6004820152911690630138285890602401602060405180830381865afa1580156108fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091e9190613269565b600f6000908152600160209081527f12bd632ff333b55931f9f8bda8b4ed27e86687f88c95871969d72474fb428c1480546001600160a01b03949094166001600160a01b0319909416939093179092556040805160808101825260025460ff8116825261ffff6101008204818116848801526301000000830480831685870152600160281b84049283166060860152945160f092831b6001600160f01b03199081169882019890985294821b87166022860152901b909416602483015260f89390931b6001600160f81b03191660268201528190602701604051602081830303815290604052610a0d9061329c565b1490508015610a2f576002805466ffffffffffffff19166582003200641e1790555b5050565b6000806000610a40611bb4565b60405163c78557dd60e01b81526000600482018190529192506001600160a01b0383169063c78557dd90602401602060405180830381865afa158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae91906132c3565b905060008515610b265760405163c78557dd60e01b8152600481018790526001600160a01b0384169063c78557dd90602401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2191906132c3565b610b28565b815b9050600081610b3f670de0b6b3a76400008b6132f2565b610b499190613309565b600254909150600090610bbb90610b7490670de0b6b3a7640000906301000000900461ffff166132f2565b600254612710906301e13380908d90610b9890600160281b900461ffff16886132f2565b610ba291906132f2565b610bac9190613309565b610bb69190613309565b611bda565b90506000670de0b6b3a7640000610bd286846132f2565b610bdc9190613309565b60025490915060009061271090610c0490610100900461ffff16670de0b6b3a76400006132f2565b610c0e9190613309565b90506000610c1c8284611bf2565b9d939c50929a5050505050505050505050565b610c37612d74565b6000546040516323c5b10760e21b81523360048201526001600160a01b0390911690638f16c41c90602401602060405180830381865afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca39190613340565b610cff5760405162461bcd60e51b815260206004820152602260248201527f43616c6c6572206973206e6f7420616e20696e7465726e616c20636f6e74726160448201526118dd60f21b60648201526084015b60405180910390fd5b60008054906101000a90046001600160a01b03166001600160a01b031663ff0938a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d749190613340565b15610d915760405162461bcd60e51b8152600401610cf69061335b565b610d9f878787878787611c01565b979650505050505050565b60606000826001600160401b03811115610dc657610dc6613385565b604051908082528060200260200182016040528015610dff57816020015b610dec612da9565b815260200190600190039081610de45790505b50905060005b83811015610e64576000858583818110610e2157610e2161339b565b905060200201359050610e338161270f565b838381518110610e4557610e4561339b565b6020026020010181905250508080610e5c906133b1565b915050610e05565b5090505b92915050565b600054604051632c1a733d60e11b81523360048201526001600160a01b0390911690635834e67a90602401602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190613340565b610f315760405162461bcd60e51b815260206004820152602260248201527f43616c6c6572206973206e6f7420617574686f72697a656420746f20676f7665604482015261393760f11b6064820152608401610cf6565b6040805160808101825260025460ff8116825261ffff61010082048116602084015263010000008204811693830193909352600160281b9004909116606082015260005b8481101561112f576000868683818110610f9157610f9161339b565b9050602002016020810190610fa691906133ca565b6003811115610fb757610fb7613286565b03610fe157838382818110610fce57610fce61339b565b602002919091013560ff1683525061111d565b6003868683818110610ff557610ff561339b565b905060200201602081019061100a91906133ca565b600381111561101b5761101b613286565b03611049578383828181106110325761103261339b565b602002919091013561ffff1660608401525061111d565b600286868381811061105d5761105d61339b565b905060200201602081019061107291906133ca565b600381111561108357611083613286565b036110b15783838281811061109a5761109a61339b565b602002919091013561ffff1660408401525061111d565b60018686838181106110c5576110c561339b565b90506020020160208101906110da91906133ca565b60038111156110eb576110eb613286565b0361111d578383828181106111025761110261339b565b90506020020135826020019061ffff16908161ffff16815250505b80611127816133b1565b915050610f75565b508051600280546020840151604085015160609095015160ff90941662ffffff199092169190911761010061ffff928316021766ffffffff000000191663010000009482169490940266ffff0000000000191693909317600160281b939092169290920217905550505050565b600381815481106111ac57600080fd5b6000918252602090912001546001600160501b038116915063ffffffff600160501b8204169061ffff600160701b820416906001600160601b03600160801b8204169060ff600160e01b8204811691600160e81b90041686565b60008054906101000a90046001600160a01b03166001600160a01b031663ff0938a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127b9190613340565b156112985760405162461bcd60e51b8152600401610cf69061335b565b60006003826001600160681b0316815481106112b6576112b661339b565b600091825260208083206040805160c08101825293909101546001600160501b038116845263ffffffff600160501b8204169284019290925261ffff600160701b830416908301526001600160601b03600160801b820416606083015260ff600160e01b820481166080840152600160e81b90910416151560a082015291508061133e612ca4565b835160405163275b51d960e11b81526001600160501b0390911660048201526001600160a01b039190911690634eb6a3b29060240160c060405180830381865afa158015611390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b491906134d6565b6001600160801b03169250509150816060015163ffffffff164210156114265760405162461bcd60e51b815260206004820152602160248201527f54686520636c61696d206973207374696c6c206265696e6720617373657373656044820152601960fa1b6064820152608401610cf6565b81602001516001600160601b031682600001516001600160601b03161161148f5760405162461bcd60e51b815260206004820152601e60248201527f54686520636c61696d206e6565647320746f20626520616363657074656400006044820152606401610cf6565b6000611499612ca4565b6001600160a01b03166379502c556040518163ffffffff1660e01b8152600401608060405180830381865afa1580156114d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fa919061352b565b509250505060008160ff166201518061151391906132f2565b905080846060015163ffffffff1661152b919061357f565b42101561157a5760405162461bcd60e51b815260206004820152601f60248201527f54686520636c61696d20697320696e20636f6f6c646f776e20706572696f64006044820152606401610cf6565b60025461158d9060ff16620151806132f2565b81856060015163ffffffff166115a3919061357f565b6115ad919061357f565b42106116055760405162461bcd60e51b815260206004820152602160248201527f54686520726564656d7074696f6e20706572696f6420686173206578706972656044820152601960fa1b6064820152608401610cf6565b8460a00151156116575760405162461bcd60e51b815260206004820181905260248201527f5061796f75742068617320616c7265616479206265656e2072656465656d65646044820152606401610cf6565b60016003876001600160681b0316815481106116755761167561339b565b60009182526020909120018054911515600160e81b0260ff60e81b199092169190911790556116a2612cb0565b6001600160a01b0316638516e6dc6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156116dc57600080fd5b505af11580156116f0573d6000803e3d6000fd5b5050505060006116fe612cbc565b602087015160408089015160608a01519151636d18082f60e11b815263ffffffff909316600484015261ffff1660248301526001600160601b031660448201526001600160a01b03919091169063da30105e906064016020604051808303816000875af1158015611773573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117979190613269565b90506117a1611bb4565b6080870151606088015160405163a278bd4d60e01b815260ff90921660048301526001600160a01b0384811660248401526001600160601b03909116604483015260648201879052919091169063a278bd4d90608401600060405180830381600087803b15801561181157600080fd5b505af1158015611825573d6000803e3d6000fd5b50505050606086810151602080890151604080516001600160601b0390941684526001600160681b038c169284019290925263ffffffff1682820152516001600160a01b038416927f2646ef0fdbfdc9fe1b2e036b0f9fbca0c5212fbc156322fe666ec8fb8a9529c1928290030190a250505050505050565b6000546001600160a01b0316156118f6576000546001600160a01b031633146118f65760405162461bcd60e51b815260206004820152600a6024820152692737ba1036b0b9ba32b960b11b6044820152606401610cf6565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b611920612d74565b6002600081905260016020527fd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f5460405163505ef22f60e01b815233600482015260248101929092526001600160a01b03169063505ef22f90604401602060405180830381865afa158015611999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bd9190613340565b611a025760405162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba10309036b2b6b132b960511b6044820152606401610cf6565b60008054906101000a90046001600160a01b03166001600160a01b031663ff0938a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a779190613340565b15611a945760405162461bcd60e51b8152600401610cf69061335b565b60405163430c208160e01b815233600482015263ffffffff871660248201527f00000000000000000000000005967d134893d9b3f05d4acdbf945b410f7983d06001600160a01b03169063430c2081906044016020604051808303816000875af1158015611b06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2a9190613340565b611b9c5760405162461bcd60e51b815260206004820152603760248201527f4f6e6c7920746865206f776e6572206f7220617070726f76656420616464726560448201527f737365732063616e207375626d6974206120636c61696d0000000000000000006064820152608401610cf6565b611baa868686868633611c01565b9695505050505050565b6000600181815b81526020810191909152604001600020546001600160a01b0316919050565b6000818310611be95781611beb565b825b9392505050565b6000818311611be95781611beb565b611c09612d74565b63ffffffff87166000908152600460209081526040918290208251808401909352546001600160501b0381168352600160501b900460ff1615801591830191909152611ea9576000600382600001516001600160501b031681548110611c7157611c7161339b565b60009182526020822001546001600160501b03169150611c8f612ca4565b604051630d465e5560e11b81526001600160501b03841660048201526001600160a01b039190911690631a8cbcaa90602401608060405180830381865afa158015611cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d029190613592565b90506000611d0e612ca4565b6001600160a01b03166379502c556040518163ffffffff1660e01b8152600401608060405180830381865afa158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6f919061352b565b509250505060008160ff1662015180611d8891906132f2565b905080836060015163ffffffff16611da0919061357f565b4210611e525782602001516001600160601b031683600001516001600160601b0316118015611e005750600254611ddd9060ff16620151806132f2565b81846060015163ffffffff16611df3919061357f565b611dfd919061357f565b42105b15611e4d5760405162461bcd60e51b815260206004820152601e60248201527f41207061796f75742063616e207374696c6c2062652072656465656d656400006044820152606401610cf6565b611ea4565b60405162461bcd60e51b815260206004820152602160248201527f4120636c61696d20697320616c7265616479206265696e6720617373657373656044820152601960fa1b6064820152608401610cf6565b505050505b506040805180820182526003546001600160501b0390811682526001602080840191825263ffffffff8c16600090815260049091529384209251835491511515600160501b026affffffffffffffffffffff19909216921691909117179055611f10612cc8565b90506000611f1c612cbc565b60405163bce2a88360e01b815263ffffffff8b1660048201526001600160a01b03919091169063bce2a88390602401606060405180830381865afa158015611f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8c91906135c1565b90506000611f98612cbc565b60405163ccfa4b7960e01b815263ffffffff8c16600482015261ffff8b1660248201526001600160a01b03919091169063ccfa4b799060440160c060405180830381865afa158015611fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120129190613611565b82516040516302db1c0360e61b815262ffffff90911660048201529091506000906001600160a01b0385169063b6c700c09060240161012060405180830381865afa158015612065573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120899190613722565b805190925060ff161590506120f35760405162461bcd60e51b815260206004820152602a60248201527f496e76616c696420636c61696d206d6574686f6420666f7220746869732070726044820152696f64756374207479706560b01b6064820152608401610cf6565b81600001516001600160601b0316896001600160601b031611156121595760405162461bcd60e51b815260206004820152601760248201527f436f766572656420616d6f756e742065786365656465640000000000000000006044820152606401610cf6565b816020015163ffffffff1642116121ce5760405162461bcd60e51b815260206004820152603360248201527f43616e6e6f742062757920636f76657220616e64207375626d697420636c61696044820152726d20696e207468652073616d6520626c6f636b60681b6064820152608401610cf6565b42826060015163ffffffff16836040015163ffffffff16846020015163ffffffff166121fa919061357f565b612204919061357f565b1161225b5760405162461bcd60e51b815260206004820152602160248201527f436f766572206973206f7574736964652074686520677261636520706572696f6044820152601960fa1b6064820152608401610cf6565b60035483516040805192835262ffffff909116602083015263ffffffff8d16916001600160a01b038916917f199cf6ad2e6ce4f20f4f77bf95042862858fe7b5fb2240b17ec190107e6b41e8910160405180910390a3506000806122da8a6001600160601b0316846040015163ffffffff16866020015160ff16610a33565b9150915060006122e8612ca4565b60405163f6e0f60b60e01b815260048101849052602481018590526001600160a01b03919091169063f6e0f60b906044016020604051808303816000875af1158015612338573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061235c91906132c3565b905060006040518060c0016040528061237484612cd4565b6001600160501b031681526020018f63ffffffff1681526020018e61ffff1681526020018d6001600160601b03168152602001876020015160ff1681526020016000151581525090506003819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a8154816001600160501b0302191690836001600160501b03160217905550602082015181600001600a6101000a81548163ffffffff021916908363ffffffff160217905550604082015181600001600e6101000a81548161ffff021916908361ffff16021790555060608201518160000160106101000a8154816001600160601b0302191690836001600160601b03160217905550608082015181600001601c6101000a81548160ff021916908360ff16021790555060a082015181600001601d6101000a81548160ff021916908315150217905550505060008b8b90501115612521576003546124e7906001906137df565b7f0713a463db90dc47d4ffff96cdf194d43d0d76e0ef6ff8334ad14505f1a4df068c8c6040516125189291906137f2565b60405180910390a25b8334101561257c5760405162461bcd60e51b815260206004820152602260248201527f4173736573736d656e74206465706f73697420697320696e73756666696369656044820152611b9d60f21b6064820152608401610cf6565b8334111561263e5760006001600160a01b038a1661259a86346137df565b604051600081818185875af1925050503d80600081146125d6576040519150601f19603f3d011682016040523d82523d6000602084013e6125db565b606091505b505090508061263c5760405162461bcd60e51b815260206004820152602760248201527f4173736573736d656e74206465706f7369742065786365737320726566756e646044820152660819985a5b195960ca1b6064820152608401610cf6565b505b600061264a6001612d3c565b6001600160a01b03168560405160006040518083038185875af1925050503d8060008114612694576040519150601f19603f3d011682016040523d82523d6000602084013e612699565b606091505b50509050806126fd5760405162461bcd60e51b815260206004820152602a60248201527f4173736573736d656e74206465706f736974207472616e7366657220746f20706044820152691bdbdb0819985a5b195960b21b6064820152608401610cf6565b509d9c50505050505050505050505050565b612717612da9565b60006003838154811061272c5761272c61339b565b600091825260208083206040805160c08101825293909101546001600160501b038116845263ffffffff600160501b8204169284019290925261ffff600160701b830416908301526001600160601b03600160801b820416606083015260ff600160e01b820481166080840152600160e81b90910416151560a082015291506127b3612ca4565b825160405163275b51d960e11b81526001600160501b0390911660048201526001600160a01b039190911690634eb6a3b29060240160c060405180830381865afa158015612805573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282991906134d6565b50509050600080826060015163ffffffff1642106128715782602001516001600160601b031683600001516001600160601b0316111561286c5760019150612871565b600291505b600182600281111561288557612885613286565b03612961578360a001511561289c5750600161297e565b60006128a6612ca4565b6001600160a01b03166379502c556040518163ffffffff1660e01b8152600401608060405180830381865afa1580156128e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612907919061352b565b50600254909350612921925060ff169050620151806132f2565b61293160ff8316620151806132f2565b856060015163ffffffff16612946919061357f565b612950919061357f565b421061295b57600291505b5061297e565b600282600281111561297557612975613286565b0361297e575060035b6000612988612cbc565b602086015160405163bce2a88360e01b815263ffffffff90911660048201526001600160a01b03919091169063bce2a88390602401606060405180830381865afa1580156129da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129fe91906135c1565b90506000612a0a612cbc565b6020870151604080890151905163ccfa4b7960e01b815263ffffffff909216600483015261ffff1660248201526001600160a01b03919091169063ccfa4b799060440160c060405180830381865afa158015612a6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8e9190613611565b9050600081604001518260200151612aa69190613821565b63ffffffff1690506060876080015160ff16600003612adf575060408051808201909152600381526208aa8960eb1b6020820152612bcb565b6000612ae9611bb4565b60808a0151604051631d591eb760e31b815260ff90911660048201526001600160a01b03919091169063eac8f5b890602401606060405180830381865afa158015612b38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5c9190613845565b600001519050806001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa925050508015612bc157506040513d6000823e601f3d908101601f19168201604052612bbe9190810190613889565b60015b15612bc95791505b505b604051806101a001604052808b8152602001856000015162ffffff168152602001896020015163ffffffff16815260200189600001516001600160501b0316815260200189606001516001600160601b03168152602001828152602001896080015160ff168152602001846020015163ffffffff168152602001838152602001886040015163ffffffff168152602001886060015163ffffffff168152602001876002811115612c7d57612c7d613286565b8152602001866003811115612c9457612c94613286565b90529a9950505050505050505050565b6000600181600a611bbb565b6000600181600d611bbb565b60006001816004611bbb565b6000600181600f611bbb565b6000600160501b8210612d385760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203860448201526530206269747360d01b6064820152608401610cf6565b5090565b60006001600083600f811115612d5457612d54613286565b81526020810191909152604001600020546001600160a01b031692915050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600080600060608486031215612e2657600080fd5b505081359360208301359350604090920135919050565b63ffffffff81168114612e4f57600080fd5b50565b61ffff81168114612e4f57600080fd5b6001600160601b0381168114612e4f57600080fd5b60008083601f840112612e8957600080fd5b5081356001600160401b03811115612ea057600080fd5b602083019150836020828501011115612eb857600080fd5b9250929050565b6001600160a01b0381168114612e4f57600080fd5b60008060008060008060a08789031215612eed57600080fd5b8635612ef881612e3d565b95506020870135612f0881612e52565b94506040870135612f1881612e62565b935060608701356001600160401b03811115612f3357600080fd5b612f3f89828a01612e77565b9094509250506080870135612f5381612ebf565b809150509295509295509295565b60008083601f840112612f7357600080fd5b5081356001600160401b03811115612f8a57600080fd5b6020830191508360208260051b8501011115612eb857600080fd5b60008060208385031215612fb857600080fd5b82356001600160401b03811115612fce57600080fd5b612fda85828601612f61565b90969095509350505050565b60005b83811015613001578181015183820152602001612fe9565b50506000910152565b60008151808452613022816020860160208601612fe6565b601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561311657603f1989840301855281516101a081518552888201518986015287820151888601526060808301518187015250608080830151818701525060a08083015182828801526130b48388018261300a565b60c0858101519089015260e080860151908901526101008086015190890152610120808601519089015261014080860151908901526101608086015190890152610180948501519490970193909352505050938601939086019060010161305d565b509098975050505050505050565b6000806000806040858703121561313a57600080fd5b84356001600160401b038082111561315157600080fd5b61315d88838901612f61565b9096509450602087013591508082111561317657600080fd5b5061318387828801612f61565b95989497509550505050565b6000602082840312156131a157600080fd5b5035919050565b6000602082840312156131ba57600080fd5b81356001600160681b0381168114611beb57600080fd5b6000602082840312156131e357600080fd5b8135611beb81612ebf565b60008060008060006080868803121561320657600080fd5b853561321181612e3d565b9450602086013561322181612e52565b9350604086013561323181612e62565b925060608601356001600160401b0381111561324c57600080fd5b61325888828901612e77565b969995985093965092949392505050565b60006020828403121561327b57600080fd5b8151611beb81612ebf565b634e487b7160e01b600052602160045260246000fd5b805160208083015191908110156132bd576000198160200360031b1b821691505b50919050565b6000602082840312156132d557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610e6857610e686132dc565b60008261332657634e487b7160e01b600052601260045260246000fd5b500490565b8051801515811461333b57600080fd5b919050565b60006020828403121561335257600080fd5b611beb8261332b565b60208082526010908201526f14de5cdd195b481a5cc81c185d5cd95960821b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016133c3576133c36132dc565b5060010190565b6000602082840312156133dc57600080fd5b813560048110611beb57600080fd5b604051606081016001600160401b038111828210171561340d5761340d613385565b60405290565b60405160e081016001600160401b038111828210171561340d5761340d613385565b60006080828403121561344757600080fd5b604051608081018181106001600160401b038211171561346957613469613385565b8060405250809150825161347c81612e62565b8152602083015161348c81612e62565b6020820152604083015161349f81612e3d565b604082015260608301516134b281612e3d565b6060919091015292915050565b80516001600160801b038116811461333b57600080fd5b600080600060c084860312156134eb57600080fd5b6134f58585613435565b9250613503608085016134bf565b915061351160a085016134bf565b90509250925092565b805160ff8116811461333b57600080fd5b6000806000806080858703121561354157600080fd5b61354a8561351a565b93506135586020860161351a565b92506135666040860161351a565b91506135746060860161351a565b905092959194509250565b80820180821115610e6857610e686132dc565b6000608082840312156135a457600080fd5b611beb8383613435565b805162ffffff8116811461333b57600080fd5b6000606082840312156135d357600080fd5b6135db6133eb565b6135e4836135ae565b81526135f26020840161351a565b6020820152604083015161360581612e62565b60408201529392505050565b600060c0828403121561362357600080fd5b60405160c081018181106001600160401b038211171561364557613645613385565b604052825161365381612e62565b8152602083015161366381612e3d565b6020820152604083015161367681612e3d565b6040820152606083015161368981612e3d565b606082015261369a608084016135ae565b60808201526136ab60a084016135ae565b60a08201529392505050565b805161333b81612e52565b6000604082840312156136d457600080fd5b604051604081018181106001600160401b03821117156136f6576136f6613385565b6040529050806137058361351a565b8152602083015161371581612e3d565b6020919091015292915050565b60008082840361012081121561373757600080fd5b60e081121561374557600080fd5b5061374e613413565b835161375981612e52565b8152602084015161376981612ebf565b6020820152604084015161377c81612e3d565b6040820152606084015161378f81612e52565b60608201526137a0608085016136b7565b60808201526137b160a0850161332b565b60a08201526137c260c0850161332b565b60c082015291506137d68460e085016136c2565b90509250929050565b81810381811115610e6857610e686132dc565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b63ffffffff81811683821601908082111561383e5761383e6132dc565b5092915050565b60006060828403121561385757600080fd5b61385f6133eb565b825161386a81612ebf565b81526138786020840161332b565b60208201526136056040840161332b565b60006020828403121561389b57600080fd5b81516001600160401b03808211156138b257600080fd5b818401915084601f8301126138c657600080fd5b8151818111156138d8576138d8613385565b604051601f8201601f19908116603f0116810190838211818310171561390057613900613385565b8160405282815287602084870101111561391957600080fd5b610d9f836020830160208801612fe656fea2646970667358221220389be6a3f911751943d31ffe1d62d800699bbaff1879297a65c458311b9a69f664736f6c63430008120033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.