-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify storage of contract source code #61
base: contract-source-code
Are you sure you want to change the base?
Conversation
f524f74
to
922f89b
Compare
922f89b
to
3ee39ce
Compare
Here is the code for the contract to track source-code of old contracts: (replace SCV) state.var {
registry = state.map(),
owner = state.value()
}
function set_code(address, source_code)
assert(system.getSender() == owner:get(), "permission denied")
registry[address] = source_code
end
function get_code(address)
return registry[address]
end
function set_owner(address)
assert(system.getSender() == owner:get(), "permission denied")
owner:set(address)
end
function constructor()
owner:set(system.getCreator())
end
abi.register(set_code, set_owner)
abi.register_view(get_code) |
func ConvContractFromCall(txDoc *EsTx, contractAddress []byte, creator, sourceCode, deployArgs string) *EsContract { | ||
byteCode, abi, err := CompileSourceCode(sourceCode) | ||
if err != nil { | ||
panic(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to invoke panic here? Does any caller catches the panic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. The idea is to make the app to close
What would be the alternative? Maybe retry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither do I. You know much more than me about indexer. If panic is propagated to top level of call stack, the process will be terminated. I don't know this is expected behavior or not of indexer.
Removes the
CodeUrl
field from the "contract" document.The
VerifiedToken
field should contain the token symbolNo longer uses the
SCAN_CONTRACT_VERIFIED (SCV)
. It must be replaced by a simpler version, no NFT based.