Skip to content

feat: restricted transmuter #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 26, 2024
Merged

feat: restricted transmuter #590

merged 5 commits into from
Jun 26, 2024

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented Jun 24, 2024

This PR adds a variant of the Transmuter with the following changes:

  1. transmute and reverse require access control roles.
  2. The percentage cap limit is removed.
  3. The ceiling is hardcoded at deployment.

To preserve the same interface, set_ceiling() and set_percentage_cap() are simple returns.

I have also updated the devnet script to transmute 250,000 USDC at launch. Once approved, I will proceed with adding the deployment on Sepolia without the initial transmute. The mainnet script can be tackled in #589.

@tserg tserg requested a review from milancermak June 24, 2024 16:08
Copy link
Contributor

@milancermak milancermak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tserg
Copy link
Collaborator Author

tserg commented Jun 25, 2024

I have deployed this transmuter variant on Sepolia and performed a [transmute] (0x5d5bc2706cfbeeb91eb76a46be12b443f7ec1ec33b969f367d98f772c3a8bfe) of 5 USDC with the devnet script locally:

let transmute_amt: u128 = 5000000; // 5 (10**6)
    let _approve_usdc = invoke(
        addresses::sepolia::usdc(),
        selector!("approve"),
        array![usdc_transmuter_restricted.into(), transmute_amt.into(), 0],
        Option::Some(constants::MAX_FEE),
        Option::None,
    )
        .expect('approve USDC failed');
    let _transmute = invoke(
        usdc_transmuter_restricted,
        selector!("transmute"),
        array![transmute_amt.into()],
        Option::Some(constants::MAX_FEE),
        Option::None
    )
        .expect('transmute failed');

@tserg tserg merged commit e8c2767 into main Jun 26, 2024
1 check passed
@tserg tserg deleted the feat/restricted_transmuter branch June 26, 2024 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants