Netmap contract contains cleanup() that calls newEpoch in some other contracts, but:
the list can be extended in the future
we don't care what these contracts are (container, balance, subnet, whatever)
these contracts are passed via parameters during deploy which is not convenient
What we can do instead is:
expose registerNewEpochCallback(addr util.Uint160) from the netmap contract, this will just walk through the list of registered contracts and call newEpoch for each of them
deploy netmap contract first
call registerNewEpochCallback in the _deploy of contracts that need it, these contracts are to deployed after the netmap
Netmap contract contains
cleanup()
that callsnewEpoch
in some other contracts, but:What we can do instead is:
registerNewEpochCallback(addr util.Uint160)
from the netmap contract, this will just walk through the list of registered contracts and callnewEpoch
for each of themregisterNewEpochCallback
in the_deploy
of contracts that need it, these contracts are to deployed after the netmap