kukuza / sargo-smart-contracts Goto Github PK
View Code? Open in Web Editor NEWSmart Contracts for P2P On- and Off-Ramp on Celo
License: Apache License 2.0
Smart Contracts for P2P On- and Off-Ramp on Celo
License: Apache License 2.0
Private variable.
Have a public read method to get the number.
Create a public read method to get the updated index.
Still needs to be discussed how.
Allen has concerns, made a flowchart as basis for discussion.
What is happening:
What should happen:
Scenario 1: User Request cUSD Top up.
User posts request of 500 KSH
Fee for user = 0.05 cUSD (agent fee) + 0.04 cUSD (Wakala fee) = 0.09 cUSD
Amount the user will receive = (500 / 115) cUSD - 0.09 cUSD = 4.35 cUSD - 0.09 cUSD = 4.26 cUSD
Agent accepts request
money withdrawn from agent wallet to escrow = 4.26 cUSD (separate transaction: wallet to escrow contract)
money withdrawn from agent wallet to Kukuza treasury = 0.04 cUSD (separate transaction: wallet to kukuza treasury
Total withdrawn: 4.30 cUSD
4.30 cUSD is 5 cents less than 4.35 cUSD (500 / 115), because the agent retains the 5 cent agent fee
Scenario 2: User Requests cUSD Withdrawal
Agent accepts request
Agent receives: (500 / 115)- Wakala fee = 4.35 - 0.04 = 4.31 cUSD
Agent sends via M-PESA: 4.35 cUSD - wakala fee - agent fee = 500 KSH - 0.09 cUSD = 500 KSH - 10.35 KSH = 489.65 KSH
User post request to withdraw 500 KSH
Fee for user = 0.05 cUSD (agent fee) + 0.04 cUSD (Wakala fee) = 0.09 cUSD
amount withdrawn from user wallet to escrow: (500/115) - wakala fee = 4.35 - 0.04 = 4.31 cUSD
amount withdrawn from user wallet to treasury: 0.04 cUSD Wakala fee
Check: total withdrawn: 4.35 cUSD
M-PESA amount the user will receive: (500 / 115) cUSD - 0.09 cUSD = 4.35 cUSD - 0.09 cUSD = 4.26 cUSD
4.26 * 115 = 489.9
In the (near) future we want to be able to filter transactions in the feed.
Based on:
We don't know yet, how exactly we will filter.
But what we do know is that
Does it make sense to add bother properties to the smart contract?
What we haven't figured out yet:
What if a user sets his display currency to KSH, but chooses the country "Nigeria" when posting a request?
To be done after #4
Claire cannot copy my phone number in order to send me M-PESA
It is not working on both pages. The one with continue button, and the one with swipe to confirm.
Kukuza Treasury on Alfajores Testnet:
0xfF096016A3B65cdDa688a8f7237Ac94f3EFBa245
We currently connect to the Celo blockchain via Forno:
https://docs.celo.org/developer-guide/forno
In the future we want to connect via Figment Data Hub:
https://datahub.figment.io/
Need this also for the audit.
Let#s say an agent accepts a request, money is sent to escrow.
If something breaks, or the user never confirms, how and when do we send the money back?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.