v1.10.0
版本发布时间: 2023-10-20 12:23:05
ProvableHQ/leo最新发布版本:v2.1.0(2024-08-07 13:19:53)
This release contains:
-
SHA3
hash functions. -
Keccak
hash functions. - Constant declarations.
-
self.signer
andself.caller
. - compatibility updates with snarkVM 0.16.1.
SHA3 and Keccak
Leo supports 235, 384, and 512 bit variants for SHA3
and Keccak
.
let a: address = SHA3_256::hash_to_address(input);
let b: u8 = SHA3_384::hash_to_u8(input);
let c: field = SHA3_512::hash_to_field(input);
let d: group = Keccak256::hash_to_group(input);
let e: i8 = Keccak384::hash_to_i8(input);
let d: u16 = Keccak512::hash_to_u16(input);
Constant Declarations
Leo allows users to declare global and local constants.
const START: u8 = 0u8;
self.signer
and self.caller
Leo supports:
-
self.signer
, which is the user that originated the program call. -
self.caller
, which is the user or program that called the current function.
Suppose that a user
calls program A
which calls program B
.
In program A:
-
self.signer
isuser
. -
self.caller
isuser
.
In program B
:
-
self.signer
isuser
. -
self.caller
isA
.
Note what was previously self.caller
is now self.signer
.
1、 leo-v1.10.0-aarch64-apple-darwin.zip 15.16MB
2、 leo-v1.10.0-x86_64-apple-darwin.zip 15.33MB
3、 leo-v1.10.0-x86_64-pc-windows-msvc.zip 15.8MB
4、 leo-v1.10.0-x86_64-unknown-linux-gnu.zip 15.75MB
5、 leo-v1.10.0-x86_64-unknown-linux-musl.zip 17.29MB
6、 leo.zip 15.16MB