2022-01-23 18:21:23 -07:00
|
|
|
--- Create token.
|
|
|
|
|
-- Depends on tokenomics
|
2021-12-26 23:03:57 -07:00
|
|
|
-- @module create_token
|
|
|
|
|
|
|
|
|
|
local create_token = {
|
2022-08-09 17:00:24 -06:00
|
|
|
name = "Create a token",
|
2021-12-26 23:03:57 -07:00
|
|
|
slug = "create_token",
|
2022-08-09 17:00:24 -06:00
|
|
|
desc = "Creates an org token",
|
2021-12-26 23:03:57 -07:00
|
|
|
hide = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
create_token.data = {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
create_token.config = {
|
2022-08-09 17:00:24 -06:00
|
|
|
token_name = "token",
|
|
|
|
|
approval_module = false
|
2021-12-26 23:03:57 -07:00
|
|
|
}
|
|
|
|
|
|
2022-01-23 18:21:23 -07:00
|
|
|
--- Initiate function
|
|
|
|
|
-- @function create_toke:initiate
|
|
|
|
|
-- @param result Callback if this module is embedded in other modules
|
2021-12-26 23:03:57 -07:00
|
|
|
function create_token:initiate(result)
|
|
|
|
|
modpol.interactions.text_query(
|
|
|
|
|
self.initiator,
|
|
|
|
|
"Token name (alpha-numeric, no spaces):",
|
|
|
|
|
function(input)
|
|
|
|
|
self.config.token_name = input
|
2022-01-07 15:05:45 -05:00
|
|
|
self:call_module(
|
2021-12-26 23:03:57 -07:00
|
|
|
"tokenomics",
|
|
|
|
|
self.initiator,
|
|
|
|
|
{
|
2022-08-09 17:00:24 -06:00
|
|
|
approval_module = self.config.approval_module,
|
2021-12-26 23:03:57 -07:00
|
|
|
token_slug = self.config.token_name
|
|
|
|
|
},
|
|
|
|
|
function(input2)
|
|
|
|
|
modpol.interactions.org_dashboard(
|
|
|
|
|
self.initiator, self.org.name)
|
|
|
|
|
if result then result() end
|
|
|
|
|
-- call this wherever process might end:
|
|
|
|
|
self.org:delete_process(self.id)
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
modpol.interactions.org_dashboard(
|
|
|
|
|
self.initiator, self.org.name)
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
modpol.modules.create_token = create_token
|