Skip to content

FAQ on using Smart Contract for client allocations

martapiekarska edited this page Jun 5, 2025 · 2 revisions

FAQ: Using the Smart Contract Method to Allocate DataCap

1. What is the Client Smart Contract?

It’s a tool that lets allocators manage how much DataCap a client can use, where they can send it, and reclaim what’s unused. Unlike sending tokens to a wallet, it keeps DataCap in a controlled system, making it easier to track, enforce rules, and make changes when needed.


2. Why should allocators use the smart contract?

  • More control: You can update or revoke unused DataCap at any time.
  • Better compliance: Clients can only send DataCap to pre-approved storage providers.
  • Transparent tracking: You can see exactly how much each client has used and where it went.
  • Safer: Reduces the risk of accidental loss or misuse of tokens.

All of this is managed through a simple interface—no need to write smart contract code.


3. How do I start using the smart contract method?

When you receive a new client application allocator.tech, choose “Allocation Type: Contract.”
After that:

  1. You’ll send the DataCap to the smart contract, not directly to the client.
  2. You’ll increase the client’s available allowance using a simple form.

That’s it—the client is now set up to use DataCap through their smart contract.


4. Can an allocator still use the direct allocation method?

Yes. You can still choose to send DataCap directly to a client’s wallet. But remember:

  • You won’t be able to revoke or update it.
  • There’s no way to restrict how or where it’s used.
  • Generally for compliance reasons this is highly discouraged and may delay the audit and refresh

We recommend the smart contract method for better safety, flexibility, and oversight.


5. How do I control which Storage Providers the client can use?

You will have to enter the SP details when you make the allocation in “Allowed Storage Providers.”
You can:

  • Add or remove specific providers.
  • Set rules like maximum share one provider can receive.

This makes sure your client spreads out storage as expected.


6. How do I update or remove a client’s DataCap?

At any time, you can:

  • Increase Allowance to give them more.
  • Decrease Allowance to take back unused tokens.
  • Revoke Access to fully stop further use.

These changes take effect immediately and are done through the website.


7. What happens if a client doesn’t use all their DataCap?

It stays in their contract-based allowance—not in their wallet.
You can reclaim it at any time using “Decrease Allowance.”
That way, you can reassign it to another client instead of letting it go unused.


8. Can I still switch a client from direct to smart contract method?

Not directly—but you can:

  1. Ask the client to return any unused tokens.
  2. Create a new contract-based client entry.
  3. Reassign their allowance through the new method going forward.

9. What should I do after I allocate DataCap to a client?

Once you’ve used the smart contract method to allocate DataCap:

  1. Go to the GitHub issue associated with the client’s application.
  2. Find the contract address:
    • Go to the Allocator JSON files.
    • Locate your allocator's JSON file.
    • Open the file and copy the value from the client_contract_address field for that client.
  3. Leave a comment on the GitHub issue with the following:
    • Inform the client that their allocation is now handled via a Client Smart Contract.
    • Include the contract address so they can interact with it.

✅ This helps the client understand how to use their DataCap and keeps everything transparent.


10. Where can I ask questions or report issues?

We’re here to help! Reach out via:

11. How to onboard data using DDO deals?

  1. First, you need to initialise a new Boost client and also set the endpoint for a public Filecoin node. In this example we are using https://glif.io

    export FULLNODE_API_INFO=https://api.node.glif.io
    
    boost init
    
  2. The init command will output your new wallet address, and warn you that the market actor is not initialised.

    boost init
    
    boost/init_cmd.go:53    default wallet set      {"wallet": "f3wfbcudimjcqtfztfhoskgls5gmkfx3kb2ubpycgo7a2ru77temduoj2ottwzlxbrbzm4jycrtu45deawbluq"}
    boost/init_cmd.go:60    wallet balance  {"value": "0"}
    boost/init_cmd.go:65    market actor is not initialised, you must add funds to it in order to send online deals
    
  3. Now, you need to send some funds and Datacap to the wallet.

  4. You can confirm that the market actor has funds and Datacap by running boost wallet list.

    After that you need to generate a car file for data you want to store on Filecoin, and note down its payload-cid. We recommend using go-car CLI to generate the car file.

    boostx generate-rand-car -c=50 -l=$links -s=5120000 .
    Payload CID: bafykbzacedr7avw5yvxgjftkhfgzgbinq523csw3ir5hyukx2ulewaigyjdrm, written to: <$CWD>/bafykbzacedr7avw5yvxgjftkhfgzgbinq523csw3ir5hyukx2ulewaigyjdrm.car
    
  5. Then you need to calculate the commp and piece size for the generated car file:

    boostx generate-rand-car -c=50 -l=$links -s=5120000

    boostx commp bafykbzacedr7avw5yvxgjftkhfgzgbinq523csw3ir5hyukx2ulewaigyjdrm.car
    
    CommP CID:  baga6ea4seaqjpldhlgodxw2vjj6g46xra7jthe2g37kt7577ep5euxipkupfsly
    Piece size:  8388608
    Car file size:  7657847
    
  6. Create a new verified allocation for this piece using the boost client. You can use other methods to create allocations as long as the piece details match the generated commP. If you received DataCap via a Client Smart Contract, be sure to include the --evm-client-contract option, and provide the proper value when creating the allocation. To check the address of the contract assigned to you, first check the associated GitHub issue. The address should be provided as a comment in the issue by the allocator. If the address is not available there, go to your allocator's bookkeeping repo. In the Applications folder, find the JSON file of your application by your address, and check the value of the Client Contract Address field.

    boost allocate 
    --evm-client-contract f410foc6psy3k7a2fb37tb2tslxj2hvzuj5ymcku7xia --miner=t01013 --piece-info=baga6ea4seaqjpldhlgodxw2vjj6g46xra7jthe2g37kt7577ep5euxipkupfsly=8388608 --wallet t3tejq3lb3szsq7spvttqohsfpsju2jof2dbive2qujgz2idqaj2etuolzgbmro3owsmpuebmoghwxgt6ricvq
    
    about to send message with the following gas costs
    max fee:      0.00000000512550864 FIL (absolute maximum amount you are willing to pay to get your transaction confirmed)
    gas fee cap:  0.00000000000000012 FIL
    gas limit:    42712572
    gas premium:  0.000000000000000023 FIL
    basefee:      0.0000000000000001 FIL
    
    Proceed? Yes [y] / No [n]:
    y
    2024-03-11T18:11:59.794Z	INFO	boost	boost/direct_deal.go:112	submitted data cap allocation message	{"cid": "bafy2bzacecyxmx4uyuqfy6xdnlaba2aamlghcujt2asvqmkz6trilnttcouoi"}
    2024-03-11T18:11:59.794Z	INFO	boost	boost/direct_deal.go:113	waiting for message to be included in a block
    
    AllocationID  Client  Miner  PieceCid                                                          PieceSize  TermMin  TermMax Expiration  
    31825         1011    1013   baga6ea4seaqjpldhlgodxw2vjj6g46xra7jthe2g37kt7577ep5euxipkupfsly  8388608    518400   5256000  1601277
    
  7. Import the piece for the newly create allocation using boostd. Remember that --client-addr must be equal to the address of the Client Smart Contract.

    boostd import-direct --client-addr=f410foc6psy3k7a2fb37tb2tslxj2hvzuj5ymcku7xia --allocation-id=31825 baga6ea4seaqjpldhlgodxw2vjj6g46xra7jthe2g37kt7577ep5euxipkupfsly ~/bafykbzacedr7avw5yvxgjftkhfgzgbinq523csw3ir5hyukx2ulewaigyjdrm.car
    
    Direct data import scheduled for execution
    
  8. Watch the boostd UI to verify that the new DDO deal reaches "Complete" and "Claim Verified" state.

##13. What would a client need to do to use DC? Create a new verified allocation for this piece using the boost client. You can use other methods to create allocations as long as the piece details match the generated commP. If you received DataCap via a Client Smart Contract, be sure to include the --evm-client-contract option, and provide the proper value when creating the allocation. To check the address of the contract assigned to you, first check the associated GitHub issue. The address should be provided as a comment in the issue by the allocator. If the address is not available there, go to your allocator's bookkeeping repo. In the Applications folder, find the JSON file of your application by your address, and check the value of the Client Contract Address field. ``` boost allocate --evm-client-contract f410foc6psy3k7a2fb37tb2tslxj2hvzuj5ymcku7xia --miner=t01013 --piece-info=baga6ea4seaqjpldhlgodxw2vjj6g46xra7jthe2g37kt7577ep5euxipkupfsly=8388608 --wallet t3tejq3lb3szsq7spvttqohsfpsju2jof2dbive2qujgz2idqaj2etuolzgbmro3owsmpuebmoghwxgt6ricvq

about to send message with the following gas costs
max fee:      0.00000000512550864 FIL (absolute maximum amount you are willing to pay to get your transaction confirmed)
gas fee cap:  0.00000000000000012 FIL
gas limit:    42712572
gas premium:  0.000000000000000023 FIL
basefee:      0.0000000000000001 FIL

Proceed? Yes [y] / No [n]:
y
2024-03-11T18:11:59.794Z	INFO	boost	boost/direct_deal.go:112	submitted data cap allocation message	{"cid": "bafy2bzacecyxmx4uyuqfy6xdnlaba2aamlghcujt2asvqmkz6trilnttcouoi"}
2024-03-11T18:11:59.794Z	INFO	boost	boost/direct_deal.go:113	waiting for message to be included in a block

AllocationID  Client  Miner  PieceCid                                                          PieceSize  TermMin  TermMax Expiration  
31825         1011    1013   baga6ea4seaqjpldhlgodxw2vjj6g46xra7jthe2g37kt7577ep5euxipkupfsly  8388608    518400   5256000  1601277
```
Clone this wiki locally