FuelLabs/sway

Contract self impl

Aberta

#5.905 aberto em 23 de abr. de 2024

 (2 comentários) (0 reação) (0 responsável)Rust (5.421 forks)batch import
ODHack12compiler: frontendcompiler: parsergood first issuelanguage featureteam:compiler

Métricas do repositório

Stars
 (61.702 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Allow self impl for contracts as a shorthand for an anonymous ABI spec. The point is to not have to write an ABI type for very small contracts.

This:

contract;
impl Contract {
    fn foo() -> u64 { 0 }
}

Should produce the same binary and ABI spec as:

contract;
abi MyAbi {
    fn foo() -> u64;
}
impl MyAbi for Contract {
    fn foo() -> u64 { 0 }
}

Guia do colaborador