Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implementation of a program that manages on chain accounts to mint and redeem Redeemables tokens (UXD), hedged by a delta neutral position on underlying DEXes.

License

NotificationsYou must be signed in to change notification settings

UXDProtocol/uxd-program

Repository files navigation

Anchor TestLint and TestSec3 Vulnerability ScanningCargo Audit

The actual deployed state of each contract should live in a protected master branch. The latest master should always reflect the code deployed to all relevant chains

It currently sits at:

  • mainnet-betaUXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr

  • devnetBLaLouDQKDDf8T9WCgQpzxCBRtcJ4nbqv7fVQeE9PuCY (Used by CI, this address should be update accordingly in ci files)

Getting start

If you want to learn more about the high level concept of UXDProtocol, theUXDProtocol Git book is available.

Codebase org

The program (smart contract) is contained inprograms/uxd/.Its instructions are inprograms/uxd/src/instructions/.

The project usesAnchor for safety, maintainability and readability.

This program contains 2 set of instructions, one permissionned and one permissionless. Permissionned instruction are called byour DAO.

Please refer to theUXDProgram Git book for the program architecture.

Interaction with UXD Client

UXD Client is the open source typescript client of UXD Program.

Each version of program is expected to pair with a specific version of the client, so any enhancement to the program that change the IDL must have a corresponding update on the client as well.

To run the integration test with a specific client, please specify the version of@uxd-protocol/uxd-client in thepackage.json file.

To test locally with local client modification,npm link can be used as described below:

# on the client directory$> npm link# then run cmd below on the program directory to link the locally build package instead of the fetched one$> npm link @uxd-protocol/uxd-client

Audits

The Program has been audited by Bramah Systems and Sec3.

Audit reports are available athttps://docs.uxd.fi/uxdprogram-solana/welcome/audits.

Running tests

Rust unit tests

$> cargotest&& cargo build-bpf&& cargo test-bpf

E2E Tests

Run the test :

$> ./scripts/reset_program_id.sh# Optional, will reset the program ID in all files where it's needed to start with a clean slate$> anchortest# Will build, deploy and run the tests

If you want to re-run the tests with the already deployed program (without registering changes to the rust code), you can run :

$> anchortest --skip-build --skip-deploy

If you made changes to the Rust code, you have to re-run the lengthy :

$> anchortest

Loop theses as many time as you want, and if you want a clean slate, just reset the program_id with the script (./script/reset_program_id.sh).

Testing strategy with CI

Four workflow would be kick started for PR branches merging tomain.

Anchor test - ci-anchor-test.yml

E2E test.There are a few script in the test folder with following thetest_ci_*.ts, these are related to the github workflow.

The CI strategy for E2E :

  • use the ci-resident-program (call ./scripts/swap_ci_resident_program.sh)
  • use it's upgrade authority stored intarget/deploy/ci-resident-upgrade-authority.json for deployment
  • upgrade program
  • starttest_ci_setup.ts, to setup controller and all depositories on the resident program, no mint/redeem testing is involved on this test suite, global settings like supply cap and insurance fund should be tested here.
  • then starts test suites in series for each depositories.
  • here is the job dependenciesci anchor test flow

Note that it don't do concurrent run of this workflow, as they test some internal state of the program and would collide.

Cargo audit test - ci-cargo-audit.yml

Crates security vulnerability checkingtool, by RustSec.

Cargo lint test - ci-lint-test.yml

Runs cargo fmt, clippy, test and test-bpf.

Sec3 vulnerabilty scanning test - ci-sec3-vulnerability-scanning.yml

Solana smart contract vulnerability scanningtool, by Sec3.

Branches and Tags

Branch off fromdevelop for new development changes. Pull requests should always target todevelop as well.

The program binary should be built fromdevelop and merged tomain after successful deployment and tagged with the version name asv*.*.*.

Check theReleases for previous deployed program on mainnet.

Deployment and Program Upgrades

By default the program builds with thedevelopment feature, and the ProgramID for devnet.

Building for mainnet usesanchor build -- --no-default-features --features production

The program upgrade are done through ourDAO.

It required to build for release then to prepare a buffer with :

$> solana program write-buffer  ./target/deploy/uxd.so# anchor verify -p uxd <Buffer ID from previous command>  //TODO$> solana program set-buffer-authority<BufferID> --new-buffer-authority CzZySsi1dRHMitTtNe2P12w3ja2XmfcGgqJBS8ytBhhY

Governance upgrade

Licensing

The license for UXD Program is the Business Source License 1.1 (BUSL-1.1), seeLICENSE.

About

Implementation of a program that manages on chain accounts to mint and redeem Redeemables tokens (UXD), hedged by a delta neutral position on underlying DEXes.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors7

Languages


[8]ページ先頭

©2009-2026 Movatter.jp