git.delta.rocks / unique-network / refs/commits / 030bc0dcaa8d

difftreelog

source

crates/evm-coder/tests/solidity_generation.rs1.6 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::{abi::AbiType, execution::Result, generate_stubgen, solidity_interface, types::*};18use primitive_types::U256;1920pub struct ERC20;2122#[solidity_interface(name = ERC20)]23impl ERC20 {24	fn decimals(&self) -> Result<u8> {25		unreachable!()26	}27	/// Get balance of specified owner28	fn balance_of(&self, _owner: Address) -> Result<U256> {29		unreachable!()30	}31	fn transfer(&mut self, _caller: Caller, _to: Address, _value: U256) -> Result<bool> {32		unreachable!()33	}34	fn transfer_from(35		&mut self,36		_caller: Caller,37		_from: Address,38		_to: Address,39		_value: U256,40	) -> Result<bool> {41		unreachable!()42	}43	fn approve(&mut self, _caller: Caller, _spender: Address, _value: U256) -> Result<bool> {44		unreachable!()45	}46	fn allowance(&self, _owner: Address, _spender: Address) -> Result<U256> {47		unreachable!()48	}49}5051generate_stubgen!(gen_impl, ERC20Call, true);52generate_stubgen!(gen_iface, ERC20Call, false);