Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce GuaranteeAllocation and GuaranteeOutcome #10

Closed
wants to merge 1 commit into from
Closed

Conversation

geoknee
Copy link
Contributor

@geoknee geoknee commented May 6, 2021

These TS types will be useful in constructing arguments to supply to the forthcoming claim function.

That function should have a signature something along the lines of:

    /**
     * @dev Computes the new outcome that should be stored against a target channel after a claim is made on its guarantor.
     * @param initialGuaranteeOutcome the outcome containing at least one guarantee(s) which will be claimed for each asset.
     * @param initialHoldings initial quantity of each asset held on chain for the guarantor channel. Order matches that of initialGuaranteeOutcome.
     * @param targetChannel the index of the guarantee in the list of guarantees for the given asset -- equivalent to declaring a target channel
     * @param targetOutcome initial outcome stored on chain for the target channel.
     * @param indices list of list of indices expressing which destinations in the allocation should be paid out for each asset.

     */
    function claim(
        ExitFormat.SingleAssetExit[] memory initialGuaranteeOutcome,
        uint256[] memory initialHoldings,
        uint48 targetChannel,
        ExitFormat.SingleAssetExit[] memory initialTargetOutcome,
        uint48[][] memory exitRequest
    )
        public
        pure
        returns (
            ExitFormat.SingleAssetExit[] memory updatedTargetOutcome,
            uint256[] memory updatedHoldings,
            ExitFormat.SingleAssetExit[] memory exit
        )

The method should revert if:

  • the guarantee is not of the correct format (e.g. does not use the magic constant)
  • export const MAGIC_VALUE_DENOTING_A_GUARANTEE =
    "0x0000000000000000000000000000000000000001";
  • the targetOutcome is not of the correct format (e.g. does use the magic constant)

@geoknee
Copy link
Contributor Author

geoknee commented May 7, 2021

in favour of #13

@geoknee geoknee closed this May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant