Skip to content
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

[Bounty] Stacking Pool #2

Open
willemneal opened this issue Aug 26, 2020 · 14 comments · May be fixed by #11
Open

[Bounty] Stacking Pool #2

willemneal opened this issue Aug 26, 2020 · 14 comments · May be fixed by #11
Assignees
Labels
Bounty Open GitCoin Bounty

Comments

@willemneal
Copy link

willemneal commented Aug 26, 2020

NEAR Bounty Terms

Before beginning work on the bounty, you must submit a proposal. Only if your proposal is accepted will you be able to claim the reward of the bounty. In particular for this bounty you need to detail the testing you will use other than unit testing.

There should be at most 1 week between proposal is accepted and you start working on the bounty. It should take you at most 1 month to complete the bounty.

Description

For this bounty you will need to rewrite the Staking Pool into AssemblyScript making sure that they have the same API.

Context

With the new addition of includeBytes function in AssemblyScript, near-sdk-as should have enough parity with near-sdk-rs that the core smart contracts should be able to be written in AS. The trickiest part of the contracts are the cross contract calls. Rust provides a high level abstraction for working with promises. For an example for batch promise calls in AS see the sdk's repo here.

Relevant repos or issues

Core Contracts

API

Same as rust contracts.

Acceptance Criteria

  • [ ] Including the unit tests
  • [ ] Test contracts another way

Bounty

200 DAI

@willemneal willemneal added the Bounty Open GitCoin Bounty label Aug 26, 2020
@willemneal willemneal self-assigned this Aug 26, 2020
@luciotato
Copy link

Proposal:

I plan to rewrite the Staking Pool into AssemblyScript making sure that they have the same API.

I plan to create unit tests and an integration tests in AssemblyScript deploying the contract in testnet, in a similar way the near-cli package test the near call functionality

As a second test strategy, I plan to use the test harness of the rust contract code, but using the .WASM file from the assemblyscript compilation. It seems that the rust test suite can be applied to a .WASM contract file generated by the AS compiler.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 266 years, 2 months from now.
Please review their action plans below:

1) luciotato has been approved to start work.

Proposal:

I plan to rewrite the Staking Pool into AssemblyScript making sure that they have the same API.

I plan to create unit tests and an integration tests in AssemblyScript deploying the contract in testnet, in a similar way the near-cli package test the near call functionality

As a second test strategy, I plan to use the test harness of the rust contract code, but using the .WASM file from the assemblyscript compilation. It seems that the rust test suite can be applied to a .WASM contract file generated by the AS compiler.

Learn more on the Gitcoin Issue Details page.

@willemneal
Copy link
Author

@luciotato I added an example contract and tests.

@luciotato
Copy link

I took a detour and I'm making a rust parser (hand-coded PEG Parser)
The "parsing" part is mostly done (it was not easy, rust syntax is complex)
I'm starting now the "transpiling into AS" part.

image
This is the resulting AST for the Staking Contract up to level 3

@gitcoinbot
Copy link

@luciotato Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@luciotato Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

3 similar comments
@gitcoinbot
Copy link

@luciotato Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@luciotato Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@luciotato Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@luciotato due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@luciotato
Copy link

Hi Willem!, I'm doing the hackathon. Will resume after that

@gitcoinbot
Copy link

@luciotato Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

1 similar comment
@gitcoinbot
Copy link

@luciotato Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@luciotato
Copy link

luciotato commented Oct 11, 2020

@willemneal I'm stuck because to compute "shares" after a stake, I need to multiply 2 u128 into a u256 (2 big u128, will overflow).-
is there a way to do that in AssemblyScript? I don't see mul & div in u256, nor mul(u128,u128)->u256
It looks like those should be added to https://github.com/MaxGraey/as-bignum
MaxGraey/as-bignum#35 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bounty Open GitCoin Bounty
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants