git.delta.rocks / unique-network / refs/commits / d08f39622829

difftreelog

source

crates/evm-coder/tests/a.rs1.5 KiBsourcehistory
1use evm_coder::{solidity_interface, types::*, ToLog};2use evm_coder_macros::solidity;34#[solidity_interface]5trait OurInterface {6	type Error;7	fn fn_a(&self, input: uint256) -> Result<bool, Self::Error>;8}910#[solidity_interface]11trait OurInterface1 {12	type Error;13	fn fn_b(&self, input: uint128) -> Result<uint32, Self::Error>;14}1516#[solidity_interface(is(OurInterface), inline_is(OurInterface1), events(ERC721Log))]17trait OurInterface2 {18	type Error;19	#[solidity(rename_selector = "fnK")]20	fn fn_c(&self, input: uint32) -> Result<uint8, Self::Error>;21	fn fn_d(&self, value: uint32) -> Result<uint32, Self::Error>;2223	fn caller_sensitive(&self, caller: caller) -> Result<uint8, Self::Error>;24	fn payable(&mut self, value: value) -> Result<uint8, Self::Error>;25}2627#[derive(ToLog)]28enum ERC721Log {29	Transfer {30		#[indexed]31		from: address,32		#[indexed]33		to: address,34		value: uint256,35	},36	Eee {37		#[indexed]38		aaa: address,39		bbb: uint256,40	},41}4243#[solidity_interface]44trait ERC20 {45	type Error;4647	fn decimals(&self) -> Result<uint8, Self::Error>;48	fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;49	fn transfer(50		&mut self,51		caller: caller,52		to: address,53		value: uint256,54	) -> Result<bool, Self::Error>;55	fn transfer_from(56		&mut self,57		caller: caller,58		from: address,59		to: address,60		value: uint256,61	) -> Result<bool, Self::Error>;62	fn approve(63		&mut self,64		caller: caller,65		spender: address,66		value: uint256,67	) -> Result<bool, Self::Error>;68	fn allowance(&self, owner: address, spender: address) -> Result<uint256, Self::Error>;69}