MX Contract Integration #312
Conversation
|
@vladNed is attempting to deploy a commit to the HUMAN Protocol Team on Vercel. A member of the Team first needs to authorize it. |
|
Let's do this |
psorinionut
left a comment
There was a problem hiding this comment.
I left a few suggestions & recommendations regarding mostly the code structure/architecture, and tried not to intervene as much in the code from the business logic perspective. Bottom line is that you should always try to optimise the code to go through as few lines of code as possible, and also try to reduce the storage readings to a minimum. This last part is very important, as it directly impacts the performance of the contract and this could make a difference as more users will begin to use it.
Also, I recommend you to upgrade to the latest framework (I see that now you are using version 0.39.2).
portuu3
left a comment
There was a problem hiding this comment.
fix comment 1% and you can remove bulk_paid from escrow contract
|
@vladNed can you please add a gitflow action to run tests? |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Description
The goal of this PR is to implement all the human protocol sol contract in rust with the official
mx-sdk-rspackageSummary of changes
All the code that represents the contract code can be found in any contract
srcdirectory. Themetaandwasmcrates are separate crates that contain the framework for themx-sdk-rs.Implemented the following contracts:
I also implemented some of the mock contracts for proxy calls only used in testing purposes.
Possible bugs
I don't know how solidity works properly with upgrading contracts, but in most of the MX contracts upgrading some of the contract require re-sending the init parameters.
Some of the contracts, for instance the
RewardsPoolrequire the reward token to be set each time the contract is upgraded. I left it as it is in the solidity contract but I suggest to set it only if its empty and use a separate endpoint to reset the rewards token to another token if its required on upgrade. This will also give the possibility of paying out first the existing token amount.Also in the
RewardsPoolcontract, I observed that rewards records can be added with a 0 amount after the fees were deducted. I left it as it is on the original sol contract but I suggest that the records are added only if the amount after fees is greater than 0.How test the changes
Testing the contracts was added to the
READMEfile but you can always runcargo testinto the mx directory to run all contracts tests. Or on each contract run the tests from thetest_*.rsfiles.Related issues
Become the official HMT Elrond maintainer
Resolves #138
Operational checklist