oceanprotocol / ocean-subgraph

🦀 Ocean Protocol Subgraph
Apache License 2.0
19 stars 15 forks source link

ProviderFees #471

Closed alexcos20 closed 2 years ago

alexcos20 commented 2 years ago

Add providerFees to orders (equivalent of startOrder) and reuse orders

mihaisc commented 2 years ago

It will be stored as a simple string. The client will convert to json as needed

LoznianuAnamaria commented 2 years ago

@bogdanfazakas Are the provider fees integrated on market/ocean.js?

soonhuat commented 2 years ago

@mihaisc wonder if providerFee will be part of Order entity or also part of OrderReuse entity?

mihaisc commented 2 years ago

I think both

jamiehewitt15 commented 2 years ago

It will be stored as a simple string. The client will convert to json as needed

Within OPC, providerFee is stored as BigDecimal - are you sure you don't want it to be the same?

soonhuat commented 2 years ago

@jamiehewitt15 if I were right, the providerFee actually is not the cost in numeric, is the whole ProviderFee object index as string https://github.com/oceanprotocol/contracts/blob/e3d75c901aa66c8cfc1ac69b1a339d1356a9f383/contracts/templates/ERC20TemplateEnterprise.sol#L68 OR this event structure https://github.com/oceanprotocol/contracts/blob/e3d75c901aa66c8cfc1ac69b1a339d1356a9f383/contracts/templates/ERC20TemplateEnterprise.sol#L135

jamiehewitt15 commented 2 years ago

@jamiehewitt15 if I were right, the providerFee actually is not the cost in numeric, is the whole ProviderFee object index as string

Yeah, that's true 👍

mihaisc commented 2 years ago

Yep, exactly what @soonhuat said, thanks

alexcos20 commented 2 years ago

We need to store all values from providerFee event: https://github.com/oceanprotocol/contracts/blob/v4main/contracts/templates/ERC20Template.sol#L133-L142