onflow / flips

Flow Improvement Proposals
26 stars 23 forks source link

Next version changes to FLIX #128

Closed bthaile closed 8 months ago

bthaile commented 1 year ago
  1. Support new import syntax: In order to be consistent across all flow tools, it would be beneficial for flix to support new import syntax. This syntax does not have a contract address placeholder in the cadence code. It uses import "ContractName" which is interpreted by flow tools. The change needed is in the "dependencies" section, the contract address placeholder isn't needed. See below:

Pervious version:

dependencies: {
      "0xFUNGIBLETOKENADDRESS": { // Network (mainnet || testnet) dependent locations for 0xFUNGIBLETOKENADDRESS contract.
          "FungibleToken" : {
              mainnet: {
                  address: "0xf233dcee88fe0abe", // Address of the account the contract is located.
                  fq_address: "A.0xf233dcee88fe0abe.FungibleToken", // Fully qualified contract identifier.
                  pin: "asdfasdfasdfasdfasdfasdfsadf123123123123", // Unique identifier of the interactions dependency tree.
                  pin_block_height: 10123123123 // Block height the pin was generated against.
              },
              testnet: {
                  address: "0x9a0766d93b6608b7",
                  fq_address: "A.0x9a0766d93b6608b7.FungibleToken",
                  pin: "asdfasdfasdfasdfasdfasdfsadf123123123123",
                  pin_block_height: 10123123123
              }
          }
      }
  },

New version:

dependencies: {
    "FungibleToken" : {
        mainnet: {
            address: "0xf233dcee88fe0abe", // Address of the account the contract is located.
            fq_address: "A.0xf233dcee88fe0abe.FungibleToken", // Fully qualified contract identifier.
            pin: "asdfasdfasdfasdfasdfasdfsadf123123123123", // Unique identifier of the interactions dependency tree.
            pin_block_height: 10123123123 // Block height the pin was generated against.
        },
        testnet: {
            address: "0x9a0766d93b6608b7",
            fq_address: "A.0x9a0766d93b6608b7.FungibleToken",
            pin: "asdfasdfasdfasdfasdfasdfsadf123123123123",
            pin_block_height: 10123123123
        }
    }
},
JeffreyDoyle commented 1 year ago

@bthaile Can you please leave this as a comment to https://github.com/onflow/flips/pull/77 and make a PR to add these updates to the FLIP in the branch flips/interaction-template-1.1.0 so it gets included in that FLIP update? We'll need to update tools such as FLIX CLI (https://github.com/onflow/flow-interaction-template-tools) and FCL's Interaction Template Tools (https://github.com/onflow/fcl-js/tree/master/packages/fcl/src/interaction-template-utils) accordingly to accommodate this change.

bthaile commented 8 months ago

closing was addressed in FLIX 1.1.0

KshitijChaudhary666 commented 3 months ago

@bthaile - is this accepted and/ or implemented? Could you mark it as such please on this project tracker?