-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(wallet-community)_: move community transactions to the wallet r…
…outer - new file `contracts/community-tokens/contracts.go` added to unify contracts creation - the following community related path processors added: - `CommunityBurnProcessor` - `CommunityDeployAssetsProcessor` - `CommunityDeployCollectiblesProcessor` - `CommunityDeployOwnerTokenProcessor` - `CommunityMintTokensProcessor` - `CommunityRemoteBurnProcessor` - `CommunitySetSignerPubKeyProcessor` - `SendType` extended with appropriate options - added endpoints to duplicated `communitytokens` api: - `StoreDeployedCollectibles` - `StoreDeployedOwnerToken` - `StoreDeployedAssets` - removed endpoints from duplicated `communitytokens` api: - `DeployCollectibles` - `DeployOwnerToken` - `ReTrackOwnerTokenDeploymentTransaction` - `DeployAssets` - `DeployCollectiblesEstimate` - `DeployAssetsEstimate` - `DeployOwnerTokenEstimate` - `EstimateMintTokens` - `EstimateRemoteBurn` - `EstimateBurn` - `EstimateSetSignerPubKey` - `NewOwnerTokenInstance` - `NewCommunityTokenDeployerInstance` - `NewCommunityOwnerTokenRegistryInstance` - `NewCollectiblesInstance` - `NewAssetsInstance` - `MintTokens` - `RemoteBurn` - `GetCollectiblesContractInstance` - `GetAssetContractInstance` - `Burn` - `SetSignerPubKey` - `Path` type extended with new property: - `UsedContractAddress` - an address of the contract that will be used for the transaction
- Loading branch information
1 parent
a8fabc0
commit 5c0877e
Showing
35 changed files
with
2,027 additions
and
1,511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package communitytokens | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/status-im/status-go/contracts/community-tokens/assets" | ||
"github.com/status-im/status-go/contracts/community-tokens/collectibles" | ||
communitytokendeployer "github.com/status-im/status-go/contracts/community-tokens/deployer" | ||
"github.com/status-im/status-go/contracts/community-tokens/mastertoken" | ||
"github.com/status-im/status-go/contracts/community-tokens/ownertoken" | ||
communityownertokenregistry "github.com/status-im/status-go/contracts/community-tokens/registry" | ||
"github.com/status-im/status-go/rpc" | ||
) | ||
|
||
type CommunityTokensContractMaker struct { | ||
RPCClient rpc.ClientInterface | ||
} | ||
|
||
func NewCommunityTokensContractMakerMaker(client rpc.ClientInterface) (*CommunityTokensContractMaker, error) { | ||
if client == nil { | ||
return nil, errors.New("could not initialize CommunityTokensContractMaker with an rpc client") | ||
} | ||
return &CommunityTokensContractMaker{RPCClient: client}, nil | ||
} | ||
|
||
func (c *CommunityTokensContractMaker) NewOwnerTokenInstance(chainID uint64, contractAddress common.Address, | ||
) (*ownertoken.OwnerToken, error) { | ||
backend, err := c.RPCClient.EthClient(chainID) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return ownertoken.NewOwnerToken(contractAddress, backend) | ||
} | ||
|
||
func (c *CommunityTokensContractMaker) NewMasterTokenInstance(chainID uint64, contractAddress common.Address, | ||
) (*mastertoken.MasterToken, error) { | ||
backend, err := c.RPCClient.EthClient(chainID) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return mastertoken.NewMasterToken(contractAddress, backend) | ||
} | ||
|
||
func (c *CommunityTokensContractMaker) NewCollectiblesInstance(chainID uint64, contractAddress common.Address, | ||
) (*collectibles.Collectibles, error) { | ||
backend, err := c.RPCClient.EthClient(chainID) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return collectibles.NewCollectibles(contractAddress, backend) | ||
} | ||
|
||
func (c *CommunityTokensContractMaker) NewAssetsInstance(chainID uint64, contractAddress common.Address, | ||
) (*assets.Assets, error) { | ||
backend, err := c.RPCClient.EthClient(chainID) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return assets.NewAssets(contractAddress, backend) | ||
} | ||
|
||
func (c *CommunityTokensContractMaker) NewCommunityTokenDeployerInstance(chainID uint64, contractAddress common.Address, | ||
) (*communitytokendeployer.CommunityTokenDeployer, error) { | ||
backend, err := c.RPCClient.EthClient(chainID) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return communitytokendeployer.NewCommunityTokenDeployer(contractAddress, backend) | ||
} | ||
|
||
func (c *CommunityTokensContractMaker) NewCommunityOwnerTokenRegistryInstance(chainID uint64, contractAddress common.Address) (*communityownertokenregistry.CommunityOwnerTokenRegistry, error) { | ||
backend, err := c.RPCClient.EthClient(chainID) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return communityownertokenregistry.NewCommunityOwnerTokenRegistry(contractAddress, backend) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.