-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae0bd4d
commit 5dfee17
Showing
25 changed files
with
6,447 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ $(yarn exec cspell -- --no-summary $1 2> /dev/null) ]] | ||
then | ||
echo "It looks like you have spell-checking errors in your commit message." | ||
yarn exec cspell -- --no-summary $1 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# cSpell:words gpgsign | ||
|
||
set -e | ||
|
||
GPG_SIGN_ENABLED=$(git config commit.gpgsign || true) | ||
if ! [[ "$GPG_SIGN_ENABLED" == "true" ]] | ||
then | ||
echo "Enable GPG signature for new commits"; | ||
exit 1; | ||
fi | ||
|
||
exec git diff --cached --name-only | yarn exec cspell --no-summary --no-progress --no-must-find-files --file-list stdin | ||
|
||
yarn fullCheck |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* @DimaStebaev | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "saturday" | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/contracts/" | ||
schedule: | ||
interval: "weekly" | ||
day: "saturday" | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/scripts/" | ||
schedule: | ||
interval: "weekly" | ||
day: "saturday" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# spell-checker:words ncipollo | ||
|
||
name: Build and publish | ||
on: | ||
push: | ||
branches-ignore: | ||
- stable | ||
- beta | ||
- develop | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- stable | ||
- beta | ||
- develop | ||
env: | ||
NODE_VERSION: 20 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
|
||
- name: Install project | ||
run: yarn | ||
|
||
- name: Build contracts | ||
run: yarn compile | ||
|
||
- name: Determine version | ||
run: | | ||
export BRANCH=${GITHUB_REF##*/} | ||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV | ||
echo "Branch $BRANCH" | ||
export VERSION=$(bash ./scripts/calculate_version.sh) | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
echo "Version $VERSION" | ||
( test $BRANCH = "stable" && export PRERELEASE=false ) || export PRERELEASE=true | ||
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV | ||
- name: Publish NPM package | ||
run: ./scripts/publish_package.sh | ||
env: | ||
BRANCH: ${{ env.BRANCH }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ env.VERSION }} | ||
prerelease: ${{ env.PRERELEASE }} | ||
|
||
clean: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
|
||
- name: Remove feature tag | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
export SOURCE_BRANCH=${GITHUB_HEAD_REF##*/} | ||
echo "Source branch: $SOURCE_BRANCH" | ||
npm dist-tag rm @skalenetwork/marionette-interfaces $SOURCE_BRANCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build and test | ||
on: [push, pull_request] | ||
|
||
env: | ||
NODE_VERSION: 20 | ||
PYTHON_VERSION: 3.11 | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: 'pip' | ||
cache-dependency-path: scripts/requirements.txt | ||
|
||
- name: Install project | ||
run: yarn | ||
|
||
- name: Install slither | ||
run: pip3 install -r scripts/requirements.txt | ||
|
||
- name: Show slither version | ||
run: slither --version | ||
|
||
- name: Check spelling | ||
run: yarn cspell | ||
|
||
- name: lint | ||
run: yarn fullCheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,3 +128,10 @@ dist | |
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
# Hardhat files | ||
cache | ||
artifacts | ||
|
||
# python | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "dictionary"] | ||
path = dictionary | ||
url = https://github.com/skalenetwork/dictionary.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"extends": "solhint:all", | ||
"rules": { | ||
"foundry-test-functions": ["off"], | ||
|
||
"avoid-tx-origin": "error", | ||
"check-send-result": "error", | ||
"code-complexity": "error", | ||
"compiler-version": ["error","^0.8.0"], | ||
"contract-name-camelcase": "error", | ||
"explicit-types": "error", | ||
"func-name-mixedcase": "error", | ||
"function-max-lines": "error", | ||
"gas-named-return-values": "error", | ||
"max-states-count": "error", | ||
"no-empty-blocks": "error", | ||
"no-global-import": "error", | ||
"no-inline-assembly": "error", | ||
"no-unused-vars": "error", | ||
"ordering": "error", | ||
"private-vars-leading-underscore": "error", | ||
"state-visibility": "error", | ||
"visibility-modifier-order": "error" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
yarnPath: .yarn/releases/yarn-4.2.2.cjs | ||
nodeLinker: "node-modules" # remove after this issue is solved: https://github.com/crytic/crytic-compile/issues/331 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
/* | ||
Encoder.sol - Marionette | ||
Copyright (C) 2021-Present SKALE Labs | ||
@author Dmytro Stebaiev | ||
Marionette 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. | ||
Marionette 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 Marionette. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
|
||
library Encoder { | ||
struct FunctionCall { | ||
address receiver; | ||
uint256 value; | ||
bytes data; | ||
} | ||
|
||
// Functions are used by the library users | ||
// slither-disable-start dead-code | ||
|
||
function encodeFunctionCall( | ||
address receiver, | ||
uint256 value, | ||
bytes calldata data | ||
) | ||
internal | ||
pure | ||
returns (bytes memory encodedFunctionCall) | ||
{ | ||
return abi.encode(receiver, value, data); | ||
} | ||
|
||
function decodeFunctionCall(bytes calldata data) private pure returns (FunctionCall memory functionCall) { | ||
(functionCall.receiver, functionCall.value, functionCall.data) = abi.decode(data, (address, uint256, bytes)); | ||
} | ||
|
||
// slither-disable-end dead-code | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
/* | ||
IMarionette.sol - Marionette | ||
Copyright (C) 2021-Present SKALE Labs | ||
@author Dmytro Stebaiev | ||
Marionette 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. | ||
Marionette 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 Marionette. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import {IMessageReceiver} from "@skalenetwork/ima-interfaces/IMessageReceiver.sol"; | ||
|
||
|
||
interface IMarionette is IMessageReceiver { | ||
receive() external payable; | ||
function execute( | ||
address payable target, | ||
uint256 value, | ||
bytes calldata data | ||
) | ||
external | ||
payable | ||
returns (bytes memory returnValue); | ||
function initialize(address owner, address ima) external; | ||
function setVersion(string calldata newVersion) external; | ||
function sendSFuel(address payable target, uint256 value) external payable; | ||
function encodeFunctionCall( | ||
address receiver, | ||
uint256 value, | ||
bytes calldata data | ||
) | ||
external | ||
pure | ||
returns (bytes memory encodedFunctionCall); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "@skalenetwork/marionette-interfaces", | ||
"version": "0.0.0", | ||
"description": "Definitions of interfaces needed to integrate with marionette smart contract", | ||
"repository": "[email protected]:skalenetwork/marionette-interfaces.git", | ||
"author": "Dmytro Stebaiev <[email protected]>", | ||
"license": "AGPL-3.0", | ||
"files": [ | ||
"*.sol", | ||
"**/*.sol" | ||
], | ||
"dependencies": { | ||
"@skalenetwork/ima-interfaces": "^2.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"version": "0.2", | ||
"language": "en", | ||
"ignorePaths": [ | ||
".gitignore", | ||
".solhint.json", | ||
".yarn/**", | ||
"artifacts/**", | ||
"cache/**", | ||
"typechain-types/**", | ||
"**/venv/**" | ||
], | ||
"dictionaries": ["domain-terms", "libraries", "names", "skale-terms", "solidity"], | ||
"dictionaryDefinitions": [ | ||
{ "name": "skale-terms", "path": "dictionary/skale-terms.txt"}, | ||
{ "name": "libraries", "path": "dictionary/libraries.txt"}, | ||
{ "name": "domain-terms", "path": "dictionary/domain-terms.txt"}, | ||
{ "name": "names", "path": "dictionary/names.txt"}, | ||
{ "name": "solidity", "path": "dictionary/solidity.txt"} | ||
] | ||
} |
Submodule dictionary
added at
76852f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { HardhatUserConfig } from "hardhat/config"; | ||
|
||
const config: HardhatUserConfig = { | ||
solidity: "0.8.26", | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.