mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-17 02:53:11 -06:00
Temporary flag to implement v2 smart contract integration. Once v2 is done, will remove this flag.
38 lines
791 B
Go
38 lines
791 B
Go
package zion
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type SpaceManagerContractAddresses struct {
|
|
Spacemanager string `json:"spaceManager"`
|
|
Usergranted string `json:"usergranted"`
|
|
Tokengranted string `json:"tokengranted"`
|
|
}
|
|
|
|
type SpaceFactoryContractAddress struct {
|
|
SpaceFactory string `json:"spaceFactory"`
|
|
}
|
|
|
|
func loadSpaceManagerAddresses(byteValue []byte) (*SpaceManagerContractAddresses, error) {
|
|
var addresses SpaceManagerContractAddresses
|
|
|
|
err := json.Unmarshal(byteValue, &addresses)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &addresses, nil
|
|
}
|
|
|
|
func loadSpaceFactoryAddress(byteValue []byte) (*SpaceFactoryContractAddress, error) {
|
|
var address SpaceFactoryContractAddress
|
|
|
|
err := json.Unmarshal(byteValue, &address)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &address, nil
|
|
}
|