Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Run tests
name: protocol-contracts-confidential-tokens-registry-tests

on:
pull_request:

push:
branches:
- main
workflow_dispatch:

permissions: {}

concurrency:
group: ci-protocol-contracts-confidential-tokens-registry-tests-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check-changes:
name: protocol-contracts-confidential-tokens-registry-tests/check-changes
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
pull-requests: 'read' # Required to read pull request information
runs-on: ubuntu-latest
outputs:
changes-protocol-contracts-confidential-tokens-registry: ${{ steps.filter.outputs.protocol-contracts-confidential-tokens-registry }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
protocol-contracts-confidential-tokens-registry:
- .github/workflows/protocol-contracts-confidential-tokens-registry-tests.yml
- protocol-contracts/confidential-tokens-registry/**
tests:
name: protocol-contracts-confidential-tokens-registry-tests/tests (bpr)
needs: check-changes
if: ${{ needs.check-changes.outputs.changes-protocol-contracts-confidential-tokens-registry == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: 'read' # Required to checkout repository code
steps:
- name: Checkout project
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'

- name: Install dependencies
working-directory: protocol-contracts/confidential-tokens-registry
run: npm ci

- name: Run conformance
working-directory: protocol-contracts/confidential-tokens-registry
run: make conformance

- name: Run compile
working-directory: protocol-contracts/confidential-tokens-registry
run: make compile

- name: Run unit tests
working-directory: protocol-contracts/confidential-tokens-registry
run: make test

21 changes: 21 additions & 0 deletions protocol-contracts/confidential-tokens-registry/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Authentication (use one of these)
MNEMONIC=
PRIVATE_KEY=

# RPC URLs
MAINNET_RPC_URL=
SEPOLIA_RPC_URL=

# API Keys
ETHERSCAN_API_KEY=

# Gas Reporter
REPORT_GAS=false


# ----------------------------------------------------------------------------
# ConfidentialTokensRegistry deployment
# ----------------------------------------------------------------------------

# The number of tokens to register initially
INITIAL_OWNER=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 # accounts[1] (address)
24 changes: 24 additions & 0 deletions protocol-contracts/confidential-tokens-registry/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dependencies
node_modules/

# Build artifacts
artifacts/
cache/
cache_forge/
out/
types/

# Coverage
coverage/
coverage.json

# Environment
.env

# IDE
.idea/
.vscode/

# OS
.DS_Store

22 changes: 22 additions & 0 deletions protocol-contracts/confidential-tokens-registry/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# directories
.coverage_artifacts
.coverage_cache
.coverage_contracts
artifacts
build
cache
coverage
dist
node_modules
types
lib

# files
*.env
*.log
.DS_Store
.pnp.*
coverage.json
package-lock.json
yarn.lock
README.md
15 changes: 15 additions & 0 deletions protocol-contracts/confidential-tokens-registry/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid",
"overrides": [
{
"files": "*.sol",
"options": {
"singleQuote": false
}
}
],
"plugins": ["prettier-plugin-solidity"]
}
26 changes: 26 additions & 0 deletions protocol-contracts/confidential-tokens-registry/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
include .env.example

ENV_PATH=.env.example

prettier:
npx prettier . --write

lint:
npm run lint

compile:
npx hardhat compile

clean:
npx hardhat clean

get-accounts:
DOTENV_CONFIG_PATH=$(ENV_PATH) npx hardhat get-accounts

# Define it as a phony target to avoid conflicts with the test directory
.PHONY: test
test: clean
DOTENV_CONFIG_PATH=$(ENV_PATH) npx hardhat test --network hardhat $(if $(GREP),--grep '$(GREP)',)

# Conform to pre-commit checks
conformance: prettier lint
Loading