Welcome to the repository for the Wrapped PAC (WPAC) token. WPAC is a wrapped token (ERC-20) compatible with all EVM blockchains, providing interoperability for PAC tokens across different networks.
WPAC tokens are wrapped tokens provided by the Wrapto platform. The token contract is implemented in Solidity and follows the OpenZeppelin Contracts upgradeable pattern. It allows users to bridge PAC tokens from one blockchain to another by locking the tokens in the contract and minting WPAC tokens on the destination chain.
To get started with the project, follow these steps:
git clone https://github.com/wrapto/wpac-erc-20.git
cd wpac-erc-20
npm installThe project uses a unified Hardhat configuration that includes both testnet and mainnet networks. You control which network to use by specifying the network name.
You need to manually adjust parameters in hardhat.config.ts such as defining RPC URLs, account private keys, etc.
There are two deployment entry points, depending on whether you want a standalone contract or an upgradeable proxy setup:
-
Deploy only the implementation (no proxy):
npx hardhat run ./scripts/deploy_contract.ts --network <NETWORK-NAME>
-
Deploy a proxy + implementation pair:
npx hardhat run ./scripts/deploy_proxy.ts --network <NETWORK-NAME>
To upgrade on a specific network:
npx hardhat run ./scripts/upgrade.ts --network <NETWORK-NAME>Local Network:
hardhat- Local Hardhat Network (default network; no network flag needed)
Testnet Networks:
polygon_amoy- Polygon Amoy Testnetbsc_testnet- BSC Testnetbase_sepolia- Base Sepolia Testnetethereum_sepolia- Ethereum Sepolia Testnet
Mainnet Networks:
polygon- Polygon Mainnetbsc- BSC Mainnetbase- Base Mainnetethereum- Ethereum Mainnet
To deploy or upgrade using a Trezor hardware wallet, set the TREZOR_BIP44_PATH environment variable and then:
npx hardhat run ./scripts/upgrade.ts --network <NETWORK-NAME>In the project directory, you can run the following scripts:
npm run node: Starts a local Hardhat node for testing.npm run compile: Compiles the Solidity contracts.npm run clean: Cleans up artifacts, cache, coverage, and typechain files.npm run lint:sol: Lints the Solidity contracts using Solhint.npm run test: Runs the Hardhat test suite.npm run typechain: Generates TypeScript bindings for the Solidity contracts.
The main contract file is wpac.sol which implements the ERC-20 interface.
It also integrates functionality for bridging PAC tokens from one blockchain to another.
The contract is upgradeable and follows the Ownable and Pausable patterns for security and control.
The main project files and directories are structured as follows:
contracts/: Contains Solidity contracts.test/: Contains test scripts for the contracts.scripts/: Contains deployment and upgrade scripts.artifacts/: Contains contract artifacts generated by Hardhat.package.json: Configuration file for Node.js dependencies and scripts.hardhat.config.ts: Hardhat configuration (includes both testnet and mainnet networks).
Wrapto is released under MIT License.