Documentation ¶
Overview ¶
* Copyright 2017 Primas Lab Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func GetAllContracts() map[string]*Contract
- func InitContracts() error
- type AddMemberLogArgs
- type CommentLogArgs
- type Content
- type ContentContract
- func (contentContract *ContentContract) Comment(comment *models.ArticleComment) error
- func (contentContract *ContentContract) Like(like *models.ArticleLike) error
- func (contentContract *ContentContract) Publish(content Content) error
- func (contentContract *ContentContract) Share(share *models.ArticleShareBatch) error
- type Contract
- func (contract *Contract) Execute(method string, args ...interface{}) (string, error)
- func (contract *Contract) GetEthClient() (*ethclient.Client, error)
- func (contract *Contract) GetEventNameByTopicHash(hash string) (string, error)
- func (contract *Contract) InitABI(ABIJson string) error
- func (contract *Contract) InitEventNameHashMap()
- type CreateLogArgs
- type GroupContract
- func (groupContract *GroupContract) AddMember(member *models.GroupMember) error
- func (groupContract *GroupContract) Create(group *models.Group) error
- func (groupContract *GroupContract) HandleEvent(eventLog *types.Log, db *gorm.DB) error
- func (groupContract *GroupContract) RemoveMember(member *models.GroupMember) error
- func (groupContract *GroupContract) RemoveMemberByOwner(member *models.GroupMember, ownerAddress string) error
- type IncentiveContract
- type LikeLogArgs
- type MetadataContract
- type PublishLogArgs
- type RemoveMemberByOwnerLogArgs
- type RemoveMemberLogArgs
- type ShareLogArgs
- type TokenContract
- type TokenLockArgs
- type UserContract
- type UserTokenBurnArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllContracts ¶
func InitContracts ¶
func InitContracts() error
Types ¶
type AddMemberLogArgs ¶
type CommentLogArgs ¶
type ContentContract ¶
type ContentContract struct {
Contract *Contract
}
func GetContentContract ¶
func GetContentContract() (*ContentContract, error)
func (*ContentContract) Comment ¶
func (contentContract *ContentContract) Comment(comment *models.ArticleComment) error
func (*ContentContract) Like ¶
func (contentContract *ContentContract) Like(like *models.ArticleLike) error
func (*ContentContract) Publish ¶
func (contentContract *ContentContract) Publish(content Content) error
func (*ContentContract) Share ¶
func (contentContract *ContentContract) Share(share *models.ArticleShareBatch) error
type Contract ¶
type Contract struct { Address common.Address ABI abi.ABI // contains filtered or unexported fields }
func GetContractByName ¶
func NewContract ¶
func (*Contract) GetEventNameByTopicHash ¶
func (*Contract) InitEventNameHashMap ¶
func (contract *Contract) InitEventNameHashMap()
type CreateLogArgs ¶
type GroupContract ¶
type GroupContract struct {
Contract *Contract
}
func GetGroupContract ¶
func GetGroupContract() (*GroupContract, error)
func (*GroupContract) AddMember ¶
func (groupContract *GroupContract) AddMember(member *models.GroupMember) error
func (*GroupContract) Create ¶
func (groupContract *GroupContract) Create(group *models.Group) error
func (*GroupContract) HandleEvent ¶
func (*GroupContract) RemoveMember ¶
func (groupContract *GroupContract) RemoveMember(member *models.GroupMember) error
func (*GroupContract) RemoveMemberByOwner ¶
func (groupContract *GroupContract) RemoveMemberByOwner(member *models.GroupMember, ownerAddress string) error
type IncentiveContract ¶
type IncentiveContract struct {
Contract *Contract
}
func GetIncentiveContract ¶
func GetIncentiveContract() (*IncentiveContract, error)
func (*IncentiveContract) AssignIncentives ¶
func (incentiveContract *IncentiveContract) AssignIncentives(db *gorm.DB) error
func (*IncentiveContract) Distribute ¶
func (incentiveContract *IncentiveContract) Distribute(incentives map[string]*big.Int) error
type LikeLogArgs ¶
type MetadataContract ¶
type MetadataContract struct {
Contract *Contract
}
func GetMetadataContract ¶
func GetMetadataContract() (*MetadataContract, error)
func (*MetadataContract) HandleEvent ¶
type PublishLogArgs ¶
type RemoveMemberLogArgs ¶
type ShareLogArgs ¶
type ShareLogArgs struct {}
type TokenContract ¶
type TokenContract struct {
Contract *Contract
}
func GetTokenContract ¶
func GetTokenContract() (*TokenContract, error)
func (*TokenContract) HandleEvent ¶
func (*TokenContract) Inflate ¶
func (tokenContract *TokenContract) Inflate() error
type TokenLockArgs ¶
type UserContract ¶
type UserContract struct {
Contract *Contract
}
func GetUserContract ¶
func GetUserContract() (*UserContract, error)
func (*UserContract) Burn ¶
func (userContract *UserContract) Burn(timestamp, userAddress, signature string) error
func (*UserContract) HandleEvent ¶
Click to show internal directories.
Click to hide internal directories.