git.delta.rocks / unique-network / refs/commits / 0257bf04211b

difftreelog

source

crates/evm-coder/tests/solidity_generation.rs1.8 KiBsourcehistory
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types::*};18use evm_coder::{19	make_signature,20	custom_signature::{21		SIGNATURE_SIZE_LIMIT, SignatureUnit, SignaturePreferences, FunctionSignature,22	},23	types::Signature,24};2526pub struct ERC20;2728#[solidity_interface(name = ERC20)]29impl ERC20 {30	fn decimals(&self) -> Result<uint8> {31		unreachable!()32	}33	/// Get balance of specified owner34	fn balance_of(&self, _owner: address) -> Result<uint256> {35		unreachable!()36	}37	fn transfer(&mut self, _caller: caller, _to: address, _value: uint256) -> Result<bool> {38		unreachable!()39	}40	fn transfer_from(41		&mut self,42		_caller: caller,43		_from: address,44		_to: address,45		_value: uint256,46	) -> Result<bool> {47		unreachable!()48	}49	fn approve(&mut self, _caller: caller, _spender: address, _value: uint256) -> Result<bool> {50		unreachable!()51	}52	fn allowance(&self, _owner: address, _spender: address) -> Result<uint256> {53		unreachable!()54	}55}5657generate_stubgen!(gen_impl, ERC20Call, true);58generate_stubgen!(gen_iface, ERC20Call, false);