near / bounties

Specs for technical and non-technical work that earns NEAR tokens
https://devgovgigs.near.social
72 stars 8 forks source link

Rainbow Bridge Ampleforth Connector | Bounty TBD #30

Closed ilblackdragon closed 2 years ago

ilblackdragon commented 4 years ago

NEAR Bounty Terms

This is part of https://near.org/rainbow hackathon.

Description

Implement Rainbow bridge connector for Ampleforth.

Context

AMPL is an adaptive base-money, that adjusts total supply based on supply and demand. Can learn more https://www.ampleforth.org/

Rainbow Bridge has a generic ERC-20 connector implementation. But AMPL token won't work correctly with it, because of rebase - function that changes denomination of the token every day.

This bounty is about cloning a single token connector and customizing it to keep track of rebases and also communicating rebases from Ethereum to NEAR.

Relevant repos or issues

The way to correctly do accounting due to rebases:

When amount is deposited / withdrawn from ETH/NEAR is to use internal amount (e.g. divide by total supply). E.g. if Alice has 1,000 AMPL currently and total supply is 2,000, internally she has 100,000,000 (e.g. whatever the internal denomination is used). Which will be sent to the other chain and rehydrated back depending on current rebase. This is important, because if the event was created pre-rebase, but the token arrives on the other side after rebase happened - the external amount will be incorrect. Internal amount (e.g. pre rescaling with rebase) will allow that on arrival can recalculate based on the current multiplier.

For example Alice sent 50 AMPL to NEAR. Right after the rebase happened and adjusted 2x the total supply. E.g. this 50 AMPL became 100 AMPL. For example the contract on NEAR actually received rebase event before Alice called deposit on NEAR side. If 100,000,000 of internal denomination arrive, contract just multiplies back to 1/50,000 and receive 2000 AMPL on NEAR side.

Acceptance Criteria

Bounty

TBD

defiboy commented 4 years ago

hello, I would like to start working on this, what do I need to do?

ilblackdragon commented 4 years ago

@defiboy assigned it to you here. Feel free to ping us with questions in https://near.chat, also can connect with AMPL team if there are questions.

defiboy commented 4 years ago

yes, thanks

ilblackdragon commented 4 years ago

@defiboy wanted to check in on the status here

cameron-NEAR commented 3 years ago

Hi @defiboy, how is the completion of this bounty going? I'm happy to find someone to complete it if you are no longer interested.

cenwadike commented 3 years ago

Hello, I'm interested in this bounty and would like to start working on it. What do I need to get started?

cameron-NEAR commented 3 years ago

I just assigned it to you so feel free to start working on it now! :)

When do you think you will be able to complete it by?

cenwadike commented 3 years ago

Keeping my fingers crossed, hopefully within 3 months.

On Mon, Sep 27, 2021, 13:51 Cameron Dennis @.***> wrote:

Assigned #30 https://github.com/near/bounties/issues/30 to @cenwadike https://github.com/cenwadike.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/near/bounties/issues/30#event-5365364820, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5OZ5MGEKK6PCPSUIOCOUTUEBSFVANCNFSM4RSOJDSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

cenwadike commented 3 years ago

@cameron-NEAR I've constantly received a 404 error when I attempted to view the repo for "Ethereum side: https://github.com/near/rainbow-bridge-sol/tree/master/token-locker ".

Can I have the current and available link to this repo.

ilblackdragon commented 3 years ago

@cenwadike sorry for inconvenience. The code of the connectors from both Ethereum and NEAR side was moved to https://github.com/aurora-is-near/rainbow-token-connector. Updated description as well.

cenwadike commented 3 years ago

@ilblackdragon thank you for your response.

cenwadike commented 2 years ago

Hello @ilblackdragon, I haven't been paying attention to the project as I've been helping a friend out with his project for an MSc thesis.

I'll be paying more attention here and could be asking some questions soon.

Thanks for being approachable.

ilblackdragon commented 2 years ago

I'm going to close this as there is not much progress here in past 1.5y.

cenwadike commented 2 years ago

Been on it...the code base is quite large, been trying to understand different parts. Can I continue to work on it? Have dedicated some effort into it and would like to see it through.

ilblackdragon commented 2 years ago

@cenwadike for sure, continue working. just ping here when you have something to share with the bridge team.

cenwadike commented 2 years ago

Noted