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

Update skale-manager-interfaces to integrate Paymaster #386

Merged
merged 4 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
59 changes: 59 additions & 0 deletions contracts/IMessageListener.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// SPDX-License-Identifier: AGPL-3.0-only

/**
* IMessageListener.sol - SKALE Interchain Messaging Agent
* Copyright (C) 2021-Present SKALE Labs
* @author Dmytro Stebaiev
*
* SKALE IMA is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SKALE IMA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with SKALE IMA. If not, see <https://www.gnu.org/licenses/>.
*/

pragma solidity >=0.6.10 <0.9.0;


interface IMessageListener {
/**
* @dev Structure that describes message. Should contain sender of message,
* destination contract on schain that will receiver message,
* data that contains all needed info about token or ETH.
*/
struct Message {
address sender;
address destinationContract;
bytes data;
}

/**
* @dev Structure that contains fields for bls signature.
*/
struct Signature {
uint256[2] blsSignature;
uint256 hashA;
uint256 hashB;
uint256 counter;
}

function postIncomingMessages(

Check warning on line 47 in contracts/IMessageListener.sol

View workflow job for this annotation

GitHub Actions / test

Function postIncomingMessages() must match Foundry test naming convention

Check warning on line 47 in contracts/IMessageListener.sol

View workflow job for this annotation

GitHub Actions / test

Function postIncomingMessages() must match Foundry test naming convention
string calldata fromSchainName,
uint256 startingCounter,
Message[] calldata messages,
Signature calldata sign
) external;

function postOutgoingMessage(

Check warning on line 54 in contracts/IMessageListener.sol

View workflow job for this annotation

GitHub Actions / test

Function postOutgoingMessage() must match Foundry test naming convention

Check warning on line 54 in contracts/IMessageListener.sol

View workflow job for this annotation

GitHub Actions / test

Function postOutgoingMessage() must match Foundry test naming convention
bytes32 targetChainHash,
address targetContract,
bytes memory data
) external;
}
39 changes: 4 additions & 35 deletions contracts/IMessageProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,15 @@

pragma solidity >=0.6.10 <0.9.0;

import { IMessageListener } from "./IMessageListener.sol";

interface IMessageProxy {

/**
* @dev Structure that describes message. Should contain sender of message,
* destination contract on schain that will receiver message,
* data that contains all needed info about token or ETH.
*/
struct Message {
address sender;
address destinationContract;
bytes data;
}

/**
* @dev Structure that contains fields for bls signature.
*/
struct Signature {
uint256[2] blsSignature;
uint256 hashA;
uint256 hashB;
uint256 counter;
}

interface IMessageProxy is IMessageListener {
function addConnectedChain(string calldata schainName) external;

Check warning on line 28 in contracts/IMessageProxy.sol

View workflow job for this annotation

GitHub Actions / test

Function addConnectedChain() must match Foundry test naming convention

Check warning on line 28 in contracts/IMessageProxy.sol

View workflow job for this annotation

GitHub Actions / test

Function addConnectedChain() must match Foundry test naming convention
function postIncomingMessages(
string calldata fromSchainName,
uint256 startingCounter,
Message[] calldata messages,
Signature calldata sign
) external;
function setNewGasLimit(uint256 newGasLimit) external;

Check warning on line 29 in contracts/IMessageProxy.sol

View workflow job for this annotation

GitHub Actions / test

Function setNewGasLimit() must match Foundry test naming convention

Check warning on line 29 in contracts/IMessageProxy.sol

View workflow job for this annotation

GitHub Actions / test

Function setNewGasLimit() must match Foundry test naming convention
function registerExtraContractForAll(address extraContract) external;
function removeExtraContractForAll(address extraContract) external;
function removeExtraContractForAll(address extraContract) external;
function removeConnectedChain(string memory schainName) external;
function postOutgoingMessage(
bytes32 targetChainHash,
address targetContract,
bytes memory data
) external;
function registerExtraContract(string memory chainName, address extraContract) external;
function removeExtraContract(string memory schainName, address extraContract) external;
function setVersion(string calldata newVersion) external;
Expand All @@ -81,4 +50,4 @@
function getIncomingMessagesCounter(string calldata fromSchainName) external view returns (uint256);
function isConnectedChain(string memory schainName) external view returns (bool);
function getLastOutgoingMessageBlockId(string memory targetSchainName) external view returns (uint);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"fullCheck": "yarn lint && yarn cspell && yarn slither"
},
"dependencies": {
"@skalenetwork/skale-manager-interfaces": "^3.1.0"
"@skalenetwork/skale-manager-interfaces": "^3.2.0-paymaster.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to change it, after merging PR in skale-manager-interfaces

},
"devDependencies": {
"@types/node": "^20.4.5",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -893,10 +893,10 @@
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-5.6.0.tgz#41dd6093d34652cddb5d5bdeee04eafc33826668"
integrity sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==

"@skalenetwork/skale-manager-interfaces@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@skalenetwork/skale-manager-interfaces/-/skale-manager-interfaces-3.1.0.tgz#e97750462b1dafa9eee1c347802d5405afc9474f"
integrity sha512-lVJM6nRfIrlwRy7N009jGCZa5nDJo2/QMrKN0A2nRz/sqT8wWlOQUeDKrJ1mC5Esdbzhya6T6hTiZbN2yNwcRg==
"@skalenetwork/skale-manager-interfaces@^3.2.0-paymaster.0":
version "3.2.0-paymaster.0"
resolved "https://registry.yarnpkg.com/@skalenetwork/skale-manager-interfaces/-/skale-manager-interfaces-3.2.0-paymaster.0.tgz#4fee7d3a6dfd1dc8c446f6d28a2252fce426b537"
integrity sha512-AC0g3dMAtHORQnxm9QoZIgpNqTNwe/ahK9kPyTQFV/Ht3/sIoWkx0vXUiAwsDzK56HAVFXfc+LqfmEnKiefDqg==

"@solidity-parser/parser@^0.18.0":
version "0.18.0"
Expand Down
Loading