Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a6158ac
remove dep from astwalker
Aniket-Engg Sep 24, 2025
5a2d91c
remove from analyzer
Aniket-Engg Sep 24, 2025
c1609ca
remove web3 dep from gh-action helper
Aniket-Engg Sep 24, 2025
c17fe4e
remove web3 from remix-solidity and few from remix-debug
Aniket-Engg Sep 25, 2025
417e95a
simulator account ut
Aniket-Engg Sep 30, 2025
d91c3a4
remix simulator blocks ut1
Aniket-Engg Oct 1, 2025
871ddb0
no web3 in blocks ut
Aniket-Engg Oct 2, 2025
68e8274
no web3 in events ut
Aniket-Engg Oct 2, 2025
b29df25
no web3 in misc ut
Aniket-Engg Oct 2, 2025
0f2ae2e
no web3 in tx ut
Aniket-Engg Oct 2, 2025
1b9a2eb
remix-sim web3-utils removal
Aniket-Engg Oct 3, 2025
f20341f
no web3-utils in remix-simulator
Aniket-Engg Oct 3, 2025
d935b7d
web3 removed from remix-simulator
Aniket-Engg Oct 6, 2025
7c73820
web-validator and web-utils removed frmo remix-lib
Aniket-Engg Oct 6, 2025
7ab29a2
no web3 in remix-lib
Aniket-Engg Oct 6, 2025
cb58824
no web3 in remix-debug
Aniket-Engg Oct 6, 2025
78caa8b
no web3 in remix-tests
Aniket-Engg Oct 7, 2025
c9642a0
fix initial ut of remix-tests
Aniket-Engg Oct 8, 2025
6c0defc
more remix-tests unit tests
Aniket-Engg Oct 8, 2025
9dfab81
fix signature retreival
Aniket-Engg Oct 9, 2025
f3edccc
fixed remix-tests runsource UT
Aniket-Engg Oct 10, 2025
9f8e694
all remix-tests ut
Aniket-Engg Oct 10, 2025
1b0d6cf
fix build
Aniket-Engg Oct 10, 2025
324d6f0
fix extendProvider and removed init from remix-lib
Aniket-Engg Oct 10, 2025
9a0eb81
no web3 in remix-ws-templates
Aniket-Engg Oct 13, 2025
6503f9a
no web3 in remix-dapp
Aniket-Engg Oct 13, 2025
8ff5bee
no web3 in remix-ui
Aniket-Engg Oct 13, 2025
ccc58cf
some web3 removal in remix-ide
Aniket-Engg Oct 13, 2025
cf88fdd
web3 import removed from code
Aniket-Engg Oct 14, 2025
b2516e8
remove web3 dependency
Aniket-Engg Oct 14, 2025
d803a97
fix remix loading and workspace e2e
Aniket-Engg Oct 15, 2025
f415e0c
minor fixes
Aniket-Engg Oct 16, 2025
fffa9fc
Merge branch 'master' into removeWeb3
Aniket-Engg Oct 16, 2025
174f436
fix build
Aniket-Engg Oct 16, 2025
6958e59
show tx details in terminal
Aniket-Engg Oct 16, 2025
2916d2e
removed all .eth method calls
Aniket-Engg Oct 16, 2025
3ac5228
removed web3 from terminal
Aniket-Engg Oct 16, 2025
73500de
fix simulator methods
Aniket-Engg Oct 16, 2025
2659e1b
Merge branch 'master' into removeWeb3
Aniket-Engg Oct 16, 2025
64a547e
fix tx signer and tx response
Aniket-Engg Oct 16, 2025
fb0df90
fix debugging
Aniket-Engg Oct 16, 2025
1d2e420
Merge branch 'master' into removeWeb3
Aniket-Engg Oct 21, 2025
17e9b24
revert before sending fixed
Aniket-Engg Oct 21, 2025
e188701
fix contract code storage in remix-debug
Aniket-Engg Oct 21, 2025
1655160
fix accounts call for external web3
Aniket-Engg Oct 22, 2025
a8c8d34
Merge branch 'master' into removeWeb3
Aniket-Engg Oct 22, 2025
a9acba3
more e2e fixing
Aniket-Engg Oct 22, 2025
cf32e82
fix data display to fix ballot e2e
Aniket-Engg Oct 24, 2025
e54a10c
fix eip7702 e2e
Aniket-Engg Oct 24, 2025
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
2 changes: 1 addition & 1 deletion apps/debugger/src/app/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) {
fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise<CompilerAbstract>
getFile: (path: string) => Promise<string>
setFile: (path: string, content: string) => Promise<void>
getDebugWeb3: () => any // returns an instance of web3.js, if applicable (mainet, goerli, ...) it returns a reference to a node from devops (so we are sure debug endpoint is available)
getDebugProvider: () => any // returns an instance of web3.js, if applicable (mainnet, goerli, ...) it returns a reference to a node from devops (so we are sure debug endpoint is available)
web3: () => any // returns an instance of web3.js
onStartDebugging: (debuggerBackend: any) => void // called when debug starts
onStopDebugging: () => void // called when debug stops
Expand Down
5 changes: 2 additions & 3 deletions apps/remix-dapp/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import axios from 'axios';
import Web3 from 'web3';
import { AbiCoder } from 'ethers';
import { AbiCoder, parseUnits } from 'ethers';
import BN from 'bn.js';
import { execution } from '@remix-project/remix-lib';
import { toBytes, addHexPrefix } from '@ethereumjs/util';
Expand Down Expand Up @@ -126,7 +125,7 @@ export const runTransactions = async (payload: any) => {
console.log(payload);
const { sendValue, sendUnit, gasLimit, selectedAccount } = state.settings;
const { address, decodedResponse, name } = state.instance;
const value = Web3.utils.toWei(sendValue, sendUnit);
const value = parseUnits(sendValue, sendUnit);

const tx = {
to: address,
Expand Down
79 changes: 31 additions & 48 deletions apps/remix-dapp/src/utils/txRunner.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import Web3, {
FMT_NUMBER,
type EthExecutionAPI,
type SupportedProviders,
FMT_BYTES,
type Bytes,
} from 'web3';
import { addHexPrefix, toBytes } from '@ethereumjs/util';
import { execution } from '@remix-project/remix-lib';
import { toBigInt } from 'web3-utils';
import { saveSettings } from '../actions';
import { BrowserProvider, ethers, formatUnits, toNumber, TransactionReceipt, TransactionResponse } from 'ethers'

const web3 = new Web3();
const provider = ethers.getDefaultProvider()

export const shortenAddress = (address: string, etherBalance?: string) => {
const len = address.length;
Expand All @@ -29,12 +22,9 @@ async function pause() {
});
}

async function tryTillReceiptAvailable(txhash: Bytes) {
async function tryTillReceiptAvailable(txhash) {
try {
const receipt = await web3.eth.getTransactionReceipt(txhash, {
number: FMT_NUMBER.NUMBER,
bytes: FMT_BYTES.HEX,
});
const receipt: TransactionReceipt = await provider.getTransactionReceipt(txhash);
if (receipt) {
if (!receipt.to && !receipt.contractAddress) {
// this is a contract creation and the receipt doesn't contain a contract address. we have to keep polling...
Expand All @@ -52,12 +42,9 @@ async function tryTillReceiptAvailable(txhash: Bytes) {
return await tryTillReceiptAvailable(txhash);
}

async function tryTillTxAvailable(txhash: Bytes) {
async function tryTillTxAvailable(txhash) {
try {
const tx = await web3.eth.getTransaction(txhash, {
number: FMT_NUMBER.NUMBER,
bytes: FMT_BYTES.HEX,
});
const tx: TransactionResponse = await provider.getTransaction(txhash, );
if (tx?.blockHash) return tx;
return tx;
} catch (e) {
Expand Down Expand Up @@ -90,16 +77,13 @@ export class TxRunner {
}, 30000);
}

setProvider(
provider: string | SupportedProviders<EthExecutionAPI> | undefined
) {
web3.setProvider(provider);
setProvider(provider) {
new ethers.BrowserProvider(provider)
}

getAccounts() {
saveSettings({ isRequesting: true });
void web3.eth
.getAccounts()
(provider as any).send("eth_requestAccounts", [])
.then(async (accounts) => {
const loadedAccounts: any = {};
for (const account of accounts) {
Expand All @@ -115,17 +99,18 @@ export class TxRunner {
}

async getBalanceInEther(address: string) {
const balance = await web3.eth.getBalance(address);
return Web3.utils.fromWei(balance.toString(10), 'ether');
const balance = await provider.getBalance(address);
return formatUnits(balance.toString(10), 'ether');
}

async getGasPrice() {
return await web3.eth.getGasPrice();
const { gasPrice } = await provider.getFeeData()
return gasPrice;
}

async runTx(tx: any, gasLimit: any, useCall: boolean) {
if (useCall) {
const returnValue = await web3.eth.call({ ...tx, gas: gasLimit });
const returnValue = await provider.call({ ...tx, gasLimit });

return toBytes(addHexPrefix(returnValue));
}
Expand All @@ -147,8 +132,8 @@ export class TxRunner {
txCopy.maxFeePerGas = Math.ceil(
Number(
(
toBigInt(network.lastBlock.baseFeePerGas) +
toBigInt(network.lastBlock.baseFeePerGas) / BigInt(3)
BigInt(network.lastBlock.baseFeePerGas) +
BigInt(network.lastBlock.baseFeePerGas) / BigInt(3)
).toString()
)
);
Expand All @@ -159,8 +144,8 @@ export class TxRunner {
}

try {
const gasEstimation = await web3.eth.estimateGas(txCopy);
tx.gas = !gasEstimation ? gasLimit : gasEstimation;
const gasEstimation = await provider.estimateGas(txCopy);
tx.gasLimit = !gasEstimation ? gasLimit : gasEstimation;
return await this._executeTx(tx, network);
} catch (error) {
console.log(error);
Expand All @@ -169,7 +154,8 @@ export class TxRunner {
}

async detectNetwork() {
const id = Number(await web3.eth.net.getId());
const { chainId} = await provider.getNetwork()
const id = Number(chainId)
let name = '';
if (id === 1) name = 'Main';
else if (id === 3) name = 'Ropsten';
Expand All @@ -180,7 +166,7 @@ export class TxRunner {
else name = 'Custom';

if (id === 1) {
const block = await web3.eth.getBlock(0);
const block = await provider.getBlock(0);
if (block && block.hash !== this.mainNetGenesisHash) name = 'Custom';
return {
id,
Expand All @@ -205,18 +191,18 @@ export class TxRunner {

async _updateChainContext() {
try {
const block = await web3.eth.getBlock('latest');
const block = await provider.getBlock('latest');
// we can't use the blockGasLimit cause the next blocks could have a lower limit : https://github.com/ethereum/remix/issues/506
this.blockGasLimit = block?.gasLimit
? Math.floor(
Number(web3.utils.toNumber(block.gasLimit)) -
(5 * Number(web3.utils.toNumber(block.gasLimit))) / 1024
Number(toNumber(block.gasLimit)) -
(5 * Number(toNumber(block.gasLimit))) / 1024
)
: web3.utils.toNumber(this.blockGasLimitDefault);
: toNumber(this.blockGasLimitDefault);
this.lastBlock = block;
try {
this.currentFork = execution.forkAt(
await web3.eth.net.getId(),
(await provider.getNetwork()).chainId,
block.number
);
} catch (e) {
Expand Down Expand Up @@ -247,19 +233,16 @@ export class TxRunner {

let currentDateTime = new Date();
try {
const { transactionHash } = await web3.eth.sendTransaction(
tx,
undefined,
{ checkRevertBeforeSending: false, ignoreGasPricing: true }
);
const receipt = await tryTillReceiptAvailable(transactionHash);
tx = await tryTillTxAvailable(transactionHash);
const signer = await (provider as BrowserProvider).getSigner();
const { hash } = await signer.sendTransaction(tx);
const receipt = await tryTillReceiptAvailable(hash);
tx = await tryTillTxAvailable(hash);

currentDateTime = new Date();
return {
receipt,
tx,
transactionHash: receipt ? receipt.transactionHash : null,
transactionHash: receipt ? receipt.hash : null,
};
} catch (error: any) {
console.log(
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/tests/ballot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' }
})
},
Expand Down Expand Up @@ -87,7 +87,7 @@ module.exports = {
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
{
status: '0x0 Transaction mined but execution failed',
status: '0 Transaction mined but execution failed',
'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' }
})
},
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/tests/ballot_0_4_14.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' }
})
},
Expand Down Expand Up @@ -82,7 +82,7 @@ module.exports = {
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' }
})
},
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/tests/compile_run_widget.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {

'Run script using the widget #group2': function (browser: NightwatchBrowser) {
browser
.openFile('scripts/deploy_with_web3.ts')
.openFile('scripts/deploy_with_ethers.ts')
.click('[data-id="compile-action"]')
.waitForElementVisible('[data-id="compile_group"] i.fa-check', 10000)
},
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/tests/eip1153.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
.clickFunction('useTransientStorage - transact (not payable)')
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded output': {
0: 'uint256: out1 14',
1: 'uint256: out2 15'
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/tests/erc721.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
.createContract('')
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded input': {}
}).end()
}
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/tests/metamask.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const tests = {

.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' }
})
},
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/tests/pinned_contracts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = {
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '35' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded input': { "uint256 num": "35" }
})
.clickFunction('retrieve - call')
Expand All @@ -102,7 +102,7 @@ module.exports = {
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '55' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded input': { "uint256 num": "55" }
})
.clickFunction('retrieve - call')
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/tests/plugin_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,14 @@ module.exports = {
// DGIT
'Should have changes on new workspace #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel-createWorkspace', null, null, 'dgit')
await clickAndCheckLog(browser, 'dgitApi-status', [[".prettierrc.json",0,2,0], ["README.txt",0,2,0],["contracts/1_Storage.sol",0,2,0],["contracts/2_Owner.sol",0,2,0],["contracts/3_Ballot.sol",0,2,0],["remix.config.json",0,2,0],["scripts/deploy_with_ethers.ts",0,2,0],["scripts/deploy_with_web3.ts",0,2,0],["scripts/ethers-lib.ts",0,2,0],["scripts/web3-lib.ts",0,2,0],["tests/Ballot_test.sol",0,2,0],["tests/storage.test.js",0,2,0]], null, null)
await clickAndCheckLog(browser, 'dgitApi-status', [[".prettierrc.json",0,2,0], ["README.txt",0,2,0],["contracts/1_Storage.sol",0,2,0],["contracts/2_Owner.sol",0,2,0],["contracts/3_Ballot.sol",0,2,0],["remix.config.json",0,2,0],["scripts/deploy_with_ethers.ts",0,2,0],["scripts/ethers-lib.ts",0,2,0],["tests/Ballot_test.sol",0,2,0],["tests/storage.test.js",0,2,0]], null, null)
},

'Should stage contract #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dgitApi-add', null, null, {
filepath: 'contracts/1_Storage.sol'
})
await clickAndCheckLog(browser, 'dgitApi-status', [[".prettierrc.json",0,2,0],["README.txt",0,2,0],["contracts/1_Storage.sol",0,2,2],["contracts/2_Owner.sol",0,2,0],["contracts/3_Ballot.sol",0,2,0],["remix.config.json",0,2,0],["scripts/deploy_with_ethers.ts",0,2,0],["scripts/deploy_with_web3.ts",0,2,0],["scripts/ethers-lib.ts",0,2,0],["scripts/web3-lib.ts",0,2,0],["tests/Ballot_test.sol",0,2,0],["tests/storage.test.js",0,2,0]], null, null)
await clickAndCheckLog(browser, 'dgitApi-status', [[".prettierrc.json",0,2,0],["README.txt",0,2,0],["contracts/1_Storage.sol",0,2,2],["contracts/2_Owner.sol",0,2,0],["contracts/3_Ballot.sol",0,2,0],["remix.config.json",0,2,0],["scripts/deploy_with_ethers.ts",0,2,0],["scripts/ethers-lib.ts",0,2,0],["tests/Ballot_test.sol",0,2,0],["tests/storage.test.js",0,2,0]], null, null)
},
'Should commit changes #group3': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'dgitApi-commit', null, null, { author: { name: 'Remix', email: 'Remix' }, message: 'commit-message' })
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/tests/recorder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = {
.pause(1000)
.clickFunction('set2 - transact (not payable)', { types: 'uint256 _po', values: '10' })
.testFunction('last', {
status: '0x1 Transaction mined and execution succeed',
status: '1 Transaction mined and execution succeed',
'decoded input': { 'uint256 _po': '10' }
})
},
Expand Down
10 changes: 5 additions & 5 deletions apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
.click('*[data-id="Deploy - transact (not payable)"]')
.pause(5000)
.testFunction('last', {
status: '0x1 Transaction mined and execution succeed'
status: '1 Transaction mined and execution succeed'
})
},

Expand Down Expand Up @@ -102,7 +102,7 @@ module.exports = {
.click('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]')
.pause(5000)
.testFunction('last', {
status: '0x1 Transaction mined and execution succeed'
status: '1 Transaction mined and execution succeed'
})
// When this is removed and tests are running by connecting to metamask
// Consider adding tests to check return value of contract call
Expand Down Expand Up @@ -153,7 +153,7 @@ module.exports = {
.waitForElementContainsText('[data-id="treeViewLi0"]', 'uint256: 10')
},

'Should save state after running web3 script #group4': function (browser: NightwatchBrowser) {
'Should save state after running ethers script #group4': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="topbar-settingsIcon"]')
.click('*[data-id="topbar-settingsIcon"]')
Expand All @@ -168,8 +168,8 @@ module.exports = {
.clickLaunchIcon('filePanel')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]')
.click('*[data-id="treeViewLitreeViewItemscripts"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]')
.openFile('scripts/deploy_with_web3.ts')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]')
.openFile('scripts/deploy_with_ethers.ts')
.click('[data-id="compile-action"]')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'address:')
.openFile('.states/vm-london/state.json')
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/tests/templates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const templatesToCheck = [
displayName: "Basic",
checkSelectors: [
'*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]',
'*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]'
'*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]'
]
},
{
Expand Down
Loading