-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from skalenetwork/release
First release
- Loading branch information
Showing
24 changed files
with
1,196 additions
and
695 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,29 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"mocha": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "tsconfig.json", | ||
"tsconfigRootDir": "." | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": ["error"] | ||
}, | ||
"ignorePatterns": [ | ||
"coverage/**", | ||
"docs/**", | ||
"typechain-types/**" | ||
] | ||
} |
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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.0.1 | ||
1.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
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
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
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
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
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,65 @@ | ||
// tslint:disable:no-console | ||
|
||
import { promises as fs } from 'fs'; | ||
import { ethers, upgrades, network } from "hardhat"; | ||
import { getAbi } from './tools/abi'; | ||
import { verifyProxy } from './tools/verification'; | ||
import { getVersion } from './tools/version'; | ||
|
||
|
||
export function getContractKeyInAbiFile(contract: string) { | ||
return contract.replace(/([a-zA-Z])(?=[A-Z])/g, '$1_').toLowerCase(); | ||
} | ||
|
||
async function main() { | ||
const [ deployer,] = await ethers.getSigners(); | ||
|
||
const version = await getVersion(); | ||
|
||
// Usage information: | ||
// | ||
// Optional variables: | ||
// IMA_ADDRESS | ||
// | ||
// For custom network do not forget to set: | ||
// ENDPOINT - rpc endpoint | ||
// PRIVATE_KEY - deployer private key | ||
// GASPRICE - optional - desired gas price | ||
// | ||
// Usage example: | ||
// IMA_ADDRESS=0xd2AAa00100000000000000000000000000000000 npx hardhat run migrations/deploy.ts --network custom | ||
|
||
const ownerAddress = deployer.address; | ||
const imaAddress = process.env.IMA_ADDRESS ? process.env.IMA_ADDRESS : ethers.constants.AddressZero; | ||
if (imaAddress === ethers.constants.AddressZero) { | ||
console.log("IMA MessageProxy was not passed. Zero address will be used."); | ||
} | ||
|
||
console.log("Deploy Marionette"); | ||
const marionetteUpgradeableFactory = await ethers.getContractFactory("Marionette"); | ||
const marionette = (await upgrades.deployProxy(marionetteUpgradeableFactory, [ownerAddress, imaAddress])); | ||
await marionette.deployTransaction.wait(); | ||
const marionetteAddress = marionette.address; | ||
const marionetteInterface = marionette.interface; | ||
await verifyProxy("Marionette", marionette.address, []); | ||
|
||
|
||
console.log("Store ABIs"); | ||
|
||
const abiAndAddresses: {[key: string]: string | []} = {}; | ||
abiAndAddresses[getContractKeyInAbiFile("Marionette") + "_address"] = marionetteAddress; | ||
abiAndAddresses[getContractKeyInAbiFile("Marionette") + "_abi"] = getAbi(marionetteInterface); | ||
|
||
await fs.writeFile(`data/marionette-${version}-${network.name}-abi-and-addresses.json`, JSON.stringify(abiAndAddresses, null, 4)); | ||
|
||
console.log("Done"); | ||
} | ||
|
||
if (require.main === module) { | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); | ||
} |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "marionette", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"description": "Predeployed smart contract on skale chain that is controlled by external entity.", | ||
"main": "index.js", | ||
"repository": "[email protected]:skalenetwork/marionette.git", | ||
|
@@ -14,44 +14,45 @@ | |
"cspell": "npx cspell \"**/*\"", | ||
"slither": "slither .", | ||
"tsc": "npx tsc --noEmit", | ||
"tslint": "npx tslint --project .", | ||
"eslint": "npx eslint --cache --ext .js,.jsx,.ts,.tsx .", | ||
"test": "yarn tsc && npx hardhat test", | ||
"fullCheck": "yarn lint && yarn cspell && yarn slither && yarn tsc && yarn tslint", | ||
"fullCheck": "yarn lint && yarn cspell && yarn slither && yarn tsc && yarn eslint", | ||
"hooks": "git config core.hooksPath .githooks || true", | ||
"no-hooks": "git config core.hooksPath .git/hooks" | ||
}, | ||
"devDependencies": { | ||
"@ethersproject/abi": "^5.5.0", | ||
"@ethersproject/bytes": "^5.5.0", | ||
"@ethersproject/providers": "^5.5.0", | ||
"@nomiclabs/hardhat-ethers": "^2.0.2", | ||
"@nomiclabs/hardhat-etherscan": "^2.1.7", | ||
"@nomiclabs/hardhat-waffle": "^2.0.1", | ||
"@openzeppelin/hardhat-upgrades": "^1.12.0", | ||
"@typechain/ethers-v5": "^8.0.1", | ||
"@typechain/hardhat": "^3.0.0", | ||
"@types/chai": "^4.2.22", | ||
"@nomiclabs/hardhat-ethers": "^2.0.4", | ||
"@nomiclabs/hardhat-etherscan": "^3.0.0", | ||
"@nomiclabs/hardhat-waffle": "^2.0.2", | ||
"@openzeppelin/hardhat-upgrades": "^1.13.0", | ||
"@typechain/ethers-v5": "^9.0.0", | ||
"@typechain/hardhat": "^4.0.0", | ||
"@types/chai": "^4.3.0", | ||
"@types/chai-as-promised": "^7.1.4", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^16.11.6", | ||
"chai": "^4.3.4", | ||
"@types/mocha": "^9.1.0", | ||
"@types/node": "^17.0.13", | ||
"@typescript-eslint/eslint-plugin": "^5.10.1", | ||
"@typescript-eslint/parser": "^5.10.1", | ||
"chai": "^4.3.6", | ||
"chai-as-promised": "^7.1.1", | ||
"cspell": "^5.12.6", | ||
"cspell": "^5.17.0", | ||
"eslint": "^8.7.0", | ||
"ethereum-waffle": "^3.0.0", | ||
"ethers": "^5.5.1", | ||
"hardhat": "^2.6.8", | ||
"ethers": "^5.5.3", | ||
"hardhat": "^2.8.3", | ||
"kill-port": "^1.6.1", | ||
"lodash": "^4.17.21", | ||
"solhint": "^3.3.6", | ||
"solidity-coverage": "^0.7.17", | ||
"solidity-coverage": "^0.7.18", | ||
"ts-node": "^10.4.0", | ||
"tslint": "^6.1.3", | ||
"tslint-no-unused-expression-chai": "^0.1.4", | ||
"typechain": "^6.0.2", | ||
"typescript": "^4.4.4" | ||
"typechain": "^7.0.0", | ||
"typescript": "^4.5.5" | ||
}, | ||
"dependencies": { | ||
"@openzeppelin/contracts-upgradeable": "^4.3.2", | ||
"@openzeppelin/contracts-upgradeable": "^4.4.2", | ||
"@skalenetwork/ima-interfaces": "^0.0.1" | ||
} | ||
} |
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
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,11 @@ | ||
#!/usr/bin/env python | ||
from marionette_predeployed.marionette_generator import MarionetteGenerator | ||
import json | ||
|
||
|
||
def main(): | ||
print(json.dumps(MarionetteGenerator().get_abi(), sort_keys=True, indent=4)) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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
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
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
Oops, something went wrong.