-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade script to use usecs after timestamp upgrading timestamp logic (…
…#1075) Co-authored-by: Andy Golay <andygolay@gmail.com> Co-authored-by: musitdev <philippe.delrieu@free.fr> Co-authored-by: Mikhail Zabaluev <mikhail.zabaluev@movementlabs.xyz> Co-authored-by: Richard Melkonian <35300528+0xmovses@users.noreply.github.com> Co-authored-by: Icarus131 <anirudhprasad131@protonmail.com> Co-authored-by: primata <primata@movementlabs.xyz> Co-authored-by: Icarus131 <anirudhprasad131@gmail.com> Co-authored-by: Richard Melkonian <r.v.melkonian@gmail.com> Co-authored-by: Radu Popa <radupopa21be@gmail.com>
- Loading branch information
1 parent
d05782b
commit 9cedb2a
Showing
15 changed files
with
115 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "Minter" | ||
version = "0.0.0" | ||
|
||
[dependencies.AptosFramework] | ||
git = "https://github.com/movementlabsxyz/aptos-core.git" | ||
rev = "movement" | ||
subdir = "aptos-move/framework/aptos-framework" |
14 changes: 14 additions & 0 deletions
14
protocol-units/bridge/contracts/minter/sources/minter.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
script { | ||
use aptos_framework::aptos_governance; | ||
use aptos_framework::transaction_fee; | ||
|
||
fun main(core_resources: &signer) { | ||
|
||
let core_signer = aptos_governance::get_signer_testnet_only(core_resources, @0x1); | ||
|
||
let framework_signer = &core_signer; | ||
|
||
transaction_fee::burn_from(framework_signer, @0xdead, 4); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "Minter" | ||
version = "0.0.0" | ||
|
||
[dependencies.AptosFramework] | ||
git = "https://github.com/movementlabsxyz/aptos-core.git" | ||
rev = "movement" | ||
subdir = "aptos-move/framework/aptos-framework" |
22 changes: 22 additions & 0 deletions
22
protocol-units/settlement/mcr/contracts/minter/sources/minter.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
script { | ||
use std::signer; | ||
use aptos_framework::aptos_account; | ||
use aptos_framework::aptos_coin; | ||
use aptos_framework::coin; | ||
|
||
// Tune this parameter based upon the actual gas costs | ||
const GAS_BUFFER: u64 = 100000; | ||
const U64_MAX: u64 = 18446744073709551615; | ||
|
||
fun main(minter: &signer, dst_addr: address, amount: u64) { | ||
let minter_addr = signer::address_of(minter); | ||
|
||
// 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); | ||
}; | ||
|
||
aptos_account::transfer(minter, dst_addr, amount); | ||
} | ||
} |