F
Flowā€¢5mo ago
Bohao

[C1.0] How to upgrade a contract interface with Resource already defined before Crescendo? šŸ§µ

[Resolved][C1.0] How to upgrade a contract interface with Resource already defined before Crescendo? šŸ§µ
4 Replies
Needle
Needleā€¢5mo ago
I've created a thread for your message. Please continue any relevant discussion in this thread. You can rename this thread using /title <new title> If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadence
Bohao
Bohaoā€¢5mo ago
if I keep the resource definination, then:
(base) > $ flow-c1 migrate stage FixesFungibleTokenInterface --network=testnet ā¬” 18.16.0 [Ā±cadence1.0 ā—ā—]

error: resource declarations cannot be nested inside contract interface declarations
--> cadence/contracts/FixesFungibleTokenInterface.cdc:198:25
|
198 | access(all) resource Vault: IVault {}
| ^^^^^

āœ˜ 74ad08095d92192a.FixesFungibleTokenInterface

Staging results: 1 contract failed to stage
(base) > $ flow-c1 migrate stage FixesFungibleTokenInterface --network=testnet ā¬” 18.16.0 [Ā±cadence1.0 ā—ā—]

error: resource declarations cannot be nested inside contract interface declarations
--> cadence/contracts/FixesFungibleTokenInterface.cdc:198:25
|
198 | access(all) resource Vault: IVault {}
| ^^^^^

āœ˜ 74ad08095d92192a.FixesFungibleTokenInterface

Staging results: 1 contract failed to stage
If I remove the resource Vault defination, then:
(base) > $ flow-c1 migrate stage FixesFungibleTokenInterface --network=testnet ā¬” 18.16.0 [Ā±cadence1.0 ā—ā—]

error: missing DeclarationKindResource declaration `Vault`
--> cadence/contracts/FixesFungibleTokenInterface.cdc:21:31
|
21 | access(all) contract interface FixesFungibleTokenInterface {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

āœ˜ 74ad08095d92192a.FixesFungibleTokenInterface

Staging results: 1 contract failed to stage
(base) > $ flow-c1 migrate stage FixesFungibleTokenInterface --network=testnet ā¬” 18.16.0 [Ā±cadence1.0 ā—ā—]

error: missing DeclarationKindResource declaration `Vault`
--> cadence/contracts/FixesFungibleTokenInterface.cdc:21:31
|
21 | access(all) contract interface FixesFungibleTokenInterface {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

āœ˜ 74ad08095d92192a.FixesFungibleTokenInterface

Staging results: 1 contract failed to stage
It seems that I cannot pass the verification, so I can only complete the stage by skipping the verification with --skip-validation. Still failed in the staging report...
Unknown User
Unknown Userā€¢5mo ago
Message Not Public
Sign In & Join Server To View
Bohao
Bohaoā€¢5mo ago
Oh, it works! Just need to directly add an interface keyword...
Want results from more Discord servers?
Add your server