- Notifications
You must be signed in to change notification settings - Fork8
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
UXDProtocol/uxd-program
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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-beta
UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Drdevnet
BLaLouDQKDDf8T9WCgQpzxCBRtcJ4nbqv7fVQeE9PuCY(Used by CI, this address should be update accordingly in ci files)
If you want to learn more about the high level concept of UXDProtocol, theUXDProtocol Git book is available.
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.
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
The Program has been audited by Bramah Systems and Sec3.
Audit reports are available athttps://docs.uxd.fi/uxdprogram-solana/welcome/audits.
$> cargotest&& cargo build-bpf&& cargo test-bpf
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).
Four workflow would be kick started for PR branches merging tomain.
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 in
target/deploy/ci-resident-upgrade-authority.jsonfor deployment - upgrade program
- start
test_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 dependencies

Note that it don't do concurrent run of this workflow, as they test some internal state of the program and would collide.
Crates security vulnerability checkingtool, by RustSec.
Runs cargo fmt, clippy, test and test-bpf.
Solana smart contract vulnerability scanningtool, by Sec3.
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.
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
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
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.
