Skip to content

Conversation

@alvinphilips
Copy link
Contributor

Gateway implementation of lido protocol, with support for both v1 and v2.

@alvinphilips
Copy link
Contributor Author

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.

@alvinphilips
Copy link
Contributor Author

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.

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.

@ironaddicteddog ironaddicteddog force-pushed the master branch 4 times, most recently from 4c3c87b to 7bf006b Compare December 2, 2022 07:14
@ironaddicteddog
Copy link
Contributor

@PolarVoid Plz migrate to Lido v2 in this PR

@alvinphilips
Copy link
Contributor Author

Hey @ironaddicteddog , I've migrated the code now


break;
case SupportedProtocols.Lido:
this._metadata.vault = await lido.infos.getVault(
Copy link
Contributor

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:

  1. Add validatorIndex as an optional field in DepositParams
  2. Add validatorIndex field (metadata section) in GatewayParams (this is a work-around)
  3. Update gatewayParams: this.params.validatorIndex = depositParams.validatorIndex

src/builder.ts Outdated
this._provider.connection,
withdrawParams.vaultId
);
this.params.validatorIndex = withdrawParams.validatorIndex;
Copy link
Contributor

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,
Copy link
Contributor

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?


const heaviestValidator = vaultInfoWrapper.getHeaviestValidator();

const heaviestValidatorIndex = vaultInfo.validators.entries.findIndex((value) =>
Copy link

@ayushpaharia ayushpaharia Dec 9, 2022

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

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.

3 participants