mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
* import new versions of the zion contracts * bootstrap zion authz * define interface for space manager contract * instantiate spacemanager interface * load goerli and localhost * embed json * remove zion interface. Use contracts directly * split user identifiter into address and chain id * isAllowed in routing.go * remove permission.go Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
23 lines
466 B
Go
23 lines
466 B
Go
package zion
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type SpaceManagerContractAddresses struct {
|
|
Spacemanager string `json:"spaceManager"`
|
|
Usergranted string `json:"usergranted"`
|
|
Tokengranted string `json:"tokengranted"`
|
|
}
|
|
|
|
func loadSpaceManagerAddresses(byteValue []byte) (*SpaceManagerContractAddresses, error) {
|
|
var addresses SpaceManagerContractAddresses
|
|
|
|
err := json.Unmarshal(byteValue, &addresses)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &addresses, nil
|
|
}
|