From 5349c737cdc515874111e45c68727422f2f2f53b Mon Sep 17 00:00:00 2001 From: Josh Hannan Date: Wed, 29 May 2024 16:40:49 -0500 Subject: [PATCH] add entitlement to TokenForwarding, tx, and test --- contracts/utility/TokenForwarding.cdc | 14 ++++++++--- lib/go/contracts/internal/assets/assets.go | 6 ++--- lib/go/templates/internal/assets/assets.go | 23 +++++++++++++++++ tests/switchboard_test.cdc | 7 ++++++ .../tokenForwarder/change_recipient.cdc | 25 +++++++++++++++++++ 5 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 transactions/tokenForwarder/change_recipient.cdc diff --git a/contracts/utility/TokenForwarding.cdc b/contracts/utility/TokenForwarding.cdc index 8527f83..01ea1b3 100644 --- a/contracts/utility/TokenForwarding.cdc +++ b/contracts/utility/TokenForwarding.cdc @@ -18,8 +18,13 @@ import "FungibleToken" access(all) contract TokenForwarding { + access(all) entitlement Owner + // Event that is emitted when tokens are deposited to the target receiver - access(all) event ForwardedDeposit(amount: UFix64, depositedUUID: UInt64, from: Address?, to: Address?, toUUID: UInt64, depositedType: Type) + access(all) event ForwardedDeposit(amount: UFix64, depositedUUID: UInt64, from: Address?, to: Address?, toUUID: UInt64, depositedType: String) + + // Event that is emitted when the recipient of a forwarder has changed + access(all) event ForwarderRecipientUpdated(owner: Address?, oldRecipient: Address?, newRecipient: Address?, newReceiverType: String, newReceiverUUID: UInt64) access(all) resource interface ForwarderPublic { @@ -55,7 +60,7 @@ access(all) contract TokenForwarding { let uuid = from.uuid - emit ForwardedDeposit(amount: balance, depositedUUID: uuid, from: self.owner?.address, to: receiverRef.owner?.address, toUUID: receiverRef.uuid, depositedType: from.getType()) + emit ForwardedDeposit(amount: balance, depositedUUID: uuid, from: self.owner?.address, to: receiverRef.owner?.address, toUUID: receiverRef.uuid, depositedType: from.getType().identifier) receiverRef.deposit(from: <-from) } @@ -78,10 +83,13 @@ access(all) contract TokenForwarding { // changeRecipient changes the recipient of the forwarder to the provided recipient // - access(all) fun changeRecipient(_ newRecipient: Capability) { + access(Owner) fun changeRecipient(_ newRecipient: Capability) { pre { newRecipient.borrow<&{FungibleToken.Receiver}>() != nil: "Could not borrow Receiver reference from the Capability" } + let newRef = newRecipient.borrow<&{FungibleToken.Receiver}>()! + let oldRef = self.recipient.borrow<&{FungibleToken.Receiver}>()! + emit ForwarderRecipientUpdated(owner: self.owner?.address, oldRecipient: oldRef.owner?.address, newRecipient: newRef.owner?.address, newReceiverType: newRef.getType().identifier, newReceiverUUID: newRef.uuid) self.recipient = newRecipient } diff --git a/lib/go/contracts/internal/assets/assets.go b/lib/go/contracts/internal/assets/assets.go index f6f56f2..9ba4c89 100644 --- a/lib/go/contracts/internal/assets/assets.go +++ b/lib/go/contracts/internal/assets/assets.go @@ -8,7 +8,7 @@ // ../../../contracts/utility/MetadataViews.cdc (25.493kB) // ../../../contracts/utility/NonFungibleToken.cdc (10.577kB) // ../../../contracts/utility/PrivateReceiverForwarder.cdc (2.845kB) -// ../../../contracts/utility/TokenForwarding.cdc (5.484kB) +// ../../../contracts/utility/TokenForwarding.cdc (6.146kB) // ../../../contracts/utility/ViewResolver.cdc (2.718kB) package assets @@ -239,7 +239,7 @@ func utilityPrivatereceiverforwarderCdc() (*asset, error) { return a, nil } -var _utilityTokenforwardingCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x58\x5d\x6f\xe3\xb6\x12\x7d\xd7\xaf\x98\xcd\x05\x6e\xec\x45\xd6\x7e\xb9\xb8\x0f\xc6\xe6\xee\xe7\x4d\xbb\x2f\x45\x91\x26\xed\x43\xb1\xe8\xd2\xd4\xc8\xe2\x9a\x26\x05\x72\x64\xad\x11\xf8\xbf\x17\x43\xea\xdb\x72\x9a\x2d\xd0\x02\x05\xd6\x0f\x89\x25\x93\x33\x67\x66\xce\x9c\x11\xb5\x7c\xfe\x3c\x49\xfe\x05\x37\xa5\xd9\xa8\xb5\x46\xb8\xb3\x5b\x34\x70\x63\x5d\x25\x5c\xaa\xcc\x06\xde\x59\x43\x4e\x48\x4a\x92\xbb\x5c\x79\x90\xf5\x25\xf8\xdc\x56\x1e\x72\x5b\x81\x30\x20\xa4\xb4\xa5\x21\x90\xb6\xd4\x29\x78\x24\x28\x0b\x10\x20\x4b\x4f\x76\xd7\x1a\x8f\xb6\x6f\x51\xa2\xda\xa3\x4b\xc8\x82\xd0\xda\x56\x40\x39\xee\x80\x2c\x64\xd1\x2b\x10\xaf\xf3\x7c\x47\x40\xaa\xb2\x0c\x1d\x1a\x6a\x7d\x54\x39\x1a\xdc\xa3\xe3\x6d\x07\x70\xd1\x5a\xbd\x67\xc1\x28\xf1\x00\x52\x18\x28\xca\xb5\x56\x3e\x07\x62\xd8\x75\x40\xe8\xc0\xa1\xb7\xa5\x93\x08\xc2\x83\x68\xc1\x80\x14\x85\x58\x2b\xad\xe8\x00\x9f\x4b\x4f\xa0\xd5\x16\x41\xc0\xcf\xa2\xd4\x74\x95\x08\x93\xb2\x3b\xf0\x68\xd8\x46\x6a\xd1\x9b\x4b\x02\xdc\xa3\x01\x83\xc8\x90\x61\x6b\x6c\x05\x8a\x40\xf9\x0e\xf4\x22\x49\x7e\xc9\xd1\xf4\x53\x54\x09\x43\x21\x36\xe9\x50\x10\xfb\x68\xb1\x5d\xc5\x90\xa4\xd0\x3a\x78\x8b\x2b\x7e\xc0\xaa\x5d\x91\x64\xa5\x91\xa4\x2c\x5b\x4c\xa1\x70\x76\xaf\x52\x64\xa7\x95\xa2\x3c\xec\x69\x03\x72\x18\x20\x48\x04\xca\x05\x45\xcb\xec\xbb\x97\xe8\x84\x72\x54\xae\x4b\xf7\x22\x49\x9e\x2f\x93\x44\xed\x0a\xeb\x08\x2e\x06\x65\xbb\x48\x12\x21\x25\x7a\x3f\x13\x5a\xcf\x3b\x1a\x84\x1f\x7b\x74\x79\x48\x12\x00\x80\xe5\x12\xfe\xbf\xe7\xaa\x05\xe7\xca\x03\xee\x14\x11\xa6\xa1\x7a\x8d\x47\xe1\x10\x52\x2c\xac\x57\x14\x53\xc8\x01\x90\x70\x1b\xa4\xa6\xae\x2e\x58\xeb\x7b\xc6\x60\xb6\xc9\x48\xfa\x3e\xee\x9f\x89\x1d\x67\x77\x05\xf7\x37\xea\xcb\x7f\xff\x73\xd5\xd9\xbd\xbf\xff\xf0\x7e\x05\xf7\x1f\x0c\xf1\xed\xcc\xd9\xdd\x0a\xde\xa4\xa9\x43\xef\x5f\x5d\x01\xd9\xe1\xd5\x70\x75\x6b\xe4\xee\x50\xe0\x0a\xf8\xef\x3c\x39\x41\xd4\x32\x4a\x19\x42\x97\x09\x89\x5d\x49\x7f\x64\x12\xca\x26\x2b\x31\x33\x4b\xf8\x1e\x75\x81\x0e\xda\x62\x32\x1b\x72\x94\x5b\xce\x0e\xe5\xe8\x42\x07\x7d\x72\x28\x55\xa1\xd0\xd0\xa7\x1e\x3b\x07\x76\x94\x07\x63\x09\xb4\x20\xce\x89\x75\x91\x35\x1d\x93\x49\xc5\xbc\x0a\xa0\x43\x81\xbc\x7c\x2f\xb4\x4a\x17\xad\x91\x7e\x18\x59\x69\x22\x8a\xd9\x7c\x05\x6f\xad\xd5\x43\xcc\xdf\x21\xd3\x36\xc7\xb6\x32\x20\xbc\x57\x1b\xd3\x78\x68\xd1\xf6\x00\x2c\x06\x16\x82\x7e\x30\x64\x64\xa7\xc2\x1d\x60\x8d\x52\x94\x1e\x03\x7b\x6d\x49\xa0\xe8\xaa\xee\x20\x0e\xab\xb0\xde\x07\x4d\x22\x0b\xda\xda\x2d\x94\xa1\xf9\x18\x43\x6e\x6d\x1a\x5a\xc0\x23\x82\xca\x58\x6a\xce\x66\xc8\x66\xdc\x7e\xf8\xa5\x40\x19\x68\xc6\x99\xb0\x8e\x3d\x2c\x22\xa4\x1c\x75\xe1\x61\x53\xb2\xf4\x88\x8d\x50\xc6\x13\x28\x93\x29\xa3\x08\xf5\x01\x64\x2e\x14\x47\x39\x66\xba\x75\x60\x43\xb1\x94\x09\x59\x85\x81\xe3\x9d\xd0\x4a\x2a\x5b\x7a\xd8\x2a\x93\x06\x14\x65\x91\x0a\x42\x1f\x5b\x22\x2a\x65\xe1\x22\x9d\xb5\xf2\xa4\xcc\xc6\x07\x7e\xc2\x1a\xd9\xfe\x4e\xa4\x75\xef\x72\x9f\x44\x17\xd6\x80\x27\xeb\x30\x73\xd6\x90\x1f\xa4\x77\xe0\xfd\xb5\x43\x2a\x5d\xd0\x1d\x5b\x30\xc5\x84\xee\xea\xd6\x23\x48\x66\x1d\xb7\xb2\x2f\x77\xe8\x02\x46\x4e\xee\x38\xd0\x86\x9d\xcb\x80\x81\x35\x8b\x29\x1b\xa4\xc3\x56\xe6\x2c\x97\xbc\xc8\xf0\xad\x75\xce\x56\x4c\xa8\x7f\x3f\x0c\xe4\x64\xd1\xe8\xd4\xf1\x55\x30\x70\x7c\xa4\xad\xda\x66\x5a\xc1\xb4\x8d\xab\xc7\xfb\xad\x25\x5e\x95\xa3\xc3\x10\x62\x5f\x75\x82\x14\x55\x4a\x6b\x58\x07\x81\xa7\xc5\x70\x2f\xd6\xcd\x63\x52\x25\xbb\xfa\x45\x9a\x8a\xbe\xcc\xd6\x5d\xd0\xc9\x56\x34\x31\x4e\x90\x47\x9d\xcd\x61\x2f\x5c\xd7\x32\x2b\x78\xd7\xd1\xb7\xef\xbd\xc6\x39\x65\x6d\xb9\xe4\x6c\xd4\xfa\x11\x14\x5e\x6c\xd1\x37\x23\x0b\xec\xfa\x33\x4a\x0a\x43\xce\x80\x70\x9b\x72\x17\x66\xa8\x49\x1b\xf1\xf7\x7d\x4b\x8a\x1a\xf9\x6d\x31\x5d\xfa\xda\x52\xe9\x03\x09\x78\xfa\x31\xf5\xd2\x2e\xe4\x47\x82\x6c\x59\x50\x47\x30\x8b\xc2\xfb\x7a\xc4\x82\xe0\xe1\x38\x87\x87\x76\x3f\x7f\x74\x4f\xff\x6f\x31\x83\x6b\xe0\x9c\x2d\x5a\x68\x8b\x75\xa0\xd5\xcb\xb3\x9c\xfa\xdf\x6c\xfe\x2c\x39\x31\xb9\x16\x5a\x70\xa1\xae\x43\x97\x2d\xea\xcb\xd3\x75\x65\xa9\xd2\x66\x11\x7f\x1f\xae\xe0\x41\x76\x7e\xfc\xd4\x46\x4f\xe6\x0f\xdb\x69\xa6\x4f\x08\xc6\x56\x06\xdd\xab\x85\x88\xb3\x27\x0e\xa2\x5e\xcc\x13\xbf\x47\x43\xfd\x35\xd1\xe8\x68\x48\x05\xd8\x1b\x24\xbe\x9a\xcd\xe7\x43\xf0\xfd\xdd\xc3\xca\xbc\x7c\xc1\xff\xe7\xed\xea\xe3\x3f\x71\x62\x8d\x78\x54\x8b\xe0\x88\x3c\x61\xc7\xa3\xdc\x39\x97\x84\x6f\x23\xf0\xdb\x08\xfc\x4b\x46\xe0\x93\x78\xfb\x04\xd1\x9b\x26\x2e\x97\xcf\x6c\xf0\xb6\x63\x67\xb8\xf6\x43\xbd\x6f\x42\xcf\xda\x93\x52\x3d\x11\xea\x53\x46\xda\x2d\x7d\x8a\xee\x8f\x7c\xce\x7e\x03\x83\xd5\xed\xd4\xc0\x1b\xab\x7f\xe1\x70\x74\x87\x3f\xfd\xdd\x4f\x49\x05\x3c\xbb\x06\xa3\xf4\x0a\x2e\xde\x05\x9a\x71\x37\xc5\x6d\x53\x47\xa4\xc0\x39\x0e\xb6\x83\x75\x31\x80\x70\x1c\x5c\x0d\x2b\x03\xd7\x03\x74\xe7\xd4\xe3\x0d\x6c\x90\x68\x20\xa2\xcc\xec\x58\xec\x58\x8c\xf0\x30\x12\xda\xd3\x83\x2f\x0b\x3e\x86\x61\x0a\xeb\x43\x3c\xc3\x36\x0f\x44\x57\x03\xb3\x55\xae\x64\x1e\x0e\xbc\xeb\xfe\x73\x4d\x37\xb5\x2f\xeb\x9b\x97\xad\xe3\x3f\x6e\x9a\x37\xce\x89\x03\x33\xe2\xe6\xae\x86\x13\x3b\x76\xe4\x65\x5a\x96\xf7\x0a\xab\xc0\x81\x0d\xd2\x4f\x4d\x14\x61\xd2\xf3\x4c\xf2\xdc\x0a\x0f\x71\x56\xb1\x66\x1f\x47\xc5\x56\x19\x3c\xfb\x6a\xc5\x9e\x20\x4c\x1d\xc9\xc3\xf1\x91\x3a\xf2\xb4\xdf\x33\xb0\x3f\xff\x94\x31\x36\xe7\x07\x01\xfb\x51\xa8\xd7\x63\x3c\xa3\xe5\xbf\x36\x68\xba\x09\xfe\x11\xae\x81\x5c\x89\x93\x0a\x31\xdc\x7d\x8e\x79\xb7\x35\xc5\x9a\x59\x1d\xa5\x3f\x90\x63\xa3\xf6\x35\xe3\xc2\xe3\xac\x94\x58\xb4\x94\xeb\x5e\x26\x8c\x78\x1c\x40\x76\x8c\x88\xbb\x40\x98\x43\x34\xe4\xf3\xd0\x71\xe1\x35\x4a\x0d\x94\x03\x60\xa3\x29\x66\xbc\xf7\x71\xda\x28\x7f\xca\x9a\x19\x75\x27\xf0\xc9\x59\x3f\x91\xfb\xa6\xa2\xe7\x68\x38\xa6\xdd\xc0\x04\x6f\x1e\xd5\x86\x21\x7c\x3c\xcf\xb4\x76\xf9\x90\x70\x80\xda\x23\x3c\x34\xab\x32\xc1\x97\xc7\xa9\x52\xf1\xb4\x9d\x4d\x9e\x09\x9e\x26\x91\x5f\xc5\xdc\xbf\x57\x1f\x4f\x47\xc7\xb1\x7f\xec\xe3\x19\x75\xf2\xae\xab\xbe\xc5\x47\x1a\x83\xd5\xe0\x0d\x5e\x03\xab\x7d\xeb\x75\x66\x46\xd5\xea\x76\x32\x9b\x4e\x7c\x9d\x49\xfb\x0a\x5e\x77\x6e\xbb\x84\xd7\xa5\x7c\xf9\xa2\x7e\x85\x37\x69\xa6\xfd\x3a\xaf\x23\x3d\x26\xbf\x07\x00\x00\xff\xff\x01\x05\x3d\xd5\x6c\x15\x00\x00" +var _utilityTokenforwardingCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x58\x4b\x6f\x1b\x39\x12\xbe\xf7\xaf\x28\x7b\x81\xb5\x14\x38\xd2\x65\xb1\x07\x21\xde\x3c\xd7\xbb\xb9\xec\x0e\x1c\x7b\xe6\x30\x08\x26\x54\x77\xb5\x9a\x31\x45\x36\xc8\x6a\x75\x04\x43\xff\x7d\x50\x24\xfb\xa9\x96\xe3\x0c\x26\x87\x01\xe2\x8b\xd5\xec\x62\x3d\xbf\xaa\x8f\xec\xe5\xb3\x67\x49\xf2\x37\xb8\xae\xf4\x46\xae\x15\xc2\xad\xb9\x47\x0d\xd7\xc6\xd6\xc2\x66\x52\x6f\xe0\xad\xd1\x64\x45\x4a\x49\x72\x5b\x48\x07\x69\x7c\x04\x57\x98\xda\x41\x61\x6a\x10\x1a\x44\x9a\x9a\x4a\x13\xa4\xa6\x52\x19\x38\x24\xa8\x4a\x10\x90\x56\x8e\xcc\xb6\x55\x1e\x74\xdf\x60\x8a\x72\x87\x36\x21\x03\x42\x29\x53\x03\x15\xb8\x05\x32\x90\x07\xab\x40\x2c\xe7\x78\x45\x40\x26\xf3\x1c\x2d\x6a\x6a\x6d\xd4\x05\x6a\xdc\xa1\xe5\x6d\x7b\xb0\x41\x5b\xdc\xb3\x60\x2f\x71\x0f\xa9\xd0\x50\x56\x6b\x25\x5d\x01\xc4\x6e\xc7\x80\xd0\x82\x45\x67\x2a\x9b\x22\x08\x07\xa2\x75\x06\x52\x51\x8a\xb5\x54\x92\xf6\xf0\xb9\x72\x04\x4a\xde\x23\x08\xf8\x59\x54\x8a\x2e\x13\xa1\x33\x36\x07\x0e\x35\xeb\xc8\x0c\x3a\x7d\x41\x80\x3b\xd4\xa0\x11\xd9\x65\xb8\xd7\xa6\x06\x49\x20\x5d\xe7\xf4\x22\x49\x7e\x29\x50\xf7\x53\x54\x0b\x4d\x3e\xb6\xd4\xa2\x20\xb6\xd1\xfa\x76\x19\x42\x4a\x85\x52\xde\x5a\x90\xf8\x1f\xd6\xad\x44\x92\x57\x3a\x25\x69\x58\x63\x06\xa5\x35\x3b\x99\x21\x1b\xad\x25\x15\x7e\x4f\x1b\x90\x45\xef\x42\x8a\x40\x85\xa0\xa0\x99\x6d\xf7\x12\x9d\x50\x81\xd2\x76\xe9\x5e\x24\xc9\xb3\x65\x92\xc8\x6d\x69\x2c\xc1\xf9\xa0\x6c\xe7\x49\x22\xd2\x14\x9d\x9b\x09\xa5\xe6\x1d\x0c\xfc\xcb\x1e\x5c\x1e\x92\x04\x00\xa0\x2f\x8b\x9a\x24\x29\xdc\x72\x11\xff\x5f\x6b\xb4\x41\x64\xb9\x84\x7f\xef\x78\xcd\xfb\x27\x1d\xe0\x56\x12\x61\xe6\x0b\xdc\x38\x25\x2c\x42\x86\xa5\x71\x92\x42\x96\x39\x46\x12\x76\x83\xd4\x94\xde\x1e\x1b\xf4\x6a\x9b\xa4\x65\xef\xc2\xfe\x99\xd8\x72\x01\x56\x70\x77\x2d\xbf\xfc\xf3\x1f\x97\x9d\xde\xbb\xbb\xf7\xef\x56\x70\xf7\x5e\x13\x2f\xe7\xd6\x6c\x57\xf0\x3a\xcb\x2c\x3a\xf7\xf2\x12\xc8\x0c\x9f\x86\xd2\xad\x92\xdb\x7d\x89\x2b\xf8\x40\x56\xea\xcd\xfc\x49\x11\x16\xc8\x21\xc8\x52\xb2\x88\xc9\x41\x34\x75\x41\x0b\x85\x70\x90\x16\x42\x6f\x30\xfb\x4a\x78\xf6\xa6\xd1\x71\x57\x66\x82\x30\x9b\x19\xce\x71\xdf\x67\xa3\xb2\x56\xa8\xbf\xae\xb1\x7e\x64\xdd\xe7\xb6\x1f\xd5\xe0\x45\x3f\x0b\xf3\xe3\x9a\xb7\x5d\x26\x35\xa1\xcd\x45\x8a\x9d\xc3\x3f\x71\x63\xa6\x0d\x52\x42\xa2\x96\xf0\x5f\x54\x25\x5a\x68\x01\xce\x1d\x52\x60\x7a\xcf\xc9\xa2\x02\xad\x9f\x2a\x9f\xda\x84\x7d\xea\x75\xec\x40\x8f\x74\xa0\x0d\x81\x12\xe4\xd3\x6a\x43\x27\x75\xdd\x4d\x32\x00\x49\x00\xed\x4b\x64\xf1\x9d\x50\x32\x5b\xb4\x4a\xfa\x61\xe4\x95\x0e\x5e\xcc\xe6\x2b\x78\x63\x8c\x1a\xfa\xfc\x1f\xe4\x56\x0e\x75\x0c\x5d\x27\x9c\x93\x1b\xdd\x58\xe8\xca\xdb\x39\xb0\x18\x68\xf0\x33\x95\x5d\x46\x36\x2a\xec\x1e\xd6\x98\x8a\xca\xa1\xef\x68\x53\x11\x48\xba\x8c\x53\x85\xc3\x2a\x8d\x73\x7e\x4e\x93\x01\x65\xcc\x3d\x54\x7e\x20\xb1\x0f\x85\x31\x99\x1f\x0b\x0e\x11\x24\xc3\xe9\x74\x86\x18\x6d\x1a\xf0\x4b\x89\xa9\xef\x2b\xce\x84\xb1\x6c\x61\x11\x5c\x2a\x50\x95\x0e\x36\x15\x8f\x63\xb1\x11\x52\x3b\x02\xa9\x73\xa9\x25\xa1\xda\x33\x34\x25\x47\x39\xee\x7e\x63\xc1\xf8\x62\x49\xed\xb3\x0a\x03\xc3\x5b\xa1\x64\x2a\x4d\xe5\xe0\x5e\xea\xcc\x7b\x51\x79\xcc\xba\xd0\x21\x81\x3d\x4a\x1b\x00\xae\xa4\x23\xa9\x37\xce\x37\x24\xac\x91\xf5\x6f\x45\x16\xe7\x19\x0f\x86\x60\xc2\x68\x70\x64\x2c\xe6\xd6\x68\x72\x83\xf4\x0e\xac\xbf\xb2\x48\x95\xf5\xb3\xd8\x94\x0c\x31\xa1\xba\xba\xf5\x00\x92\x1b\xcb\xe3\xcd\x55\x5b\xb4\xde\x47\x4e\xee\x38\xd0\x06\x9d\x4b\xef\x03\xcf\x71\xe3\x3b\x5a\x5a\x30\xb5\x3e\x89\x25\x27\x72\x7c\x63\xac\x35\x35\x03\xea\xef\x0f\x83\x11\xbb\x68\x7a\xeb\xf0\xd2\x2b\x38\x3c\xd2\x56\x6d\x33\xad\x60\x5a\xc7\xe5\xe3\xfd\xd6\x02\xaf\x2e\xd0\xa2\x0f\xb1\x3f\x66\xfd\xec\xad\xa5\x52\xb0\xf6\xa4\x47\x8b\xe1\x5e\x8c\xcd\xa3\x33\x99\x76\xf5\x0b\x30\x15\x7d\xea\x89\x5d\xd0\xcd\xe9\xa0\x62\x9c\x20\x87\x2a\x9f\xc3\x4e\xd8\xae\x65\x56\xf0\xb6\x83\x6f\xdf\x7a\xf4\x73\x4a\xdb\x72\xc9\xd9\x88\xf3\xc3\xb3\x9e\xb8\x47\xd7\xd0\x38\x98\xf5\x67\x4c\xc9\x13\xbf\x06\x61\x37\x95\xa7\x24\x6e\x99\x38\x78\x5d\x5f\x93\xa4\x86\x6f\x5a\x9f\x2e\x5c\xd4\x54\x39\x0f\x02\x3e\x11\x30\xf4\xb2\x2e\xe4\x47\x82\x6c\x51\x10\x23\x98\x05\xa6\x79\x35\x42\x81\xb7\x70\x98\xc3\x43\xbb\x9f\xff\x54\x8f\xf0\x6e\x30\x87\x2b\xe0\x9c\x2d\x5a\xd7\x16\x6b\x0f\xab\x17\x27\x31\xf5\xaf\xd9\xfc\x2c\x39\x52\xb9\x16\x4a\x70\xa1\xae\x7c\x97\x2d\xe2\xe3\xb1\x5c\x55\xc9\xac\x11\xe2\xdf\x43\x09\xe6\xb5\xd3\x7c\x1b\x95\x1e\x11\x2e\xeb\x69\xe8\xd6\x07\xe3\x89\xeb\xe5\x42\x04\x22\x0a\xcc\xdb\x8b\x79\xe2\x7d\x50\xd4\x97\x09\x4a\x47\xac\xec\xdd\xde\x20\xf1\xd3\x6c\xbe\x90\x19\x1f\x49\x72\x89\x76\x3e\x8c\xa3\xaf\x68\x58\xa4\x17\xcf\xf9\xff\xbc\x95\x3e\xfc\x15\xc9\x6b\x04\xa9\x38\x0f\x47\x38\xf2\x3b\x1e\x85\xd1\xa9\x24\xfc\x60\xc3\x1f\x6c\xf8\x5d\xd8\xf0\x49\xb8\x7d\xc2\xfc\x9b\x06\x6e\x3c\x67\xdf\x74\xe8\xf4\xcf\xee\xf8\x80\xce\x0b\xdd\x11\x3d\x92\x43\xbc\x84\x65\x9d\xe8\x23\x14\xe0\xaf\x3f\x4d\x67\x0e\xac\xce\x7e\x1b\x1d\xc7\x3b\xf6\x1b\x53\x41\x69\x71\xb4\xc2\x7f\xfd\xdd\x4f\x49\x06\x9c\x5d\x81\x96\x6a\x05\xe7\x6f\x3d\xd0\xb8\x9f\xc2\xb6\xa9\x3b\xa4\x47\x1d\x87\xdb\xb9\x75\x3e\x70\xe1\x70\x44\x19\xde\x21\x26\xaa\x6f\xf5\xec\xec\x48\x95\xbf\xc0\xfc\x51\xce\xeb\x2b\x1b\x10\xd5\xc9\x9b\xd3\x24\x19\x0d\x2f\x51\xc1\xa3\x23\xa1\x61\x09\x43\x06\x4e\x08\xf5\xae\x57\x51\x6e\x8a\xa0\x26\xee\x5c\x51\x9a\x89\x6e\x3e\x08\x6e\x98\x9c\x51\xe2\x4f\x0d\xed\xd7\xb0\x41\xa2\x01\x77\xf1\x40\x09\x3d\x16\x7a\xc0\x1f\x07\xfd\x54\x74\xe0\xaa\xb2\x34\x96\xa7\xe4\x7a\x1f\xbe\xac\x34\x47\xd2\xcb\x81\xda\xba\x90\x69\xe1\x3f\xc3\xac\xfb\x27\xcb\xee\xdc\x74\x11\x17\x2f\x5a\xc3\x5f\x9f\x55\xaf\xad\x15\x7b\x6e\xc4\xeb\xdb\xe8\x4e\x18\x94\x23\x2b\xd3\x6c\xb8\x93\x58\xfb\xc6\xdb\x20\x7d\x68\xa2\xf0\x67\x2d\x4e\xba\xe3\x09\xf4\x10\xca\xc1\x54\x79\x18\x75\x98\xcc\xe1\xec\x9b\x89\x72\xa2\x4b\x63\x24\x0f\x87\xaf\x34\xcf\x8e\x1d\xfb\x73\x30\xcf\xea\xdc\x20\x60\x37\x0a\xf5\x6a\xec\xcf\x48\xfc\xd7\xc6\x9b\x0e\xa2\x1f\xe1\x0a\xc8\x56\x38\x39\x98\x87\xbb\x4f\x21\xef\x26\x42\xac\x39\x22\x05\xc6\xf5\xe0\xd8\xc8\x5d\x44\x9c\xbf\x50\xa4\x29\x96\x2d\xe4\xba\x4f\x5c\x23\x1c\x7b\x27\x3b\x44\x84\x5d\x20\xf4\x3e\x28\x72\x85\x1f\x73\xfe\xe3\x5e\x74\x94\x03\x60\xa5\x19\xe6\xbc\xf7\x71\xd8\x48\x77\x8c\x9a\x19\xf9\x2c\xf2\xcf\xe9\x23\xd6\x44\xee\x9b\x8a\x9e\x82\xe1\x18\x76\x03\x15\xbc\x79\x54\x1b\x76\xe1\xe3\x69\xa4\xb5\xe2\x43\xc0\x01\x2a\x87\xf0\xd0\x48\xe5\x82\x1f\x0f\x53\xa5\xe2\x43\xce\x6c\xf2\x56\xf6\x34\x5e\xfa\x26\xe4\x7e\x57\x52\x3a\x9a\x8f\xc7\x8c\x7d\xe8\x5f\xbc\xf9\x68\x70\xf4\x05\x36\x2e\xf1\xa5\x52\x63\x3d\xf8\xae\xdc\xb8\xd5\x7e\x8b\x3d\x71\x34\x88\xd3\xed\xe8\xa8\x7e\x64\xeb\x44\xda\x57\xf0\xaa\x33\xdb\x25\x3c\x96\xf2\xc5\xf3\xf8\x61\x79\x52\x4d\xfb\x73\x1e\x23\x3d\x24\xbf\x07\x00\x00\xff\xff\xd2\xb3\xcf\x39\x02\x18\x00\x00" func utilityTokenforwardingCdcBytes() ([]byte, error) { return bindataRead( @@ -255,7 +255,7 @@ func utilityTokenforwardingCdc() (*asset, error) { } info := bindataFileInfo{name: "utility/TokenForwarding.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x37, 0x68, 0x20, 0x8a, 0x97, 0xd3, 0x88, 0x2b, 0xd3, 0x3f, 0x30, 0x2a, 0x82, 0x9a, 0x41, 0x3d, 0x17, 0x5, 0x4c, 0x41, 0x99, 0x4e, 0x7c, 0xb4, 0xe3, 0x46, 0x3a, 0x70, 0x34, 0xec, 0x92, 0x7e}} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x53, 0x12, 0xf9, 0xb8, 0xa, 0xaa, 0xf7, 0xad, 0x56, 0xe9, 0xa0, 0xed, 0x41, 0x76, 0x14, 0xb9, 0x61, 0x2, 0xf5, 0xff, 0x62, 0x97, 0xbc, 0x4c, 0xa8, 0xc4, 0x9c, 0xe1, 0x58, 0x7d, 0xcf, 0xae}} return a, nil } diff --git a/lib/go/templates/internal/assets/assets.go b/lib/go/templates/internal/assets/assets.go index 7f6d244..9cfda9a 100644 --- a/lib/go/templates/internal/assets/assets.go +++ b/lib/go/templates/internal/assets/assets.go @@ -33,6 +33,7 @@ // switchboard/setup_royalty_account.cdc (4.831kB) // switchboard/setup_royalty_account_by_paths.cdc (4.942kB) // switchboard/transfer_tokens.cdc (1.684kB) +// tokenForwarder/change_recipient.cdc (785B) // tokenForwarder/create_forwarder.cdc (2.706kB) // tokenForwarder/scripts/is_recipient_valid.cdc (278B) // transfer_many_accounts.cdc (1.772kB) @@ -766,6 +767,26 @@ func switchboardTransfer_tokensCdc() (*asset, error) { return a, nil } +var _tokenforwarderChange_recipientCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x92\xcd\xae\x9b\x30\x10\x85\xd7\xf1\x53\x4c\x59\xa4\x90\x05\xec\xa3\xfb\xa3\xdb\xaa\xe9\xb2\x57\xd1\x55\xf7\x83\x19\x8c\x55\x62\xa3\xf1\x50\x5a\x45\x79\xf7\x8a\x9f\xb8\x24\x61\x05\xe3\xe1\xcc\x39\xdf\xb8\xd8\xed\x94\xfa\x68\x6c\x00\x61\x74\x01\xb5\x58\xef\x40\x37\xe8\x0c\x05\x90\x86\x80\x49\xdb\xce\x92\x13\xa8\x3d\x03\x82\xf8\x5f\xe4\xc6\xf7\x01\xb9\x22\x1e\xcf\x7d\xcf\x9a\x94\x78\x40\xa8\x6c\x5d\x13\x8f\xdd\xa8\xb5\xef\x9d\x28\xb5\x2b\x94\xb2\xa7\xce\xb3\x40\x72\xe8\x9d\xb1\x65\x4b\x1f\xa3\x48\x12\xcb\xdf\xfe\xe0\xa9\x7b\xa8\x4e\x9f\x87\x79\x90\x75\x26\x51\x6a\xe5\x31\x75\x34\x1c\xaf\xd6\xf6\xf0\x56\x55\x4c\x21\x64\x70\x56\x0a\x00\xa0\x63\xea\x90\x29\x0d\xd6\x38\xe2\x3d\x60\x2f\x4d\xfa\xc5\x33\xfb\xe1\x27\xb6\x3d\x65\xb0\x7d\x9b\x0d\xc6\x5f\xc6\xa7\x28\xe0\x3b\xc9\x35\x37\xd9\xdf\xc4\xa0\xb1\xc3\xd2\xb6\x56\xfe\x4e\x04\xc6\xb3\x25\x1b\x94\x64\x9d\x89\x2c\x2a\x10\x1f\x95\x5a\x92\x15\xba\x67\x30\x24\xcb\xc0\x1b\xe7\x59\x1e\xe5\x2d\x85\xdc\x90\x3c\x6d\xcf\x37\x94\xf2\xe3\x62\xe4\xf2\x92\xae\x39\xc5\xfa\x7b\x5f\xb6\x56\xbf\xa3\x34\xd9\x43\x10\x04\xa6\x69\x1f\x9a\x40\xfc\xe4\x7d\x26\xf2\x39\xfc\x5f\xe1\x8d\xe7\x58\x3d\x52\x0d\xcf\x4b\x77\x1e\xc4\x33\x1a\xca\xcb\x89\xe0\xd3\x44\xf3\x6e\x3d\xf9\x8f\xc1\x11\x67\xb0\xbd\xaf\x1f\xae\x8a\x2f\x69\xcd\xfe\xb4\x87\x62\x51\x2b\x68\x15\x27\x76\x65\x6a\xb3\xd9\xbc\xbe\x42\x87\xce\xea\x34\xf9\xea\xfb\xb6\x02\xe7\x05\xe6\xd9\x8f\x81\xfc\x70\x97\xe7\x53\xb2\x02\xb1\xce\x93\xcf\xf7\x3a\xc2\x4f\xe3\x82\xb2\xa9\xff\xa2\x2e\xea\x5f\x00\x00\x00\xff\xff\xfd\x77\x6b\x63\x11\x03\x00\x00" + +func tokenforwarderChange_recipientCdcBytes() ([]byte, error) { + return bindataRead( + _tokenforwarderChange_recipientCdc, + "tokenForwarder/change_recipient.cdc", + ) +} + +func tokenforwarderChange_recipientCdc() (*asset, error) { + bytes, err := tokenforwarderChange_recipientCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "tokenForwarder/change_recipient.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x80, 0xa6, 0x29, 0xbd, 0x62, 0x6b, 0xaf, 0x7e, 0x9b, 0xb4, 0xa5, 0xf3, 0xd2, 0x7, 0x11, 0x6d, 0x8, 0xed, 0x54, 0xe7, 0x1c, 0x3b, 0xdd, 0xce, 0xeb, 0x3a, 0x5, 0xf7, 0x4d, 0x69, 0x5a, 0x38}} + return a, nil +} + var _tokenforwarderCreate_forwarderCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x55\xdf\x6f\xdb\x36\x10\x7e\xe7\x5f\x71\xf3\x43\x67\x07\x8e\x8c\xfd\x7a\x31\x92\x06\x9d\xbb\x0c\x05\xb6\xa1\x58\xdc\xbc\xae\x67\xea\x6c\x72\x95\x49\x81\x3c\x59\x35\x8a\xfc\xef\x03\x49\x89\x96\x9c\x34\xc8\x5e\xea\x87\x20\x12\x79\x77\xdf\x7d\xdf\x77\xa7\xc5\xc5\x85\x10\x6b\xa5\x3d\xb0\x43\xe3\x51\xb2\xb6\x06\xb4\x07\x04\xa6\x7d\x5d\x21\x13\x6c\xad\x0b\x8f\x83\x73\x56\xc8\x20\x6d\x53\x95\xb0\x21\x68\x3c\x95\x82\x2d\x78\x62\x68\x6a\x40\x03\x28\xa5\x6d\x0c\x03\xdb\x10\xdc\xa2\x2b\xa1\xa4\xda\x7a\xcd\x54\x02\xdb\x4f\x64\x7c\x38\x43\x63\x59\x91\x03\x47\x92\xf4\x81\x5c\x21\xc4\xbb\x2d\xa0\x39\x5a\x43\xe0\xc9\x94\x7e\x78\x39\xd4\x71\xdf\x7b\xb8\x4d\x19\xc9\xc1\xdf\x5d\xdc\x5c\xb0\xa2\xfc\x04\xad\xae\x2a\xf8\xb7\xf1\x9c\x8b\xb3\xb2\x9e\x06\xb9\xc2\xf5\x7b\x6c\x2a\x4e\x9d\x28\xf4\xb0\x21\x32\x22\x74\x80\x3e\x1e\x3b\x92\xba\xd6\x64\x18\xd0\x94\x40\x7b\x1d\xfe\x01\x3a\x84\x37\x31\x48\x9b\x52\x4b\x64\xf2\xa2\x55\x5a\xaa\x88\xae\x2f\x18\xba\x54\x7d\xc1\xa2\x23\xb8\xc5\xe3\x1c\x74\xe8\x0f\xec\x76\x7b\x29\x15\x6a\x03\x9e\xdc\x41\x4b\x82\x16\x0d\x47\x68\x7b\x6b\x34\x5b\x07\xad\xb2\x41\x86\x2e\xa1\x36\x3b\x71\x82\xaf\x79\x0e\x9a\x41\xa2\x81\x16\x59\xaa\x04\x2b\x1e\x79\x22\x68\x15\x39\x1a\x00\x00\x89\x7b\x82\xad\xb3\xfb\x42\x88\x3b\xa6\xba\xbb\x99\xd4\x4a\x52\x79\x68\x35\xab\x14\x90\xbb\x70\x4b\x21\x7e\x28\x60\xad\x08\x6e\x1b\xb3\xd3\x9b\x8a\x60\x1d\x6f\x48\x6b\xd8\xa1\x0c\x2c\x30\xb9\x2d\x4a\x02\xaf\xa2\x1f\xb0\x72\x84\xe5\x31\xf8\xa2\xa4\xba\xb2\x47\x2a\xc1\xdb\x3d\x45\x50\xe2\xc7\x94\x0d\xeb\xba\xd2\x12\x43\x3e\x1e\xe7\xeb\xb2\x0c\xa2\x0b\xf1\x53\x0a\x1a\x28\xd2\xd9\xab\xbb\xac\xf0\x40\x80\x9d\xa0\xc1\xac\x1c\xfd\x9c\x12\x3b\x42\xa6\x52\x00\x40\x14\xd2\xb3\x75\x54\x82\x36\xa0\xd9\xc7\x27\xdc\x51\xea\x1d\xa1\x6e\x36\x95\xf6\x8a\xca\xec\x25\xf1\x73\x01\x6f\x23\x90\xc8\xe7\xc7\xd8\xfd\x6d\xd6\xa4\x90\xa5\xfc\x78\x02\x1f\x5d\x5a\xea\xed\x96\xdc\x00\xa6\xf8\xa5\x08\x9e\x05\x04\x43\x2d\xbc\x49\x2f\x97\xb0\x8a\xc8\x62\xda\xbe\x1f\x63\xdd\x1e\xab\xea\x38\x8f\x70\x59\x91\x01\xd7\x98\x54\x39\x35\xf2\x4f\x96\x26\x95\x1e\x0c\x65\x0a\xda\x11\xb3\x36\x3b\x18\x0d\x44\x90\x7e\x54\x28\x19\xf8\xcc\xe8\x85\xb8\x58\x08\xa1\xf7\xb5\x75\x0c\x93\x5e\xf0\xd8\xf1\x24\xbf\xfe\xed\x33\xee\xeb\x47\x6f\xcf\x68\x99\x3c\x9d\xe5\x4f\x62\x2c\x91\xf1\x5e\x53\xeb\x27\x42\x0c\xc0\x4f\xfb\x15\xb0\x84\x37\x65\xe9\xc8\xfb\x19\x7c\x11\xb1\xa3\xda\x51\x8d\x8e\xa6\x5e\xef\x4c\x38\xc7\x86\xd5\xf4\x57\xeb\x9c\x6d\xef\xb1\x6a\x68\x0e\xef\xbc\x6f\xe8\x2e\x49\xb9\xc2\x1a\x37\xba\xd2\x7c\x5c\x05\x55\x6c\x55\x91\x9b\xc3\xfb\x24\xec\xe9\x70\x0e\x77\x78\xa0\x2e\xfe\x83\xa9\xcf\xcf\x67\xf0\xaa\x13\x2a\xe3\x08\xbf\x8a\x18\x0e\xc1\x66\x6f\x91\x11\xae\x61\xc8\x46\xe1\xc8\xdb\xea\x40\xab\xce\x0d\xa1\xcb\x69\x78\xd7\x38\x49\xeb\x63\x4d\x4b\x30\xba\x9a\xc3\x41\x53\x9b\x1e\xc3\xdf\xab\xaf\x33\x54\xdc\xae\xef\xfb\x5a\xaf\xa7\xb3\x19\xa0\xff\x0e\x5e\x76\xfd\x26\x23\x0e\xbf\x9b\x1b\xa8\xd1\x68\x39\x9d\xac\xe2\xbc\x18\xcb\xc1\x27\xa9\x13\x08\x09\x22\xa8\x6e\x74\x28\xfb\x79\x32\x3b\x75\xbe\x58\xc0\xef\xc4\xbd\x61\x92\xad\x64\xa6\x2b\x87\xf6\x06\xdb\x50\x30\xe1\x60\x1b\xda\x11\x87\xa7\x51\xbe\x0e\x48\x3a\xaa\xb3\x09\x66\x45\x4e\xad\xc9\x17\x3b\xe2\xab\x57\x5f\x46\x9d\x17\xbd\xb7\x1f\x5e\x4f\xb3\x20\x45\x1f\xff\x1e\x59\x8d\xb1\x0f\x86\x2d\x4f\x50\xda\x07\x61\x77\x68\xee\x3f\x0a\xe7\x03\x52\xda\x7e\x98\x06\x8b\xf8\x91\x1b\xe0\xea\x12\x1e\x6d\x86\x58\xf1\x2f\x6a\xf3\xe7\x6a\x9a\xbb\x5e\x9e\x08\x98\xe5\x6c\xc9\xdf\x45\xb7\x92\x8a\x00\x6c\x7a\x75\x19\xf3\xcf\x81\xed\x12\x16\xdd\xd1\x82\x06\xae\xcb\xd9\xc7\xfd\x7e\x30\x95\x36\x9f\x22\x70\xfa\xac\x7d\x5c\x09\x27\xb9\xce\x6b\x8e\xd8\x6e\xfa\x69\x78\x11\xb1\x7f\xf4\x65\x4c\x32\x50\xd7\xfe\x53\x26\x19\xf1\x16\xb7\x73\x2f\xe2\x0a\x6b\xb8\x7e\x12\x4c\xcf\x86\x0e\x23\xfe\x9c\x09\x46\x86\x8f\xd8\x9e\x65\x6b\x74\xfd\x91\x06\x23\x08\x3d\x1b\xe7\x88\xe7\x80\xbc\x84\xff\xcd\x51\x86\x10\x77\x92\x7c\x96\x9f\x7c\xf7\xe5\x04\x9d\xdb\xf0\xac\xdc\xb7\x63\x6a\x88\x3d\x51\xb5\x88\xe7\xf2\x6b\xf6\x0d\x59\x1f\xc4\x83\xf8\x2f\x00\x00\xff\xff\x82\x60\xcb\xa0\x92\x0a\x00\x00" func tokenforwarderCreate_forwarderCdcBytes() ([]byte, error) { @@ -970,6 +991,7 @@ var _bindata = map[string]func() (*asset, error){ "switchboard/setup_royalty_account.cdc": switchboardSetup_royalty_accountCdc, "switchboard/setup_royalty_account_by_paths.cdc": switchboardSetup_royalty_account_by_pathsCdc, "switchboard/transfer_tokens.cdc": switchboardTransfer_tokensCdc, + "tokenForwarder/change_recipient.cdc": tokenforwarderChange_recipientCdc, "tokenForwarder/create_forwarder.cdc": tokenforwarderCreate_forwarderCdc, "tokenForwarder/scripts/is_recipient_valid.cdc": tokenforwarderScriptsIs_recipient_validCdc, "transfer_many_accounts.cdc": transfer_many_accountsCdc, @@ -1066,6 +1088,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ "transfer_tokens.cdc": {switchboardTransfer_tokensCdc, map[string]*bintree{}}, }}, "tokenForwarder": {nil, map[string]*bintree{ + "change_recipient.cdc": {tokenforwarderChange_recipientCdc, map[string]*bintree{}}, "create_forwarder.cdc": {tokenforwarderCreate_forwarderCdc, map[string]*bintree{}}, "scripts": {nil, map[string]*bintree{ "is_recipient_valid.cdc": {tokenforwarderScriptsIs_recipient_validCdc, map[string]*bintree{}}, diff --git a/tests/switchboard_test.cdc b/tests/switchboard_test.cdc index d80b84b..b4e4452 100644 --- a/tests/switchboard_test.cdc +++ b/tests/switchboard_test.cdc @@ -141,6 +141,13 @@ fun testUseSwitchboardWithForwarder() { ) Test.expect(txResult, Test.beSucceeded()) + txResult = executeTransaction( + "../transactions/tokenForwarder/change_recipient.cdc", + [admin.address], + recipient + ) + Test.expect(txResult, Test.beSucceeded()) + // Fail with invalid capability txResult = executeTransaction( "../transactions/switchboard/add_vault_wrapper_capability.cdc", diff --git a/transactions/tokenForwarder/change_recipient.cdc b/transactions/tokenForwarder/change_recipient.cdc new file mode 100644 index 0000000..444e2c3 --- /dev/null +++ b/transactions/tokenForwarder/change_recipient.cdc @@ -0,0 +1,25 @@ +/** + +This transaction changes the recipient for a token forwarder recource +to a different account + +*/ + +import "FungibleToken" +import "ExampleToken" +import "TokenForwarding" + +transaction(newRecipient: Address) { + + prepare(signer: auth(BorrowValue) &Account) { + + // Get the receiver capability for the account being forwarded to + let recipient = getAccount(newRecipient).capabilities.get<&{FungibleToken.Receiver}>(ExampleToken.ReceiverPublicPath) + + // Get a reference to the signer's forwarder + let forwarderRef = signer.storage.borrow(from: /storage/exampleTokenForwarder) + ?? panic("Could not borrow reference to the owner's forwarder!") + + forwarderRef.changeRecipient(recipient) + } +}