Smart contracts for Champions Tactics™ Grimoria Chronicles written in Solidity.
Champions Tactics™ Grimoria Chronicles is a PVP Tactical RPG game on PC by Ubisoft. Assemble a team of mythical Champions and craft you legend in the dark and mystical world of Grimoria.
The GenesisPFP
smart contract is deployed on Ethereum mainnet at address 0xE841e6e68BECFC54b621A23a41f8C1a829a4cf44
and has been audited by KALOS. The report can be found here.
- Clone this repository
- Install Foundry
- Initialize the submodules
git submodule deinit --force .
git submodule update --init --recursive
Contract documentation is auto-generated using forge doc
.
forge doc -s
allows you to serve it locally at localhost:3000.
forge build
Genesis PFP's contract ABI can be found in out/GenesisPFP.sol/GenesisPFP.json
after building the contracts
forge test
LCOV file can be generated and viewed as an HTML file using the following commands:
$ forge coverage --report lcov
$ genhtml --branch-coverage --output "coverage" lcov.info
- Start a local testnet using anvil or any local testnet client
- In another terminal, setup the required env variables and run
forge create
to deploy the contract as below
Use the
--unlocked
flag with Anvil's first test account used as sender withETH_FROM
export ETH_FROM="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
export MINTER_ADDRESS="0x..."
export VAULT_ADDRESS="0x..."
export LINK_ADDRESS="0x0000000000000000000000000000000000000000"
export VRF_WRAPPER_ADDRESS="0x0000000000000000000000000000000000000000"
export RPC_URL="http://localhost:8545" # Anvil local RPC
forge create \
--rpc-url $RPC_URL --unlocked \
src/GenesisPFP.sol:GenesisPFP \
--constructor-args "Genesis PFP" "PFP" "1" \
$MINTER_ADDRESS $VAULT_ADDRESS \
$LINK_ADDRESS $VRF_WRAPPER_ADDRESS
We use the Sepolia testnet to deploy and test our contracts in dev environment.
Chainlink's VRF configuration for Sepolia can be found here.
Deployment parameters are listed below in the same order as the contract constructor takes them:
Parameter | Value |
---|---|
Name | GenesisPFP |
Symbol | PFP |
Version | 1 |
Minter address | Address granted with MINTER_ROLE on contract creation |
Vault address | Address receiving marketplace royalties |
LINK Token | 0x779877A7B0D9E8603169DdbD7836e478b4624789 |
VRF Wrapper | 0xab18414CD93297B0d12ac29E63Ca20f515b3DB46 |
You will need to provide a mnemonic phrase, private key, ledger or any wallet solution to deploy your contract on a live network. Please refer to Foundry's documentation for options.
To deploy the contracts on Sepolia, run the following command (replace $RPC_URL
with a valid Sepolia RPC endpoint):
forge create \
--rpc-url $RPC_URL \
src/GenesisPFP.sol:GenesisPFP \
--constructor-args "Genesis PFP" "PFP" "1" \
$MINTER_ADDRESS $VAULT_ADDRESS \
$LINK_ADDRESS $VRF_WRAPPER_ADDRESS
- Nicolas LAW YIM WAN
- Louis GAROCHE
This project is available under the Apache 2.0 License