{"id":23679016,"url":"https://github.com/uxdprotocol/uxd-program","last_synced_at":"2025-09-02T07:33:29.650Z","repository":{"id":64204111,"uuid":"375397921","full_name":"UXDProtocol/uxd-program","owner":"UXDProtocol","description":"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.","archived":false,"fork":false,"pushed_at":"2024-09-18T01:51:39.000Z","size":14271,"stargazers_count":21,"open_issues_count":10,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-18T05:34:39.914Z","etag":null,"topics":["blockchain","cryptocurrency","defi","finance","solana","solana-program","spl-token","stablecoin"],"latest_commit_sha":null,"homepage":"https://uxd.fi/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UXDProtocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-09T15:09:54.000Z","updated_at":"2024-09-08T13:28:03.000Z","dependencies_parsed_at":"2024-04-17T19:47:23.795Z","dependency_job_id":"c9967fe4-c549-4148-98b2-755c90ba1dee","html_url":"https://github.com/UXDProtocol/uxd-program","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fuxd-program","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fuxd-program/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fuxd-program/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fuxd-program/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UXDProtocol","download_url":"https://codeload.github.com/UXDProtocol/uxd-program/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231762465,"owners_count":18422861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","cryptocurrency","defi","finance","solana","solana-program","spl-token","stablecoin"],"created_at":"2024-12-29T16:59:55.173Z","updated_at":"2024-12-29T16:59:55.703Z","avatar_url":"https://github.com/UXDProtocol.png","language":"Rust","readme":"# UXD-Program\n\n[![Anchor Test](https://github.com/UXDProtocol/uxd-program/actions/workflows/ci-anchor-test.yml/badge.svg?branch=main)](https://github.com/UXDProtocol/uxd-program/actions/workflows/ci-anchor-test.yml)\n[![Lint and Test](https://github.com/UXDProtocol/uxd-program/actions/workflows/ci-cargo-lint-test.yml/badge.svg?branch=main)](https://github.com/UXDProtocol/uxd-program/actions/workflows/ci-cargo-lint-test.yml)\n[![Sec3 Vulnerability Scanning](https://github.com/UXDProtocol/uxd-program/actions/workflows/ci-sec3-vulnerability-scanning.yml/badge.svg?branch=main)](https://github.com/UXDProtocol/uxd-program/actions/workflows/ci-sec3-vulnerability-scanning.yml)\n[![Cargo Audit](https://github.com/UXDProtocol/uxd-program/actions/workflows/ci-cargo-audit.yml/badge.svg?branch=main)](https://github.com/UXDProtocol/uxd-program/actions/workflows/ci-cargo-audit.yml)\n\nThe 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\n\nIt currently sits at:\n\n- mainnet-beta `UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr`\n\n- devnet `BLaLouDQKDDf8T9WCgQpzxCBRtcJ4nbqv7fVQeE9PuCY` (Used by CI, this address should be update accordingly in ci files)\n\n## Getting start\n\nIf you want to learn more about the high level concept of UXDProtocol, the [UXDProtocol Git book](https://docs.uxd.fi/uxdprotocol/) is available.\n\n## Codebase org\n\nThe program (smart contract) is contained in `programs/uxd/`.\nIts instructions are in `programs/uxd/src/instructions/`.\n\nThe project uses `Anchor` for safety, maintainability and readability.\n\nThis program contains 2 set of instructions, one permissionned and one permissionless. Permissionned instruction are called by [our DAO](https://governance.uxd.fi/dao/UXP).\n\nPlease refer to the [UXDProgram Git book](https://docs.uxd.fi/uxdprogram-solana/welcome/purpose-and-philosophy) for the program architecture.\n\n## Interaction with UXD Client\n\n[UXD Client](https://github.com/UXDProtocol/uxd-client) is the open source typescript client of UXD Program.\n\nEach 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.\n\nTo run the integration test with a specific client, please specify the version of `@uxd-protocol/uxd-client` in the `package.json` file.\n\nTo test locally with local client modification, `npm link` can be used as described below:\n\n```Zsh\n# on the client directory\n$\u003e npm link\n# then run cmd below on the program directory to link the locally build package instead of the fetched one\n$\u003e npm link @uxd-protocol/uxd-client\n```\n\n## Audits\n\nThe Program has been audited by Bramah Systems and Sec3.\n\nAudit reports are available at \u003chttps://docs.uxd.fi/uxdprogram-solana/welcome/audits\u003e.\n\n## Running tests\n\n### Rust unit tests\n\n```Zsh\n$\u003e cargo test \u0026\u0026 cargo build-bpf \u0026\u0026 cargo test-bpf\n```\n\n### E2E Tests\n\nRun the test :\n\n```Zsh\n$\u003e ./scripts/reset_program_id.sh # Optional, will reset the program ID in all files where it's needed to start with a clean slate\n$\u003e anchor test # Will build, deploy and run the tests\n```\n\nIf you want to re-run the tests with the already deployed program (without registering changes to the rust code), you can run :\n\n```Zsh\n$\u003e anchor test --skip-build --skip-deploy\n```\n\nIf you made changes to the Rust code, you have to re-run the lengthy :\n\n```Zsh\n$\u003e anchor test\n```\n\nLoop 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`).\n\n## Testing strategy with CI\n\nFour workflow would be kick started for PR branches merging to `main`.\n\n### Anchor test - ci-anchor-test.yml\n\nE2E test.\nThere are a few script in the test folder with following the `test_ci_*.ts`, these are related to the github workflow.\n\nThe CI strategy for E2E :\n\n- use the ci-resident-program (call ./scripts/swap_ci_resident_program.sh)\n- use it's upgrade authority stored in `target/deploy/ci-resident-upgrade-authority.json` for deployment\n- upgrade program\n- 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.\n- then starts test suites in series for each depositories.\n- here is the job dependencies\n  ![ci anchor test flow](ci_workflow.png)\n\nNote that it don't do concurrent run of this workflow, as they test some internal state of the program and would collide.\n\n### Cargo audit test - ci-cargo-audit.yml\n\nCrates security vulnerability checking [tool](https://github.com/RustSec/rustsec/tree/main/cargo-audit), by RustSec.\n\n### Cargo lint test - ci-lint-test.yml\n\nRuns cargo fmt, clippy, test and test-bpf.\n\n### Sec3 vulnerabilty scanning test - ci-sec3-vulnerability-scanning.yml\n\nSolana smart contract vulnerability scanning [tool](https://github.com/silas-x/soteria-action), by Sec3.\n\n## Branches and Tags\n\nBranch off from `develop` for new development changes. Pull requests should always target to `develop` as well.\n\nThe program binary should be built from `develop` and merged to `main` after successful deployment and tagged with the version name as `v*.*.*`.\n\nCheck the [Releases](https://github.com/UXDProtocol/uxd-program/releases) for previous deployed program on mainnet.\n\n## Deployment and Program Upgrades\n\nBy default the program builds with the `development` feature, and the ProgramID for devnet.\n\nBuilding for mainnet uses `anchor build -- --no-default-features --features production`\n\nThe program upgrade are done through our [DAO](https://governance.uxd.fi/dao/UXP).\n\nIt required to build for release then to prepare a buffer with :\n\n```Zsh\n$\u003e solana program write-buffer  ./target/deploy/uxd.so\n# anchor verify -p uxd \u003cBuffer ID from previous command\u003e  //TODO\n$\u003e solana program set-buffer-authority \u003cBufferID\u003e --new-buffer-authority CzZySsi1dRHMitTtNe2P12w3ja2XmfcGgqJBS8ytBhhY\n```\n\n![Governance upgrade](dao_program_upgrade.png)\n\n## Licensing\n\nThe license for UXD Program is the Business Source License 1.1 (`BUSL-1.1`), see [`LICENSE`](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuxdprotocol%2Fuxd-program","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuxdprotocol%2Fuxd-program","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuxdprotocol%2Fuxd-program/lists"}