diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 30e653731d..4eb9423d38 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -27,6 +27,7 @@ import { NotificationPlugin } from './app/plugins/notification' import { Blockchain } from './blockchain/blockchain.js' import { HardhatProvider } from './app/tabs/hardhat-provider' import { GanacheProvider } from './app/tabs/ganache-provider' +import { FoundryProvider } from './app/tabs/foundry-provider' const isElectron = require('is-electron') @@ -177,6 +178,7 @@ class AppComponent { const web3Provider = new Web3ProviderModule(blockchain) const hardhatProvider = new HardhatProvider(blockchain) const ganacheProvider = new GanacheProvider(blockchain) + const foundryProvider = new FoundryProvider(blockchain) // ----------------- convert offset to line/column service ----------- const offsetToLineColumnConverter = new OffsetToLineColumnConverter() Registry.getInstance().put({ @@ -233,6 +235,7 @@ class AppComponent { storagePlugin, hardhatProvider, ganacheProvider, + foundryProvider, this.walkthroughService, search ]) diff --git a/apps/remix-ide/src/app/tabs/foundry-provider.tsx b/apps/remix-ide/src/app/tabs/foundry-provider.tsx new file mode 100644 index 0000000000..47e899865a --- /dev/null +++ b/apps/remix-ide/src/app/tabs/foundry-provider.tsx @@ -0,0 +1,33 @@ +import * as packageJson from '../../../../../package.json' +import { Plugin } from '@remixproject/engine' +import { AppModal, AlertModal, ModalTypes } from '@remix-ui/app' +import React from 'react' // eslint-disable-line +import { Blockchain } from '../../blockchain/blockchain' +import { ethers } from 'ethers' +import { AbstractProvider } from './abstract-provider' + +const profile = { + name: 'foundry-provider', + displayName: 'Foundry Provider', + kind: 'provider', + description: 'Anvil', + methods: ['sendAsync'], + version: packageJson.version +} + +export class FoundryProvider extends AbstractProvider { + constructor (blockchain) { + super(profile, blockchain, 'http://127.0.0.1:8545') + } + + body (): JSX.Element { + return ( +