git.delta.rocks / unique-network / refs/commits / 1a0647ecee1e

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::*};1819pub struct ERC20;2021#[solidity_interface(name = ERC20)]22impl ERC20 {23	fn decimals(&self) -> Result<uint8> {24		unreachable!()25	}26	/// Get balance of specified owner27	fn balance_of(&self, _owner: address) -> Result<uint256> {28		unreachable!()29	}30	fn transfer(&mut self, _caller: caller, _to: address, _value: uint256) -> Result<bool> {31		unreachable!()32	}33	fn transfer_from(34		&mut self,35		_caller: caller,36		_from: address,37		_to: address,38		_value: uint256,39	) -> Result<bool> {40		unreachable!()41	}42	fn approve(&mut self, _caller: caller, _spender: address, _value: uint256) -> Result<bool> {43		unreachable!()44	}45	fn allowance(&self, _owner: address, _spender: address) -> Result<uint256> {46		unreachable!()47	}48}4950generate_stubgen!(gen_impl, ERC20Call, true);51generate_stubgen!(gen_iface, ERC20Call, false);