ConsenSysDiligence / ConsenSysDiligence/scribble

sum from mapping of structs?

Open
#144 6 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
TypeScript
Stars
334
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Is it possible to achieve something like this?

```solidity
contract Vault {
struct Account {
uint256 id;
uint256 shares;
}

mapping(address => Account) accounts;
uint256 totalShares;

/// #invariant unchecked_sum(accounts.shares) == totalShares;
function deposit() {
/// ...
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.