Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (capi *census3API) createToken(msg *api.APIdata, ctx *httprouter.HTTPContex
tokenType := providers.TokenTypeID(req.Type)
provider, err := capi.holderProviders.GetProvider(internalCtx, tokenType)
if err != nil {
return ErrCantCreateCensus.WithErr(fmt.Errorf("token type not supported: %w", err))
return ErrMalformedToken.WithErr(fmt.Errorf("token type not supported: %w", err))
}
if !provider.IsExternal() {
if err := provider.SetRef(web3.Web3ProviderRef{
Expand Down Expand Up @@ -285,7 +285,7 @@ func (capi *census3API) createToken(msg *api.APIdata, ctx *httprouter.HTTPContex
// init db transaction
tx, err := capi.db.RW.BeginTx(internalCtx, nil)
if err != nil {
return ErrCantCreateStrategy.WithErr(err)
return ErrCantCreateToken.WithErr(err)
}
defer func() {
if err := tx.Rollback(); err != nil && !errors.Is(err, sql.ErrTxDone) {
Expand Down
1 change: 1 addition & 0 deletions cmd/census3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func main() {
pm.AddProvider(new(web3provider.ERC20HolderProvider).Type(), web3ProviderConf)
pm.AddProvider(new(web3provider.ERC721HolderProvider).Type(), web3ProviderConf)
pm.AddProvider(new(web3provider.ERC777HolderProvider).Type(), web3ProviderConf)
pm.AddProvider(new(web3provider.ERC1155HolderProvider).Type(), web3ProviderConf)
// init POAP external provider
if config.poapAPIEndpoint != "" {
pm.AddProvider(new(poap.POAPHolderProvider).Type(), poap.POAPConfig{
Expand Down
10 changes: 8 additions & 2 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,15 @@ func main() {
return
}
fmt.Print("Enter Start Block: ")
fmt.Scanln(&startBlock)
if _, err := fmt.Scanln(&startBlock); err != nil {
color.Red("Invalid start block: %v", err)
return
}
fmt.Print("Enter Tags (comma-separated): ")
fmt.Scanln(&tags)
if _, err := fmt.Scanln(&tags); err != nil {
color.Red("Invalid tags: %v", err)
return
}

chainIDUint, err := strconv.ParseUint(chainID, 10, 64)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion contracts/bindContract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abi() {

abi './erc/erc20/ERC20.abi' ERC20Contract './erc/erc20/erc20.go'
abi './erc/erc721/ERC721.abi' ERC721Contract './erc/erc721/erc721.go'
# abi './erc/erc1155/ERC1155.abi' ERC1155Contract './erc/erc1155/erc1155.go'
abi './erc/erc1155/ERC1155.abi' ERC1155Contract './erc/erc1155/erc1155.go'
abi './erc/erc777/ERC777.abi' ERC777Contract './erc/erc777/erc777.go'

# abi './nation3/vestedToken/veNation.abi' Nation3VestedTokenContract './nation3/vestedToken/veNation.go'
Expand Down
340 changes: 340 additions & 0 deletions contracts/erc/erc1155/ERC1155.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,340 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "ApprovalForAll",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256[]",
"name": "ids",
"type": "uint256[]"
},
{
"indexed": false,
"internalType": "uint256[]",
"name": "values",
"type": "uint256[]"
}
],
"name": "TransferBatch",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "TransferSingle",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "string",
"name": "value",
"type": "string"
},
{
"indexed": true,
"internalType": "uint256",
"name": "id",
"type": "uint256"
}
],
"name": "URI",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "accounts",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "ids",
"type": "uint256[]"
}
],
"name": "balanceOfBatch",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "ids",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "safeBatchTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
}
],
"name": "uri",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]
Loading