Add new LinearCodeAddressGenerator contract#467
Conversation
sisyphusSmiling
left a comment
There was a problem hiding this comment.
Left a couple clarifying questions. My main question is whether index needs to be tracked in contract or some struct's state or if that's relegated to some lower-level state.
|
Approved but CI failing. Looks like the go assets need to be updated as well. |
|
I'm back from time off and looking at this today |
|
Nit: I think address(index: 0) should fail |
right thanks @bluesign. |
tarakby
left a comment
There was a problem hiding this comment.
Sweet! Thank you @turbolent, feel free to merge
|
okay. Can you add a little blurb about it in the README with intended import addresses also like there is for other contracts? Once that is added, I'm okay with you merging it |
|
@joshuahannan Added the contract to the README. I don't know where the code will be deployed, we can add a table once it is. I initially ported the code assuming it would be needed for some migration code in flow-go, but we don't need it anymore. Even though we don't need it for that purpose, I feel like the functionality is still useful. Maybe it can be deployed to the service account? WDYT? |
|
yeah, I think the service account makes sense. I'm fine with merging this and deploying it on testnet as soon as you think it is ready. |
|
@joshuahannan It's ready from my side. It would be nice to merge and close this PR, as it's been open for a while. |
joshuahannan
left a comment
There was a problem hiding this comment.
Where is this code used? Does it need to be deployed to flow-go bootstrapping? If so, we should create a getter for it in the lib/go/contracts package. I can do that if needed
The code is not used anywhere. As I mentioned above, I had originally created it / ported it from the Go code for the migration of on-the-fly account storage format in flow-go, but we did not end up needing it after all. I still think it is useful to have the logic available on-chain, as a system contract that can be trusted. |
|
Sounds like it probably should be included then so we can deploy it as part of flow-go bootstrapping and probably deploy it to testnet and mainnet. I'll add that |
Port the linear code address generator from https://github.com/onflow/flow-go/blob/master/model/flow/address.go to Cadence.
We'll likely need this for the migration code of onflow/cadence#3584, which will be implemented as a Cadence contract.