anchor-coin-flip's Introduction
anchor-coin-flip's People
Forkers
btcltcanchor-coin-flip's Issues
execute wallet
In the 2 txn flow, the core
should store the pubkey
of the executer
, the wallet than can run the 2nd txn.
We don't want it to be the admin
since the private key of the executer will need to be in the backend, so we don't want to expose it.
strict enough?
signer
plus admin == core.admin
should lock down any option for anyone else to withdraw, right?
usused?
anchor-coin-flip/programs/coin-flip/src/lib.rs
Lines 29 to 31 in 8f39241
seems unused, if so let's remove to avoid unneeded noise
purpose?
this is to fill up the house wallet?
Admin/Operator setup
We need to define a new type of user Operator
.
Admin
:
- Creates
core
. - Defines
fee of fee
, and in each bet, thefee
is split betweenadmin
andoperator
.
Operator
:
- Defines
fee
. - Register
mint
. - Can
deposit
. - Can
withdraw
.
Merge?
anchor-coin-flip/programs/coin-flip/src/lib.rs
Lines 253 to 266 in 75d181e
Can use wrapped sol, then we have only one type of these.
seperate
anchor-coin-flip/programs/coin-flip/src/lib.rs
Lines 192 to 241 in 8f39241
need to move this part to a separate method, we want to avoid users being able to see the instruction that says who won.
add more "random" inputs
should add recent blockhash / slot / etc to the hash seeds , to make it harder to predict.
close core/vault
Incase we update the struct
we need to also be able to close the existing accounts or it will not let us create with the updated form.
Also, upon closer, all funds in core/vault should be sent to the admin.
allowed amounts
core account should have a vector of allowed bet amounts , need to validate the amount is one of those given.
we don't want someone to make a huge bet and clean the house on luck (or exploit)
fee need to be stored on core
can't let the user determine the fee, they can put it as 0.
withdraw destination should be in core and mint too
anchor-coin-flip/programs/coin-flip/src/lib.rs
Lines 443 to 448 in 8f39241
we want to make each core use a specific mint, to avoid a mess of people trying to bet with various unrelated mints.
the withdraw destination should be predefined doing creation, to ensure more security
=> can add an update instruction to all of these for flexibility
Newer Anchor
Is it possible to move to latest Anchor?
I saw they published some great features like better errors.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.