Skip to content
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
22 changes: 9 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- beta
- develop
env:
NODE_VERSION: 16
NODE_VERSION: 24

jobs:
build:
Expand All @@ -21,10 +21,9 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Install project
Expand All @@ -51,31 +50,28 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
commit: ${{ github.sha }}
prerelease: ${{ env.PRERELEASE }}

clean:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
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/skale-manager-interfaces $SOURCE_BRANCH
npm --//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN dist-tag rm @skalenetwork/skale-manager-interfaces $SOURCE_BRANCH
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build and test
on: [push, pull_request]
on: [push]

env:
NODE_VERSION: 16
NODE_VERSION: 24
PYTHON_VERSION: 3.9

jobs:
Expand All @@ -13,13 +13,13 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,11 @@ typechain/
.openzeppelin/.session

# docs
docs/api/*
docs/api/*

# modern yarn
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
yarnPath: .yarn/releases/yarn-4.6.0.cjs

# TODO: replace with pnp when slither-analyzer supports it
nodeLinker: pnpm
5 changes: 4 additions & 1 deletion contracts/IBountyV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ interface IBountyV2 {
function enableBountyReduction() external;
function disableBountyReduction() external;
function setNodeCreationWindowSeconds(uint window) external;
function setPsrActivationMonth(uint256 month) external;
function handleDelegationAdd(uint amount, uint month) external;
function handleDelegationRemoving(uint amount, uint month) external;
function estimateBounty(uint nodeIndex) external view returns (uint);
function getNextRewardTimestamp(uint nodeIndex) external view returns (uint);
function getEffectiveDelegatedSum() external view returns (uint[] memory);
}
function getRequiredDelegationAmount(uint256 nodesNumber) external view returns (uint256 requiredDelegationAmount);
function getRequiredNodesNumber(uint256 delegatedValue) external view returns (uint256 requiredNodesNumber);
}
7 changes: 6 additions & 1 deletion contracts/IConstantsHolder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ interface IConstantsHolder {
function setMinimalSchainLifetime(uint lifetime) external;
function setComplaintTimeLimit(uint timeLimit) external;
function setMinNodeBalance(uint newMinNodeBalance) external;
function reinitialize() external;
// Corresponds to the public field
// solhint-disable func-name-mixedcase
// slither-disable-start naming-convention
function ALRIGHT_DELTA() external view returns (uint256);
function BROADCAST_DELTA() external view returns (uint256);
function COMPLAINT_BAD_DATA_DELTA() external view returns (uint256);
function PRE_RESPONSE_DELTA() external view returns (uint256);
function COMPLAINT_DELTA() external view returns (uint256);
function RESPONSE_DELTA() external view returns (uint256);
function BOUNTY_LOCKUP_MONTHS() external view returns (uint256);
function NODE_DEPOSIT() external view returns (uint256);
function SECONDS_TO_YEAR() external view returns (uint32);
Expand Down
11 changes: 8 additions & 3 deletions contracts/IContractManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@

pragma solidity >=0.6.10 <0.9.0;

import {IBountyV2} from "./IBountyV2.sol";
import {IConstantsHolder} from "./IConstantsHolder.sol";
import {ITimeHelpers} from "./delegation/ITimeHelpers.sol";


interface IContractManager {
/**
* @dev Emitted when contract is upgraded.
Expand All @@ -31,10 +36,10 @@ interface IContractManager {
function setContractsAddress(string calldata contractsName, address newContractsAddress) external;
function contracts(bytes32 nameHash) external view returns (address);
function getDelegationPeriodManager() external view returns (address);
function getBounty() external view returns (address);
function getBounty() external view returns (IBountyV2);
function getValidatorService() external view returns (address);
function getTimeHelpers() external view returns (address);
function getConstantsHolder() external view returns (address);
function getTimeHelpers() external view returns (ITimeHelpers);
function getConstantsHolder() external view returns (IConstantsHolder);
function getSkaleToken() external view returns (address);
function getTokenState() external view returns (address);
function getPunisher() external view returns (address);
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@
"author": "Dmytro Stebaiev <dmytro@skalelabs.com>",
"license": "AGPL-3.0",
"files": [
"*.sol",
"**/*.sol"
],
"scripts": {
"compile": "npx hardhat clean && npx hardhat compile",
"compile": "yarn hardhat clean && yarn hardhat compile",
"hooks": "git config core.hooksPath .githooks || true",
"fullcheck": "yarn lint && yarn slither",
"lint": "npx solhint \"contracts/**/*.sol\"",
"lint": "yarn solhint \"contracts/**/*.sol\"",
"slither": "slither ."
},
"dependencies": {},
"devDependencies": {
"@types/node": "^25.3.0",
"hardhat": "^2.3.0",
"solhint": "^3.3.6",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
"packageManager": "yarn@4.6.0"
}
13 changes: 12 additions & 1 deletion scripts/publish_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,15 @@ cp LICENSE contracts
cp README.md contracts
cp package.json contracts

yarn publish contracts --access public --new-version $VERSION --verbose --no-git-tag-version $TAG --ignore-scripts
cd contracts

# set version
package="$(jq --arg v "$VERSION" '.version = $v' package.json)"
echo -E "${package}" > package.json

touch yarn.lock
yarn config set enableImmutableInstalls false
yarn config set npmAuthToken "$NODE_AUTH_TOKEN"
yarn

yarn npm publish --access public $TAG
Loading
Loading