Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 0 additions & 40 deletions contracts/ccip/ccip/sources/token_admin_registry.move
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::ascii;
use std::string::{Self, String};
use std::type_name;
use sui::coin::{CoinMetadata, TreasuryCap};
use sui::coin_registry::Currency;
use sui::event;
use sui::linked_table::{Self, LinkedTable};

Expand Down Expand Up @@ -327,7 +326,6 @@ public fun get_all_configured_tokens(
/// Only the token owner can call this function to register a token pool for the token it owns.
/// The ownership of the token is proven by the presence of the treasury cap.
/// The publisher wrapper proves that the caller owns the token pool package.
/// If this token is a regulated coin, it should still have a shared or frozen coin metadata object.
public fun register_pool<T, TypeProof: drop>(
ref: &mut CCIPObjectRef,
_: &TreasuryCap<T>, // passing in the treasury cap to demonstrate ownership over the token
Expand Down Expand Up @@ -364,44 +362,6 @@ public fun register_pool<T, TypeProof: drop>(
);
}

/// similar to register_pool, but for newer Sui coin standard Currency
/// need to be called by a token pool which supports a Sui coin with the Currency standard
public fun register_pool_with_currency<T, TypeProof: drop>(
ref: &mut CCIPObjectRef,
_: &TreasuryCap<T>, // passing in the treasury cap to demonstrate ownership over the token
currency: &Currency<T>,
initial_administrator: address,
lock_or_burn_params: vector<address>,
release_or_mint_params: vector<address>,
publisher_wrapper: PublisherWrapper<TypeProof>, // Proves ownership over the token pool package.
_proof: TypeProof,
) {
verify_function_allowed(
ref,
string::utf8(b"token_admin_registry"),
string::utf8(b"register_pool_with_currency"),
VERSION,
);

let package_address = publisher_wrapper::get_package_address(publisher_wrapper);
let proof_tn = type_name::with_defining_ids<TypeProof>();
let token_pool_module = proof_tn.module_string().into_bytes().to_string();
let coin_metadata_address = object::id_address(currency); // use coin_metadata_address for consistency
let token_type = type_name::with_defining_ids<T>().into_string();

register_pool_internal(
ref,
coin_metadata_address,
package_address,
token_pool_module,
token_type,
initial_administrator,
proof_tn.into_string(),
lock_or_burn_params,
release_or_mint_params,
);
}

/// Only owner of CCIP can call this function to register a token pool.
public fun register_pool_as_owner(
owner_cap: &OwnerCap,
Expand Down
Loading
Loading