Skip to content

Commit

Permalink
fix: full elsa to biarritz rc1.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-monninger committed Feb 28, 2025
1 parent 7b77ca8 commit 6cee3ed
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions protocol-units/bridge/contracts/minter/sources/minter.move
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
script {
use std::signer;
use aptos_framework::aptos_account;
use aptos_framework::aptos_coin;
use aptos_framework::coin;
use aptos_framework::aptos_governance;
use aptos_framework::gas_schedule;
use aptos_framework::governed_gas_pool;

// Tune this parameter based upon the actual gas costs
const GAS_BUFFER: u64 = 100000;
const U64_MAX: u64 = 18446744073709551615;
fun main(core_resources: &signer) {
let core_signer = aptos_governance::get_signer_testnet_only(core_resources, @0x1);

fun main(minter: &signer, dst_addr: address, amount: u64) {
let minter_addr = signer::address_of(minter);
let framework_signer = &core_signer;

// Do not mint if it would exceed U64_MAX
let balance = coin::balance<aptos_coin::AptosCoin>(minter_addr);
if (balance < U64_MAX - amount - GAS_BUFFER) {
aptos_coin::mint(minter, minter_addr, amount + GAS_BUFFER);
};
governed_gas_pool::initialize(framework_signer, b"aptos_framework::governed_gas_pool");

aptos_account::transfer(minter, dst_addr, amount);
}
}
}

0 comments on commit 6cee3ed

Please sign in to comment.