
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
ethers-react-system
Advanced tools
npm install ethers-react-system
import { EthersProvider } from 'ethers-react-system';
<App>
<EthersProvider>...</EthersProvider>
</App>;
The package pairs with the 3box-system library. The design system library hooks into the state system to help manage user logins, connecting to spaces, posting to threads, etc....
Add Linting back to package.json "lint": "xo && remark . -qfo",
npm install ethers-react-system
yarn add ethers-react-system
import { EthersProvider, EthersConsumer } from 'ethers-react-system';
const App = () => {
return (
<EthersProvider>
<WrappedApp />
</EthersProvider>
);
};
const WrappedApp = () => {
return (
<EthersConsumer>
{ethers => {
return <h1>There are {ethers.deployed.length} deployed.</h1>;
}}
</EthersConsumer>
);
};
export default App;
// script
There are two major ways of initializing contracts. Either through the action creator or by passing it to the top-level provider.
ethers.initContract(Contract[,deployedAddress]);
// script
the function requires the contract address and ABI and has additional optional requirements.
import React from 'react';
import { withEthers } from 'ethers-react-system';
import TestContract from './build/TestContract.json';
// you can optionally pass the deployedAddress but by default
// it will be initialized to the latest deployment address
const deployedAddress = '0x...';
class WrappedApp extends React.Component {
constructor(props) {
super(props);
const { ethers } = props;
ethers.initContract(TestContract);
}
render() {
const { ethers } = this.props;
const contracts = Object.keys(ethers.contracts);
return <h1>There are {contracts.length} initialized</h1>;
}
}
export default withEthers(WrappedApp);
// script
import React from 'react';
import { EthersProvider } from 'ethers-react-system';
import WrappedApp from './WrappedApp';
import TestContract from './build/TestContract.json';
const App = () => {
return (
<EthersProvider contracts={[TestContract]}>
<WrappedApp />
</EthersProvider>
);
};
export default App;
// script
Although the provider defaults to utilizing the Ethereum provider (either via Metamask or a dApp browser). It is possible to generate a burner wallet that can be utilized in the absence of Metamask or dApp browser.
The following action creator will generate a wallet with the set provider(defaulting the JSON if none). It will set the wallet and address property of the ethers state object.
ethers.generateWallet();
// script
import React from 'react';
import { withEthers } from 'ethers-provider';
class Home extends React.Component {
constructor(props) {
super(props);
const { ethers } = props;
ethers.generateWallet();
}
render() {
const { ethers } = this.props;
return <h1>The address is {ethers.address}</h1>;
}
}
export default withEthers(Home);
// script
Deploy Contracts Functionality WIP. Once the fucntionality is implemented and tested the documentation will be added.
The ether object contains a sendTransaction function that can be used to interfact with a smart contract. The contractID and functionName to interfact with must be provided as well as an array of the parameters of the given function.
ethers.sendTransaction(contractID, functionName, params);
//script
The action creator will sign and send the transaction to the network currently connected to.
Warning
Presently there are known issues with error handling with send transactions. This error causes transactions to fail silently. Until the issue is solved directly utilize the initiated contracts to send transactions.
Message Signing Functionality WIP. Once the fucntionality is implemented and tested the documentation will be added.
Typed Message Signing (ERC712) Functionality WIP. Once the fucntionality is implemented and tested the documentation will be added.
Message Decryption/Encryption WIP. Once the fucntionality is implemented and tested the documentation will be added.
| Name | Website |
|---|---|
| Kames | https://www.kamescg.com |
| Luis | https://www.luisosta.com |
FAQs
Ethers Interface & Effects Management System
We found that ethers-react-system demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.