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

difftreelog

source

pallets/refungible/src/erc.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/>.1617extern crate alloc;18use evm_coder::{generate_stubgen, solidity_interface, types::*};1920use pallet_common::{CollectionHandle, erc::CollectionCall, erc::CommonEvmHandler};2122use pallet_evm::PrecompileHandle;23use pallet_evm_coder_substrate::call;2425use crate::{Config, RefungibleHandle};2627#[solidity_interface(28	name = "UniqueRFT",29	is(via("CollectionHandle<T>", common_mut, Collection),)30)]31impl<T: Config> RefungibleHandle<T> where T::AccountId: From<[u8; 32]> {}3233// Not a tests, but code generators34generate_stubgen!(gen_impl, UniqueRFTCall<()>, true);35generate_stubgen!(gen_iface, UniqueRFTCall<()>, false);3637impl<T: Config> CommonEvmHandler for RefungibleHandle<T>38where39	T::AccountId: From<[u8; 32]>,40{41	const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungible.raw");42	fn call(43		self,44		handle: &mut impl PrecompileHandle,45	) -> Option<pallet_common::erc::PrecompileResult> {46		call::<T, UniqueRFTCall<T>, _, _>(handle, self)47	}48}