diem / move

Home of the Move programming language
Apache License 2.0
341 stars 129 forks source link

[Feature Request] Add u256 support #80

Open nanne007 opened 2 years ago

nanne007 commented 2 years ago

🚀 Feature Request

Support u256 primitive type. May also consider u16, u32, and signed integer type like i8, i16, i32 , i64, i128, i256.

A similar discussion exists in diem repo https://github.com/diem/diem/issues/8504

Motivation

Is your feature request related to a problem? Please describe. u256 are common used in solidity. Lack of u256 cause many problems when bridging asset or protocol into Move contracts.

And since Move doesn't float types, we need a large integer type to simulate float calculation for u128.

Pitch

A builtin support for u256 is what I'm expecting for.

alternative is using native structs, but it's tedious.

Additional context

jolestar commented 2 years ago

The starcoin-framework implements U256 in Move by the native method. But we still expect the primitive u256.