-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload stablecoin packages, documentation, and related workflows (#1)
Co-authored-by: Aloysius Chan <[email protected]> Co-authored-by: kaliweh-circle <[email protected]> Co-authored-by: ams9198 <[email protected]> Co-authored-by: Zhou Fang <[email protected]>
- Loading branch information
1 parent
2f630f5
commit c5f24d0
Showing
111 changed files
with
16,659 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Summary | ||
|
||
## Detail | ||
|
||
## Testing | ||
|
||
## Documentation | ||
|
||
--- | ||
|
||
**Requested Reviewers:** @mention |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright 2024 Circle Internet Group, Inc. All rights reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: CI | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
run_ci_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.14.0" | ||
|
||
- name: Setup CI Environment | ||
run: make setup | ||
|
||
- name: Run static checks | ||
run: make static-checks | ||
|
||
- name: Run move tests | ||
run: make test | ||
|
||
- name: Run move prover | ||
run: | | ||
export BOOGIE_EXE=/home/runner/.local/bin/boogie | ||
export CVC5_EXE=/home/runner/.local/bin/cvc5 | ||
export Z3_EXE=/home/runner/.local/bin/z3 | ||
make prove | ||
- name: Start network | ||
run: make start-network | ||
|
||
- name: Run Typescript tests | ||
run: yarn test | ||
|
||
scan: | ||
if: github.event_name == 'pull_request' | ||
uses: circlefin/circle-public-github-workflows/.github/workflows/pr-scan.yaml@v1 | ||
with: | ||
allow-reciprocal-licenses: false | ||
|
||
release-sbom: | ||
if: github.event_name == 'push' | ||
uses: circlefin/circle-public-github-workflows/.github/workflows/attach-release-assets.yaml@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.aptos/ | ||
gas-profiling/ | ||
*.log | ||
bin/ | ||
build/ | ||
node_modules/ | ||
logs/ | ||
**/build-output* | ||
**/.coverage_map.mvcov | ||
**/.trace | ||
**/boogie.bpl | ||
scripts/typescript/resources/** | ||
!scripts/typescript/resources/default_token.json | ||
!scripts/typescript/resources/*.template.json | ||
|
||
# Intellij | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
yarn format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/* | ||
node_modules/* | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"recommendations": [ | ||
"movebit.aptos-move-analyzer", | ||
"ymotongpoo.licenser", | ||
"esbenp.prettier-vscode" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"files.autoSave": "onFocusChange", | ||
"licenser.license": "Custom", | ||
"licenser.customHeader": "Copyright @YEAR@ Circle Internet Group, Inc. All rights reserved.\n\nSPDX-License-Identifier: Apache-2.0\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.", | ||
"licenser.useSingleLineStyle": false, | ||
"editor.tabSize": 2, | ||
"[move]": { | ||
"editor.tabSize": 4 | ||
}, | ||
"editor.insertSpaces": true, | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"aptos-move-analyzer.movefmt.enable": false, | ||
"aptos-move-analyzer.inlay.hints.enable": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
.PHONY: setup static-checks fmt lint clean build-publish-payload build-dev prove test start-network stop-network create-local-account | ||
|
||
# === Move compiler settings === | ||
|
||
# Refer to https://github.com/aptos-labs/aptos-core/blob/687937182b30f32895d13e4384a96e03f569468c/third_party/move/move-model/src/metadata.rs#L80 | ||
compiler_version = 1 | ||
|
||
# Refer to https://github.com/aptos-labs/aptos-core/blob/687937182b30f32895d13e4384a96e03f569468c/third_party/move/move-model/src/metadata.rs#L179 | ||
# NOTE: The bytecode_version used during compilation is auto-inferred from this setting. Refer to https://github.com/aptos-labs/aptos-core/blob/687937182b30f32895d13e4384a96e03f569468c/third_party/move/move-model/src/metadata.rs#L235-L241 | ||
# for more information. | ||
language_version = 1 | ||
|
||
setup: | ||
@bash scripts/shell/setup.sh | ||
|
||
static-checks: | ||
@yarn format:check && yarn type-check && yarn lint && make lint | ||
|
||
fmt: | ||
@packages=$$(find "packages" -type d -mindepth 1 -maxdepth 1); \ | ||
for package in $$packages; do \ | ||
aptos move fmt --package-path $$package --config max_width=120; \ | ||
done; | ||
|
||
lint: | ||
@packages=$$(find "packages" -type d -mindepth 1 -maxdepth 1); \ | ||
for package in $$packages; do \ | ||
echo ">> Running linter on $$package" && \ | ||
LINT_RESULTS="$$(\ | ||
aptos move lint \ | ||
--package-dir $$package \ | ||
--language-version "$(language_version)" \ | ||
--dev 2>&1 \ | ||
)" && \ | ||
if $$(echo "$$LINT_RESULTS" | grep "warning" --quiet); then \ | ||
echo ">> Linting failed for $$package\n"; \ | ||
echo "$$LINT_RESULTS"; \ | ||
exit 1; \ | ||
fi; \ | ||
done | ||
|
||
clean: | ||
@packages=$$(find "packages" -type d -mindepth 1 -maxdepth 1); \ | ||
for package in $$packages; do \ | ||
echo ">> Cleaning $$package..."; \ | ||
rm -rf $$package/build; \ | ||
rm -f $$package/.coverage_map.mvcov; \ | ||
rm -f $$package/.trace; \ | ||
done; \ | ||
echo ">> Cleaning TS script build output..."; \ | ||
rm -rf scripts/typescript/build-output | ||
|
||
build-publish-payload: clean | ||
@if [ -z "$(package)" ] || [ -z "$(output)" ] || [ -z "$(included_artifacts)" ]; then \ | ||
echo "Usage: make build-publish-payload package=\"<package_name>\" output=\"<output_path>\" included_artifacts=\"<all/sparse/none>\" [named_addresses=\"<named_addresses>\"]"; \ | ||
exit 1; \ | ||
fi; \ | ||
\ | ||
mkdir -p "$$(dirname "$(output)")"; \ | ||
echo ">> Building $$package..."; \ | ||
aptos move build-publish-payload \ | ||
--assume-yes \ | ||
--package-dir "packages/$(package)" \ | ||
--named-addresses "$(named_addresses)" \ | ||
--language-version "$(language_version)" \ | ||
--compiler-version "$(compiler_version)" \ | ||
--json-output-file "$(output)" \ | ||
--included-artifacts "$(included_artifacts)"; | ||
|
||
verify-metadata: | ||
@if [ -z "$(package)" ] || [ -z "$(package_id)" ] || [ -z "$(url)" ] || [ -z "$(included_artifacts)" ]; then \ | ||
echo "Usage: make verify-package package=\"<package_name>\" package_id=\"<package_id>\" included_artifacts=\"<all/sparse/none>\" url=\"<url>\" [named_addresses=\"<named_addresses>\"]"; \ | ||
exit 1; \ | ||
fi; \ | ||
\ | ||
aptos move verify-package \ | ||
--package-dir "packages/$(package)" \ | ||
--account "$(package_id)" \ | ||
--named-addresses "$(named_addresses)" \ | ||
--language-version "$(language_version)" \ | ||
--compiler-version "$(compiler_version)" \ | ||
--included-artifacts "$(included_artifacts)" \ | ||
--url "${url}"; | ||
|
||
build-dev: clean | ||
@packages=$$(find "packages" -type d -mindepth 1 -maxdepth 1); \ | ||
for package in $$packages; do \ | ||
echo ">> Building $$package in dev mode..."; \ | ||
aptos move compile \ | ||
--dev \ | ||
--package-dir $$package \ | ||
--language-version "$(language_version)" \ | ||
--compiler-version "$(compiler_version)"; \ | ||
done | ||
|
||
prove: clean | ||
@packages=$$(find "packages" -type d -mindepth 1 -maxdepth 1); \ | ||
for package in $$packages; do \ | ||
echo ">> Running Move Prover for $$package..."; \ | ||
aptos move prove \ | ||
--package-dir $$package \ | ||
--dev \ | ||
--language-version "$(language_version)" \ | ||
--compiler-version "$(compiler_version)"; \ | ||
done | ||
|
||
test: clean | ||
@packages=$$(find "packages" -type d -mindepth 1 -maxdepth 1); \ | ||
for package in $$packages; do \ | ||
echo ">> Testing $$package..."; \ | ||
aptos move test \ | ||
--package-dir $$package \ | ||
--coverage \ | ||
--dev \ | ||
--language-version "$(language_version)" \ | ||
--compiler-version "$(compiler_version)"; \ | ||
\ | ||
COVERAGE_RESULTS=$$(\ | ||
aptos move coverage summary \ | ||
--package-dir $$package \ | ||
--dev \ | ||
--language-version "$(language_version)" \ | ||
--compiler-version "$(compiler_version)" \ | ||
); \ | ||
\ | ||
if [ -z "$$(echo "$$COVERAGE_RESULTS" | grep "% Move Coverage: 100.00")" ]; then \ | ||
echo ">> Coverage is not at 100%!"; \ | ||
exit 1; \ | ||
fi; \ | ||
done | ||
|
||
log_file = $(shell pwd)/aptos-node.log | ||
|
||
start-network: stop-network | ||
@bash scripts/shell/start_network.sh | ||
|
||
stop-network: | ||
@bash scripts/shell/stop_network.sh | ||
|
||
create-local-account: | ||
@mkdir -p .aptos/keys && \ | ||
if [ ! -f .aptos/keys/deployer.key ]; then \ | ||
aptos key generate --key-type ed25519 --output-file .aptos/keys/deployer.key; \ | ||
fi && \ | ||
aptos init --profile deployer --network local --private-key-file .aptos/keys/deployer.key --assume-yes |
Oops, something went wrong.