Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

How to use auto permit(allowance) when operating the position? #9

Open
leyafo opened this issue Jun 8, 2022 · 2 comments
Open

How to use auto permit(allowance) when operating the position? #9

leyafo opened this issue Jun 8, 2022 · 2 comments

Comments

@leyafo
Copy link
Contributor

leyafo commented Jun 8, 2022

Hi, guys. Thanks for sharing this SDK.

I have a question about auto perimting allowance when calling mutilcall. I saw two parameters (Token0Permit, Token1Permit) in CommonAddLiquidityOptions:

//  Options for producing the calldata to add liquidity
type CommonAddLiquidityOptions struct {
	SlippageTolerance *core.Percent  // How much the pool price is allowed to move
	Deadline          *big.Int       // When the transaction expires, in epoch seconds
	UseNative         *core.Ether    // Whether to spend ether. If true, one of the pool tokens must be WETH, by default false
	Token0Permit      *PermitOptions // The optional permit parameters for spending token0
	Token1Permit      *PermitOptions // The optional permit parameters for spending token1
}

These two permit parameters defined in https://github.com/daoleno/uniswapv3-sdk/blob/master/periphery/selfpermit.go

I know it would be wrapped in AddCallParameters automatically. But I don't know how to wrap the VRS(signature data).
Can you give me a simple example for calling AddCallParameters with perimited parameters?

@Vaulverin
Copy link
Contributor

I haven't used these features, so can not help you. But I advice you to take a look at official js version of uniswap v3 sdk, I assume this sdk follows the same logic.

@daoleno
Copy link
Owner

daoleno commented Jul 3, 2022

Same as @Vaulverin . And thanks for your examples. If you have this part of the sample code, feel free to contribute it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants