-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add lido protocol #22
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
base: master
Are you sure you want to change the base?
Conversation
|
Currently, withdraw throws an error because I have not yet implemented it fully on the Adapter side, and I am unsure whether it is correctly implemented. Specifically, I want to make sure that the token has been generated and used correctly. I believe I will also need to add it as a signer for this to work. |
Looking further into the matter, I think this does work correctly. I have removed the error for now, but would like a second set of eyes to verify this. |
4c3c87b to
7bf006b
Compare
|
@PolarVoid Plz migrate to Lido v2 in this PR |
|
Hey @ironaddicteddog , I've migrated the code now |
bf551db to
7853a14
Compare
7654df6 to
aea3442
Compare
|
|
||
| break; | ||
| case SupportedProtocols.Lido: | ||
| this._metadata.vault = await lido.infos.getVault( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in order to support validatorIndex in GatewayState:
- Add
validatorIndexas an optional field inDepositParams - Add
validatorIndexfield (metadata section) inGatewayParams(this is a work-around) - Update gatewayParams:
this.params.validatorIndex = depositParams.validatorIndex
7853a14 to
7eb7dfd
Compare
src/builder.ts
Outdated
| this._provider.connection, | ||
| withdrawParams.vaultId | ||
| ); | ||
| this.params.validatorIndex = withdrawParams.validatorIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add some descriptive comment here to explain the intention? Since this is a temporary work-around
| { | ||
| amount: new anchor.BN(params.withdrawAmount), | ||
| // Set validator index. | ||
| validatorIndex: heaviestValidatorIndex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validatorIndex should be retrieved from params?
src/protocols/lido.ts
Outdated
|
|
||
| const heaviestValidator = vaultInfoWrapper.getHeaviestValidator(); | ||
|
|
||
| const heaviestValidatorIndex = vaultInfo.validators.entries.findIndex((value) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the heaviest validator logic over to DappioWonderland/navigator
in the Vault info wrapper itself
Gateway implementation of lido protocol, with support for both v1 and v2.