Comments (1)
There was some discussion on why i128 vs u128 in Discord in this thread:
https://discord.com/channels/897514728459468821/1047281257312161832
The main reason is that amounts aren't always positive. Even if they aren't neg in the token contract, someone might be passing amounts to a token contract and another contract, and converting to between integer types introduces new failure cases (e.g. overflow) that aren't trivial to deal with safely and that folks often ignore.
There are example cases in the Discord thread.
from soroban-examples.
Related Issues (20)
- Examples for Preview 9 HOT 1
- Create a simple contract upgrade example
- Rewrite all examples to promote a single global state UDT entry over multiple "small" entries
- Rewrite liqpool contract
- Rust setup issues on Gitpod Startup HOT 2
- Create a simple token contract example
- Update examples to support state expiration HOT 1
- Write an example that uses PRNG
- Documentation link yields a 404 HOT 1
- Audit use of negative amounts
- Use the soroban_sdk::token::Interface for implementing tokens contract examples
- src/timelock.lib.rs minor logic bug
- Add rust doc comments to all types and functions in all examples
- `contract_a`'s checked_add fails before `.expect`
- fuzzing example: fuzz_target_2 Config::setup is wrong HOT 2
- mint-lock contract allows minters to bypass their epoch limit. HOT 7
- Contract deploying and invoking result in `xdr processing error: xdr value invalid` whenever anything is changed slightly from examples HOT 1
- Add an example using secp256r1
- Update for soroban-sdk 21.x
- Improve the example security after protocol 22
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.
from soroban-examples.