I want to use golangsdk to call the domain name transfer through the smart contract. According to the prompt in the document, I also called it according to the corresponding parameters. However, I found that one failed.
Golang SDK code
account, _ := models.SigningKeyHexStringAccount(“d03826de64d010f683b4aee0ac67e074e01725bb6f94c6d26942ab5a5671886a5e88d722246295cefec3143d2cf2212347aac960d0b3ea4abe03fba86ce0dc2e”)
nameHash, _ := binary.Blake2bHash(byte(“888888888888.chain”))
fmt.Println(“Address”, account.Address)
fmt.Println(“nameHash_string_hex”, hex.EncodeToString(nameHash))
signature := account.Sign(byte((account.Address + hex.EncodeToString(nameHash) + “ct_2Fzav4sEVaqS6UZNNkFjVSG29XownExNEjYnqZ1tTpckF2nYBE”)))
fmt.Println(“signature_string_EncodeToString”, hex.EncodeToString(signature))
Address ak_idkx6m3bgRr7WiKXuB8EBYBoRqVsaSc6qo4dsd23HKgj3qiCF
nameHash_string_hex dc06aacb6abbc5a015af8c5f9c3e4a707f4eaf8af3b9e0aaa62e52be50834b45
signature_string_EncodeToString f3bdd3e516a4992313cdbd3e3dc49943e9b1162d38be4e5e0a930810086458c252c55ca931e83340b7ee41d7928c9c4e3020897cdc6e9939c592714161b1820f
Contract code
contract AENSTrans =
stateful entrypoint getBalance() =
Call.callerstateful entrypoint signedTransfer( new_owner : address, name : string, sign : signature) : unit =
AENS.transfer(Call.caller, new_owner, name, signature = sign)
The parameter is
ak_QyFYYpgJ1vUGk1Lnk8d79WJEVcAtcfuNHqquuP2ADfxsL6yKx,dc06aacb6abbc5a015af8c5f9c3e4a707f4eaf8af3b9e0aaa62e52be50834b45,f3bdd3e516a4992313cdbd3e3dc49943e9b1162d38be4e5e0a930810086458c252c55ca931e83340b7ee41d7928c9c4e3020897cdc6e9939c592714161b1820f