FuelLabs/sway

Contract self impl

Open

#5,905 opened on 2024年4月23日

GitHub で見る
 (2 comments) (0 reactions) (0 assignees)Rust (61,702 stars) (5,421 forks)batch import
ODHack12compiler: frontendcompiler: parsergood first issuelanguage featureteam:compiler

説明

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 }
}

コントリビューターガイド

Contract self impl · FuelLabs/sway#5905 | Good First Issue