Skip to content

research: gas usage for collateralizable #4

@dsshap

Description

@dsshap

the only benefit I can think of using this bitmap instead of a simple address => address => bool mapping is that it is cheaper to add data to the same storage (so setting multiple collateralizable asset1 for an asset0 will be cheaper). For reading it's not obvious why this will be cheaper because now every time you calculate isCollateralizable you need to do the bit operations instead of just reading a boolean directly.

Not sure which one is cheaper, to use a 2 layer mapping (with one more Keccak256 is 30 gas) or this bitmap.

Originally posted by @antoncoding in #2 (comment)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions