This Truffle box comes with everything you need to deploy your own Snowflake periodic subscrition Resolver.
Snowflake is an on-chain identity framework built on ERC-1484 offering powerful tools to developers building dApps on top of it. The docs for Snowflake are available on GitBook.
SnowflakeResolver
is a contract which all Resolvers must inherit from; it ensures that Resolvers are compatible with the Snowflake smart contract. It's essentially a parent class that defines a few helpful variables and functions!
The easiest way is to override the setSnowflakeAddress
function of SnowflakeResolver
. This allows you to declare variables such as SnowflakeInterface snowflake;
and initialize them like so snowflake = SnowflakeInterface(snowflakeAddress);
Assuming you have the proper allowance, call snowflake.transferSnowflakeBalanceFrom(einFrom, einTo, amount)
. To use a via, simply call snowflake.transferSnowflakeBalanceFromVia(einFrom, via, einTo, amount)
.
Assuming you have the proper allowance, call snowflake.withdrawSnowflakeBalanceFrom(einFrom, to, amount)
. To use a via, simply call snowflake.withdrawSnowflakeBalanceFromVia(einFrom, via, einTo, amount)
.
First, ensure that you have properly escrowed funds using withdrawSnowflakeBalanceFrom
. Then, call snowflake.transferHydroBalanceTo(to, amount)
or snowflake.transferHydroBalanceToVia(to, via, amount, _bytes)
.
First, ensure that you have properly escrowed funds using withdrawSnowflakeBalanceFrom
. Then, call snowflake.withdrawHydroBalanceTo(to, amount)
or snowflake.withdrawHydroBalanceToVia(to, via, amount, _bytes)
.
Simply use hex""
to pass an empty argument.
Deployed by vendor, manages list of subscribers
Identified by their EIN, each has a list of subscriptions
Manages Subscriber subscription to an individual service provided by vendor, no restriction on how many times a use can subscribe to a single service, or have a single subscription to handle a quantity of more than 1 "units" of provided product Each subscription holds info like when subscription started etc. and delegates cost calculation to a list of "Plans"
Plan is a contract that uses subscriber and subscrption data to calculate the cost, Plans; and plan addons, same here; examples are "1000 hydro monthly for a website hosting" "10 000 hydro annually for wordpress hosting avaialble only to subscriber wiht qty more than a specifc amount, etc." "10% discount on subscription for one time avialble to EINs only from Russia" "500 hydro gift card usable 3 times, and transferable between users" "tiered plan" "prorating " etc. A subscriber has to be authorized to subscribe to a plan and add it to a subscription list, but can unsubscribe from such plans at his own will.
Is responsible on how to execute plan lists,current default impl just calls them in order and returns the value of the last plan "collect" invokation
if collection fails, e.g; not enough credit still invoking collect method on plan would count as used once, not a little modification on invokation to roll back in case of failure