![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@ape.swap/governance-sdk
Advanced tools
A collection of solidity smart contracts to help manage the ApeSwap DAO.
Useful SDK for encoding transactions sent to timelock contracts used in the ApeSwap protocol. These timelock contracts are Open Zeppelin's implementation which integrates very well with DAO governance mechanisms.
Click "Use as Template" to create a repo on GitHub based on this repo. Otherwise:
git clone git@github.com:DeFiFoFum/truffle-typescript-template.git
yarn install
Create a .env
file based off of .env.example
to deploy contracts to bsc mainnet/testnet and to verify deployed contracts.
This repo also provides a helper module for interacting with the ApeSwap Governance contracts with node via a front-end or back-end framework.
yarn add @ape.swap/governance-sdk
cd governance-sdk
yarn install
Provided below is an example of importing the and using the provided library to encode a batch timelock tx.
import { TimelockLib } from '@ape.swap/governance-sdk';
const timelockEncoder = new TimelockLib.TimelockEncoder();
async function encodeMessageTx(message: string, { address = ADDRESS_0 }): Promise<PopulatedTransaction> {
const messageBoardContract = new Contract(address, MessageBoardBuild.abi) as MessageBoard;
const populatedTx = await messageBoardContract.populateTransaction.addMessage(message);
return populatedTx;
}
async function encodeBatchTimelockMessageTx(messages: string[], { timelockAddress = ADDRESS_0, messageBoardAddress = ADDRESS_0, predecessor = BYTES_32_0, salt = BYTES_32_0, delay = 20 }): Promise<BatchEncodeReturn> {
const timelockEncoder = new TimelockEncoder(timelockAddress);
const targets: string[] = [];
const datas: string[] = [];
const values: string[] = [];
for (const message of messages) {
const populatedTx = await encodeMessageTx(message, { address: messageBoardAddress });
targets.push(populatedTx.to || '0x');
datas.push(populatedTx.data || '0x');
values.push('0');
}
return await timelockEncoder.encodeTxsForBatchOperation({ targets, values, datas, predecessor, salt }, delay);
};
Start a local development blockchain by running the following command:
yarn ganache
Deploy contracts to the development blockchain:
yarn migrate:dev
yarn compile
yarn migrate:bsc [--reset]
// Use --reset
to redeploy already deployed contracts
yarn verify:bsc
yarn migrate:testnet [--reset]
yarn verify:testnet
* new contracts that are created must be added to the verification script in package.json by adding &&
to the end with the new contract verification.
Lint with solhint
yarn lint
/ yarn lint:fix
Tests are run with @openzeppelin
test environment. This allows tests to be run independently of an external development blockchain.
Test the project with yarn test
Tests are using
@openzeppelin/test-helpers
@openzeppelin/test-environment
yarn gen:docs
solidity-docgen can be used in this repo to scrape NatSpec comments into markdown files for easy document generation.
This module uses the solc package to generate the documents. If the compiler is changed, ensure that the correct solc version is installed: yarn add solc@0.8.17
solidity-coverage is used in this repo to provide an output of the test coverage after running tests.
The OpenZeppelin test environment coupled with Github actions facilitates automated contract tests on pushes to GitHub!
Use typechain
to generate contract interfaces for UI integration.
yarn gen:types
Use the truffle-contract-size
module to find the size of each contract in the contracts/
directory with:
yarn size
FAQs
A collection of solidity smart contracts to help manage the ApeSwap DAO.
The npm package @ape.swap/governance-sdk receives a total of 0 weekly downloads. As such, @ape.swap/governance-sdk popularity was classified as not popular.
We found that @ape.swap/governance-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.