Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
56 changes: 56 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PR

on:
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-install-project
npm ci
- name: Ruff
run: uv run ruff check
- name: Prettier
run: npx prettier --check --plugin=prettier-plugin-solidity "contracts/**/*.sol" "interfaces/**/*.sol"

unit-test:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
with:
enable-cache: true
- name: Set up Foundry
uses: foundry-rs/foundry-toolchain@8789b3e21e6c11b2697f5eb56eddae542f746c10
with:
version: stable
- name: Install dependencies
run: |
uv sync --frozen --no-install-project
npm ci
- name: Import Brownie network settings
run: uv run brownie networks import data/networks.yml true
- name: Compile contracts
run: uv run brownie compile --all
- name: Run tests
run: uv run pytest --disable-warnings -v tests/
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
min-release-age=3
ignore-scripts=true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ compile:
brownie compile

test:
pytest tests/ --pdb -vv
uv run pytest --network=test_network tests/ --pdb -vv
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ A prototype implementation of escrow information concealment using Joux's Tripar
- Currently, we are using v0.8.23.
- [eth-brownie](https://github.com/eth-brownie/brownie)
- We are using the eth-brownie framework for developing and testing our contracts.
- [Anvil](https://www.getfoundry.sh/anvil)
- We use Anvil for local development and unit testing.
- [OpenZeppelin](https://openzeppelin.com/contracts/)
- Our project is partly dependent on OpenZeppelin.
- We use openzeppelin-contracts v4.9.
Expand Down Expand Up @@ -50,5 +52,11 @@ After compiling, Run the following command:
$ make test
```

## Developing Smart Contracts

### Network(Anvil) settings

Network settings are defined in the `data/networks.yml` file.

## References
1. Joux, A. (2000). A One Round Protocol for Tripartite Diffie–Hellman. In: Bosma, W. (eds) Algorithmic Number Theory. ANTS 2000. Lecture Notes in Computer Science, vol 1838. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10722028_23
4 changes: 2 additions & 2 deletions contracts/exchange/IbetSecurityTokenDVP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ contract IbetSecurityTokenDVP is Ownable, IbetExchangeInterface {
);

// 更新:決済IDをカウントアップ
uint256 _deliveryId = DVPStorage(storageAddress).getLatestDeliveryId() +
1;
uint256 _deliveryId =
DVPStorage(storageAddress).getLatestDeliveryId() + 1;
DVPStorage(storageAddress).setLatestDeliveryId(_deliveryId);

// 更新:DVP決済情報の挿入
Expand Down
7 changes: 7 additions & 0 deletions data/networks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
development:
- id: test_network
name: Anvil Network
host: http://localhost:8545
cmd: anvil --host 0.0.0.0 --chain-id 2017 --hardfork osaka --gas-limit 800000000 --gas-price 0 --block-base-fee-per-gas 0 --steps-tracing
cmd_settings:
port: 8545
7 changes: 0 additions & 7 deletions docker-compose.yml

This file was deleted.

15 changes: 0 additions & 15 deletions hardhat.config.js

This file was deleted.

Loading
Loading