0

I was trying to make a move call on sui network.

For that I first published a mov module of fungible token

This gave me following result

----- Certificate ----
Transaction Hash: NR3rJpG11TQmOekptt/s/PuiU/RmIGSjq4XxzSo2OlU=
Transaction Signature: AA==@DXCini9RT5GSXAjbskV+d8n61MnCL0fC1Jo80jOial6lHttkvWBuGumwSCauRt3yqlKOETrohFGLRLa8riJqDw==@ec4L29qmwG/pHIDdaArL0QpqeagKxiX+7o15WL764zo=
Signed Authorities Bitmap: RoaringBitmap<[0, 2, 3]>
Transaction Kind : Publish
----- Transaction Effects ----
Status : Success
Created Objects:
  - ID: 0x268e548a24ea8782339bbf9d1b6736575f58c57a , Owner: Immutable
  - ID: 0xa9db6ecb69ff7eca768fd13d04f448c0bb4857d5 , Owner: Account Address ( 0xb624c69d527fed41014bc206774c2b732e3372f4 )
Mutated Objects:
  - ID: 0x6a10c24ff1c93ccf95056c38784278f6f4a70230 , Owner: Account Address ( 0xb624c69d527fed41014bc206774c2b732e3372f4 )
----- Publish Results ----
The newly published package object ID: 0x268e548a24ea8782339bbf9d1b6736575f58c57a

List of objects created by running module initializers:
----- Move Object (0xa9db6ecb69ff7eca768fd13d04f448c0bb4857d5[1]) -----
Owner: Account Address ( 0xb624c69d527fed41014bc206774c2b732e3372f4 )
Version: 1
Storage Rebate: 17
Previous Transaction: NR3rJpG11TQmOekptt/s/PuiU/RmIGSjq4XxzSo2OlU=
----- Data -----
type: 0x2::coin::TreasuryCap<0x268e548a24ea8782339bbf9d1b6736575f58c57a::managed::MANAGED>
id: 0xa9db6ecb69ff7eca768fd13d04f448c0bb4857d5
total_supply: 
  type: 0x2::balance::Supply<0x268e548a24ea8782339bbf9d1b6736575f58c57a::managed::MANAGED>
  value: 0

Updated Gas : Coin { id: 0x6a10c24ff1c93ccf95056c38784278f6f4a70230, value: 99999999997359 }

Now when I am trying to make a mov call by running following command

sui client call --function mint --module managed --package 0x268e548a24ea8782339bbf9d1b6736575f58c57a --args \"0x6a10c24ff1c93ccf95056c38784278f6f4a70230\" 427 \"0x71a6d5b7d4b92a65c9339aa57665aea69a62bcf1\" --gas-budget 30000

it is throwing following error

ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: EntryArgumentError(EntryArgumentError { argument_idx: 0, kind: TypeMismatch }), source: Some("Expected argument of type 0x2::coin::TreasuryCap<0x268e548a24ea8782339bbf9d1b6736575f58c57a::managed::MANAGED>, but found type 0x2::coin::Coin<0x2::sui::SUI>") } }

This is how mint looks like

    /// Manager can mint new coins
    public entry fun mint(
        treasury_cap: &mut TreasuryCap<MANAGED>, amount: u64, recipient: address, ctx: &mut TxContext
    ) {
        coin::mint_and_transfer(treasury_cap, amount, recipient, ctx)
    }

Can someone help me in figuring out what I am doing wrong here?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Alwaysblue
  • 9,948
  • 38
  • 121
  • 210

0 Answers0