You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accessing plugins
In order to access the plugins inside the contract, we can do:
SmartWeave.plugins[plugin_name]();
where SmartWeave is the global that all contract has, with a new object, which is call plugins, and contains the functions we passed in our object
SmartWeave.plugins['helloWorld']();
Security Flaws
A contract can override, or modify the plugins object. For this reason, this object should be frozen, and all its properties should also be frozen. A deep Object.freeze if you may.
Hey there, this is Andres from Verto.exchange.
Overview:
Plugins are a way to introduced custom Javascript functions to the execution of smart weave contracts.
Details:
Plugins should be passed in a static call to a setter, for example:
Or they can be passed in the
readContract
function.Accessing plugins
In order to access the plugins inside the contract, we can do:
where SmartWeave is the global that all contract has, with a new object, which is call
plugins
, and contains the functions we passed in our objectSecurity Flaws
A contract can override, or modify the
plugins
object. For this reason, this object should be frozen, and all its properties should also be frozen. A deepObject.freeze
if you may.@t8
The text was updated successfully, but these errors were encountered: