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

Integration of Saver to SOLANA Network #4

Open
0xJohnnySilverhand opened this issue Jun 14, 2021 · 6 comments
Open

Integration of Saver to SOLANA Network #4

0xJohnnySilverhand opened this issue Jun 14, 2021 · 6 comments
Labels

Comments

@0xJohnnySilverhand
Copy link
Member

0xJohnnySilverhand commented Jun 14, 2021

Integration of Saver to SOLANA Network

Prize Bounty

🏆 1,500 PUNK (~$15,000USD)


Challenge Description

Punk Protocol aims to liberate people from the outdated pension system and empower their financial freedom. Our first product is the world's first decentralized annuity a.k.a "Saver", which is generating periodic cash flows using optimal yield strategies.

Anyone can invest through the Saver to earn automated cash flows periodically by setting custom conditions - i) When do you want to start receiving, ii) How regularly do you want to receive, iii) How many times do you want to receive.

Solana is an open-source project implementing high-performance, permission-less, and secure web-scale blockchain.

For this Hackathon, we're looking to expand the Saver onto the Solana blockchain.


Submission Requirements

Your work must fulfill the following criteria:

  • You need to code by referring to the Reference Link.
  • 'Saver.sol' is the "structure" used in Forge. You need to implement this structure without change.
  • You need to code by inheriting the file located in interface's 'ForgeInterface'.
  • You need to code by inheriting the file located in interface's 'ModelInterface'.
  • You can see the flow of the service here.
  • The completed code needs to be integrated with SOLANA's DeFi services.

Reference link

Punk Protocol Github Page (https://github.com/PunkFinance)

Architecture of Punk Protocol https://docs.punk.finance/saver/mechanism/saver-architecture


Judging Criteria

  • Meet all the requirements
  • Completion of Forge & Model on the Solana blockchain with its DeFi services.
  • Technical stability

Winner Announcement Date

July 21th on Punk protocol's official Discord (👾︲hackathon)


Resources

Website(https://punk.finance/)
Github(https://github.com/PunkFinance)
Docs (https://docs.punk.finance/)
Discord(https://discord.com/invite/punk)

@gitcoinbot
Copy link

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


This issue now has a funding of 1500.0 PUNK (15000.0 USD @ $10.0/PUNK) attached to it.

@pyk
Copy link

pyk commented Jun 15, 2021

@0xJohnnySilverhand Is there a list of DeFi services in solana that need to be integrated?

@0xJohnnySilverhand
Copy link
Member Author

@0xJohnnySilverhand Is there a list of DeFi services in solana that need to be integrated?

Nope, there is no list.
You are free to choose any DeFi services in Solana.

@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 6 days, 7 hours from now.
Please review their action plans below:

1) leon-africa has started work.

https://gitcoin.co/issue/PunkFinance/punk.protocol/4/100025878

Learn more on the Gitcoin Issue Details page.

@Leon-Africa
Copy link

Hi there,

So a few comments on what I've done.

When initially looking into this I found that Solana required that smart contracts be written in Rust. After evaluating the smart contracts in Punk Finance I noted this would be a quite a feat to achieve in 6 days. I then proceeded to look if a compiler/transpiler existed where I could take the solidity smart contract code and have it compiled to Rust.

In this search I came across Caspiler:

https://docs.casperlabs.io/en/latest/dapp-dev-guide/solidity.html

However the compiler claimed to be utilized did not seem to be publicly available

From here I search further and came across Solang:

https://solang.readthedocs.io/en/latest/

Solang had a target for Solana taking Solidity contracts to Rust making it Solana ready. However it is still very early days and the compiler has some current limitations with respect to Solidity to Rust (Solana).

I then relooked at CasperLabs and noted from the site that the transpiler feature was being marketed - so it had to be usable! I hypothesized from documentation that the Caspiler is utilized in the Casper network itself and invoked at deployment.

Wanting to setup a Casper client on my PC I found the limiter here to be that I was using Windows. (casper-client from crates.io errored seeking Unix paths/files)

So from here I used the Linux Subsystem in Windows and continued.

I realized the compiling should innately occur during build - however found that cargo build release requires a main.rs file. I tried to replace it with a .sol file to see if it works but it throws no main.rs. I suppose you could point to a tree of .sol files by configuring the crate.

Anyhow the approach should be simpler than configuring the crate if CasperLabs is marketing on their website that developers can "Use the Solidity to Rust Transpiler".

I've reached out to the CasperLabs Discord but no one has used it yet and waiting for some words from more of the team developers.

So an answer here is to use the Caspiler to acquire the Solidity to Rust contract. This will not necessarily resolve the caveats with respect to storage for smart contracts (programs) in Solana.

A method in this case is to utilize the Caspiler to get the Rust code. And then rework this code implementing the necessary program(smart contract) caveats required by Solana.

The next option is to utilize Solang - full Solana target implementations timing would determine how long the wait would be.

The alternate to this is to upfront manually perform the Solidity to Rust for the Smart Contracts.

My timing has ran out with only a 3 hours left - its almost midnight and I'm tired.

Punk Out 🛌

@gitcoinbot
Copy link

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


Work for 1500.0 PUNK (15000.0 USD @ $10.0/PUNK) has been submitted by:


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

No branches or pull requests

4 participants