Skip to content

Commit 68c433a

Browse files
committed
fix: web3js references to revive
1 parent 7bf160a commit 68c433a

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
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
}

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
@@ -8840,13 +8840,13 @@ The `revive` compiler transforms Solidity smart contracts into [PolkaVM](/develo
88408840

88418841
### Install the Revive Library
88428842

8843-
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:
8843+
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:
88448844

88458845
```bash
8846-
npm install --save-dev @parity/revive
8846+
npm install --save-dev @parity/resolc
88478847
```
88488848

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

88518851
### Sample Storage Smart Contract
88528852

@@ -8881,7 +8881,7 @@ contract Storage {
88818881
To compile this contract, use the following script:
88828882

88838883
```js title="scripts/compile.js"
8884-
const { compile } = require('@parity/revive');
8884+
const { compile } = require('@parity/resolc');
88858885
const { readFileSync, writeFileSync } = require('fs');
88868886
const { basename, join } = require('path');
88878887

@@ -9367,11 +9367,11 @@ npm init -y
93679367

93689368
## Install Dependencies
93699369

9370-
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:
9370+
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:
93719371

93729372
```bash
9373-
# Install viem and Revive
9374-
npm install viem @parity/revive
9373+
# Install viem and resolc
9374+
npm install viem @parity/resolc
93759375

93769376
# Install TypeScript and development dependencies
93779377
npm install --save-dev typescript ts-node @types/node
@@ -9598,7 +9598,7 @@ contract Storage {
95989598
Create a new file at `src/compile.ts` for handling contract compilation:
95999599

96009600
```typescript title="src/compile.ts"
9601-
import { compile } from '@parity/revive';
9601+
import { compile } from '@parity/resolc';
96029602
import { readFileSync, writeFileSync } from 'fs';
96039603
import { basename, join } from 'path';
96049604

@@ -10428,13 +10428,13 @@ main();
1042810428

1042910429
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.
1043010430

10431-
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:
10431+
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:
1043210432

1043310433
```bash
10434-
npm install --save-dev @parity/revive
10434+
npm install --save-dev @parity/resolc
1043510435
```
1043610436

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

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

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

1046410464
```javascript title="scripts/compile.js"
10465-
const { compile } = require('@parity/revive');
10465+
const { compile } = require('@parity/resolc');
1046610466
const { readFileSync, writeFileSync } = require('fs');
1046710467
const { basename, join } = require('path');
1046810468

@@ -10494,7 +10494,7 @@ const compileContract = async (solidityFilePath, outputDir) => {
1049410494
const bytecodePath = join(outputDir, `${name}.polkavm`);
1049510495
writeFileSync(
1049610496
bytecodePath,
10497-
Buffer.from(contract.evm.bytecode.object, 'hex')
10497+
Buffer.from(contract.evm.bytecode.object, 'hex'),
1049810498
);
1049910499
console.log(`Bytecode saved to ${bytecodePath}`);
1050010500
}

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)