Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct precompile interface and json abi #462

Merged
merged 14 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
resolver = "2"

[workspace.package]
version = "3.33.0"
version = "3.34.0"
authors = ["Gluwa Inc. Developer Support <support.dev@gluwa.com>"]
edition = "2021"
license = "Unlicense"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
"anonymous": false,
"inputs": [
{
"indexed": false,
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "destination",
"type": "bytes32"
Expand Down
4 changes: 2 additions & 2 deletions precompiles/metadata/precompiles-creditcoin3-devnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "SubstrateTransfer",
"bytecode": "0xfe",
"compiler": "Not Installed",
"source": "// SPDX-License-Identifier: GPL-3.0-only\npragma solidity >=0.8.3;\n\n/// @dev The Deposit precompile address\naddress constant SUBSTRATE_TRANSFER_ADDRESS = 0x0000000000000000000000000000000000000Fd1;\n\nSubstrateTransfer constant SUBSTRATE_TRANSFER_ADRRESS = SubstrateTransfer(SUBSTRATE_TRANSFER_ADDRESS);\n\n/// @title SubstrateTransfer interface\ninterface SubstrateTransfer {\n /// @dev Event emitted when a transfer has been performed.\n /// @param destination The Substrate address receiving the tokens.\n /// @param amount The amount of tokens transferred.\n event Transfer(bytes32 destination, uint256 amount);\n\n /// @dev Function to transfer tokens to a Substrate address.\n /// @param destination The Substrate address receiving the tokens.\n /// @param amount The amount of tokens to transfer.\n function transfer_substrate(bytes32 destination, uint256 amount) external;\n}",
"abi": "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"destination\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destination\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer_substrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
"source": "// SPDX-License-Identifier: GPL-3.0-only\npragma solidity >=0.8.3;\n\n/// @dev The Deposit precompile address\naddress constant SUBSTRATE_TRANSFER_ADDRESS = 0x0000000000000000000000000000000000000Fd1;\n\nSubstrateTransfer constant SUBSTRATE_TRANSFER_ADRRESS = SubstrateTransfer(SUBSTRATE_TRANSFER_ADDRESS);\n\n/// @title SubstrateTransfer interface\ninterface SubstrateTransfer {\n /// @dev Event emitted when a transfer has been performed.\n /// @param from Address which tokens are sent from.\n /// @param destination The Substrate address receiving the tokens.\n /// @param amount The amount of tokens transferred.\n event Transfer(address indexed from, bytes32 indexed destination, uint256 amount);\n\n /// @dev Function to transfer tokens to a Substrate address.\n /// @param destination The Substrate address receiving the tokens.\n /// @param amount The amount of tokens to transfer.\n function transfer_substrate(bytes32 destination, uint256 amount) external;\n}",
"abi": "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destination\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destination\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer_substrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
}
]
4 changes: 2 additions & 2 deletions precompiles/metadata/precompiles-creditcoin3-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "SubstrateTransfer",
"bytecode": "0xfe",
"compiler": "Not Installed",
"source": "// SPDX-License-Identifier: GPL-3.0-only\npragma solidity >=0.8.3;\n\n/// @dev The Deposit precompile address\naddress constant SUBSTRATE_TRANSFER_ADDRESS = 0x0000000000000000000000000000000000000Fd1;\n\nSubstrateTransfer constant SUBSTRATE_TRANSFER_ADRRESS = SubstrateTransfer(SUBSTRATE_TRANSFER_ADDRESS);\n\n/// @title SubstrateTransfer interface\ninterface SubstrateTransfer {\n /// @dev Event emitted when a transfer has been performed.\n /// @param destination The Substrate address receiving the tokens.\n /// @param amount The amount of tokens transferred.\n event Transfer(bytes32 destination, uint256 amount);\n\n /// @dev Function to transfer tokens to a Substrate address.\n /// @param destination The Substrate address receiving the tokens.\n /// @param amount The amount of tokens to transfer.\n function transfer_substrate(bytes32 destination, uint256 amount) external;\n}",
"abi": "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"destination\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destination\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer_substrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
"source": "// SPDX-License-Identifier: GPL-3.0-only\npragma solidity >=0.8.3;\n\n/// @dev The Deposit precompile address\naddress constant SUBSTRATE_TRANSFER_ADDRESS = 0x0000000000000000000000000000000000000Fd1;\n\nSubstrateTransfer constant SUBSTRATE_TRANSFER_ADRRESS = SubstrateTransfer(SUBSTRATE_TRANSFER_ADDRESS);\n\n/// @title SubstrateTransfer interface\ninterface SubstrateTransfer {\n /// @dev Event emitted when a transfer has been performed.\n /// @param from Address which tokens are sent from.\n /// @param destination The Substrate address receiving the tokens.\n /// @param amount The amount of tokens transferred.\n event Transfer(address indexed from, bytes32 indexed destination, uint256 amount);\n\n /// @dev Function to transfer tokens to a Substrate address.\n /// @param destination The Substrate address receiving the tokens.\n /// @param amount The amount of tokens to transfer.\n function transfer_substrate(bytes32 destination, uint256 amount) external;\n}",
"abi": "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destination\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destination\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer_substrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
}
]
3 changes: 2 additions & 1 deletion precompiles/metadata/sol/substrate_transfer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ SubstrateTransfer constant SUBSTRATE_TRANSFER_ADRRESS = SubstrateTransfer(SUBSTR
/// @title SubstrateTransfer interface
interface SubstrateTransfer {
/// @dev Event emitted when a transfer has been performed.
/// @param from Address which tokens are sent from.
/// @param destination The Substrate address receiving the tokens.
/// @param amount The amount of tokens transferred.
event Transfer(bytes32 destination, uint256 amount);
event Transfer(address indexed from, bytes32 indexed destination, uint256 amount);

/// @dev Function to transfer tokens to a Substrate address.
/// @param destination The Substrate address receiving the tokens.
Expand Down
2 changes: 1 addition & 1 deletion precompiles/substrate-transfer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod mock;
mod tests;

/// Solidity selector of the Transfer log, which is the Keccak of the Log signature.
pub const SELECTOR_LOG_TRANSFER: [u8; 32] = keccak256!("Transfer(bytes32,uint256)");
pub const SELECTOR_LOG_TRANSFER: [u8; 32] = keccak256!("Transfer(address,bytes32,uint256)");

/// Alias for the Balance type for the provided Runtime and Instance.
pub type BalanceOf<Runtime, Instance = ()> =
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("creditcoin3"),
impl_name: create_runtime_str!("creditcoin3"),
authoring_version: 3,
spec_version: 33,
spec_version: 34,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
Loading