Skip to content

Commit 5bed6da

Browse files
authored
[FIX] - js library -> resolc for revive (#745)
* fix: web3js references to revive * fix: ethersjs references to revive * fix: viem references to revive
1 parent e0f9aaf commit 5bed6da

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

.snippets/code/develop/smart-contracts/evm-toolkit/ethers-js/compile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { compile } = require('@parity/revive');
1+
const { compile } = require('@parity/resolc');
22
const { readFileSync, writeFileSync } = require('fs');
33
const { basename, join } = require('path');
44

.snippets/code/develop/smart-contracts/evm-toolkit/libraries/web3-js/compile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { compile } = require('@parity/revive');
1+
const { compile } = require('@parity/resolc');
22
const { readFileSync, writeFileSync } = require('fs');
33
const { basename, join } = require('path');
44

@@ -30,7 +30,7 @@ const compileContract = async (solidityFilePath, outputDir) => {
3030
const bytecodePath = join(outputDir, `${name}.polkavm`);
3131
writeFileSync(
3232
bytecodePath,
33-
Buffer.from(contract.evm.bytecode.object, 'hex')
33+
Buffer.from(contract.evm.bytecode.object, 'hex'),
3434
);
3535
console.log(`Bytecode saved to ${bytecodePath}`);
3636
}

.snippets/code/develop/smart-contracts/libraries/viem/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { compile } from '@parity/revive';
1+
import { compile } from '@parity/resolc';
22
import { readFileSync, writeFileSync } from 'fs';
33
import { basename, join } from 'path';
44

develop/smart-contracts/libraries/ethers-js.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ The `revive` compiler transforms Solidity smart contracts into [PolkaVM](/develo
107107

108108
### Install the Revive Library
109109

110-
The [`@parity/revive`](https://www.npmjs.com/package/@parity/revive){target=\_blank} library will compile your Solidity code for deployment on Polkadot Hub. Run the following command in your terminal to install the library:
110+
The [`@parity/resolc`](https://www.npmjs.com/package/@parity/resolc){target=\_blank} library will compile your Solidity code for deployment on Polkadot Hub. Run the following command in your terminal to install the library:
111111

112112
```bash
113-
npm install --save-dev @parity/revive
113+
npm install --save-dev @parity/resolc
114114
```
115115

116-
This guide uses `@parity/revive` version `{{ dependencies.javascript_packages.revive.version }}`.
116+
This guide uses `@parity/resolc` version `{{ dependencies.javascript_packages.resolc.version }}`.
117117

118118
### Sample Storage Smart Contract
119119

develop/smart-contracts/libraries/viem.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ npm init -y
5353

5454
## Install Dependencies
5555

56-
Install viem along with other necessary dependencies, including [@parity/revive](https://www.npmjs.com/package/@parity/revive){target=\_blank}, which enables to compile smart contracts to [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design/#polkavm){target=\_blank} bytecode:
56+
Install viem along with other necessary dependencies, including [@parity/resolc](https://www.npmjs.com/package/@parity/resolc){target=\_blank}, which enables to compile smart contracts to [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design/#polkavm){target=\_blank} bytecode:
5757

5858
```bash
59-
# Install viem and Revive
60-
npm install viem @parity/revive
59+
# Install viem and resolc
60+
npm install viem @parity/resolc
6161

6262
# Install TypeScript and development dependencies
6363
npm install --save-dev typescript ts-node @types/node

develop/smart-contracts/libraries/web3-js.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ For instance, to fetch the latest block number of the chain, you can use the fol
9797

9898
--8<-- 'text/smart-contracts/code-size.md'
9999

100-
Polkadot Hub requires contracts to be compiled to [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design/){target=\_blank} bytecode. This is achieved using the [`revive`](https://github.com/paritytech/revive){target=\_blank} compiler. Install the [`@parity/revive`](https://github.com/paritytech/js-revive){target=\_blank} library as a development dependency:
100+
Polkadot Hub requires contracts to be compiled to [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design/){target=\_blank} bytecode. This is achieved using the [`revive`](https://github.com/paritytech/revive/tree/v0.2.0/js/resolc){target=\_blank} compiler. Install the [`@parity/resolc`](https://github.com/paritytech/revive){target=\_blank} library as a development dependency:
101101

102102
```bash
103-
npm install --save-dev @parity/revive
103+
npm install --save-dev @parity/resolc
104104
```
105105

106-
This guide uses `@parity/revive` version `{{ dependencies.javascript_packages.revive.version }}`.
106+
This guide uses `@parity/resolc` version `{{ dependencies.javascript_packages.resolc.version }}`.
107107

108108
Here's a simple storage contract that you can use to follow the process:
109109

llms.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9357,13 +9357,13 @@ The `revive` compiler transforms Solidity smart contracts into [PolkaVM](/develo
93579357

93589358
### Install the Revive Library
93599359

9360-
The [`@parity/revive`](https://www.npmjs.com/package/@parity/revive){target=\_blank} library will compile your Solidity code for deployment on Polkadot Hub. Run the following command in your terminal to install the library:
9360+
The [`@parity/resolc`](https://www.npmjs.com/package/@parity/resolc){target=\_blank} library will compile your Solidity code for deployment on Polkadot Hub. Run the following command in your terminal to install the library:
93619361

93629362
```bash
9363-
npm install --save-dev @parity/revive
9363+
npm install --save-dev @parity/resolc
93649364
```
93659365

9366-
This guide uses `@parity/revive` version `{{ dependencies.javascript_packages.revive.version }}`.
9366+
This guide uses `@parity/resolc` version `{{ dependencies.javascript_packages.resolc.version }}`.
93679367

93689368
### Sample Storage Smart Contract
93699369

@@ -9398,7 +9398,7 @@ contract Storage {
93989398
To compile this contract, use the following script:
93999399

94009400
```js title="scripts/compile.js"
9401-
const { compile } = require('@parity/revive');
9401+
const { compile } = require('@parity/resolc');
94029402
const { readFileSync, writeFileSync } = require('fs');
94039403
const { basename, join } = require('path');
94049404

@@ -9884,11 +9884,11 @@ npm init -y
98849884

98859885
## Install Dependencies
98869886

9887-
Install viem along with other necessary dependencies, including [@parity/revive](https://www.npmjs.com/package/@parity/revive){target=\_blank}, which enables to compile smart contracts to [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design/#polkavm){target=\_blank} bytecode:
9887+
Install viem along with other necessary dependencies, including [@parity/resolc](https://www.npmjs.com/package/@parity/resolc){target=\_blank}, which enables to compile smart contracts to [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design/#polkavm){target=\_blank} bytecode:
98889888

98899889
```bash
9890-
# Install viem and Revive
9891-
npm install viem @parity/revive
9890+
# Install viem and resolc
9891+
npm install viem @parity/resolc
98929892

98939893
# Install TypeScript and development dependencies
98949894
npm install --save-dev typescript ts-node @types/node
@@ -10115,7 +10115,7 @@ contract Storage {
1011510115
Create a new file at `src/compile.ts` for handling contract compilation:
1011610116

1011710117
```typescript title="src/compile.ts"
10118-
import { compile } from '@parity/revive';
10118+
import { compile } from '@parity/resolc';
1011910119
import { readFileSync, writeFileSync } from 'fs';
1012010120
import { basename, join } from 'path';
1012110121

@@ -10945,13 +10945,13 @@ main();
1094510945

1094610946
For detailed comparisons and migration guidelines, see the [EVM vs. PolkaVM](/polkadot-protocol/smart-contract-basics/evm-vs-polkavm/#current-memory-limits){target=\_blank} documentation page.
1094710947

10948-
Polkadot Hub requires contracts to be compiled to [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design/){target=\_blank} bytecode. This is achieved using the [`revive`](https://github.com/paritytech/revive){target=\_blank} compiler. Install the [`@parity/revive`](https://github.com/paritytech/js-revive){target=\_blank} library as a development dependency:
10948+
Polkadot Hub requires contracts to be compiled to [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design/){target=\_blank} bytecode. This is achieved using the [`revive`](https://github.com/paritytech/revive/tree/v0.2.0/js/resolc){target=\_blank} compiler. Install the [`@parity/resolc`](https://github.com/paritytech/revive){target=\_blank} library as a development dependency:
1094910949

1095010950
```bash
10951-
npm install --save-dev @parity/revive
10951+
npm install --save-dev @parity/resolc
1095210952
```
1095310953

10954-
This guide uses `@parity/revive` version `{{ dependencies.javascript_packages.revive.version }}`.
10954+
This guide uses `@parity/resolc` version `{{ dependencies.javascript_packages.resolc.version }}`.
1095510955

1095610956
Here's a simple storage contract that you can use to follow the process:
1095710957

@@ -10979,7 +10979,7 @@ contract Storage {
1097910979
With that, you can now create a `compile.js` snippet that transforms your solidity code into PolkaVM bytecode:
1098010980

1098110981
```javascript title="scripts/compile.js"
10982-
const { compile } = require('@parity/revive');
10982+
const { compile } = require('@parity/resolc');
1098310983
const { readFileSync, writeFileSync } = require('fs');
1098410984
const { basename, join } = require('path');
1098510985

@@ -11011,7 +11011,7 @@ const compileContract = async (solidityFilePath, outputDir) => {
1101111011
const bytecodePath = join(outputDir, `${name}.polkavm`);
1101211012
writeFileSync(
1101311013
bytecodePath,
11014-
Buffer.from(contract.evm.bytecode.object, 'hex')
11014+
Buffer.from(contract.evm.bytecode.object, 'hex'),
1101511015
);
1101611016
console.log(`Bytecode saved to ${bytecodePath}`);
1101711017
}

variables.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ dependencies:
7070
hardhat_revive_node:
7171
name: '@hardhat-revive-node'
7272
version: 0.0.6
73-
revive:
74-
name: '@revive'
75-
version: 0.0.8
73+
resolc:
74+
name: '@resolc'
75+
version: 0.2.0
7676
web3_js:
7777
name: '@web3js'
7878
version: 4.16.0

0 commit comments

Comments
 (0)