Skip to content

Conversation

@ITStar10
Copy link
Contributor

Initial version of vda-xp-reward-client

@ITStar10 ITStar10 requested a review from tahpot May 31, 2024 04:44
@ITStar10 ITStar10 self-assigned this May 31, 2024
@ITStar10 ITStar10 linked an issue May 31, 2024 that may be closed by this pull request
* @param to - Recipient wallet address
* @param amount - Token amount to be withdrawn
*/
public async withdraw(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a deposit() method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In face, no need deposit() method.
The owner can deposit tokens by send the VDA token to the address of XPReward contract.

If we added deposit() function in the XPReward contract, the owner should approve the VDA token to the contract before calling the deposit() function. This involves 2 step for depositing.
I think, transferring VDA token to the XPReward contract is more conveninent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm proposing adding a deposit() method to this typescript library, not the smart contract.

A user of this typescript library needs a way to easily deposit tokens.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added depositToken() function

@@ -0,0 +1,7 @@
## These are used for test only.
PRIVATE_KEY = "<Input private key of transaction sender>"
RPC_URL="<Input RPC url for targeting chain>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this now as it should use default RPC URLs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just not clear.
PRIVATE_KEY is the private key of wallet that send the transaction.

And the RPC_URL is used in the tes script to manage the mock token.
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the RPC_URL is only for the. test script, then make that clear. Add a comment in .env.example and maybe rename to RPC_URL_TEST_DEPLOY

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is comment in the .env.example file.
image

Copy link
Member

@tahpot tahpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, see minor comments.

ITStar10 added 11 commits July 25, 2024 08:54
- Added contract address and abi of `vda-xp-reward`
- Added `xpReward` to the `INetworkContracts` interface in the `NetworkInterfaces.ts`
- Updated the `XPRewardContract` address and abi
- Update on review
- Added `depositToke()` function
…verida/verida-js into feature/430-vda-xp-reward-client-create
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.

[vda-reward-xp-client] Create initial version

3 participants