Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROTOCOL-NG] Solidity Semantic Money draft release 1 #1280

Merged
merged 184 commits into from
May 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
82924ad
semantic money
hellwolf Feb 9, 2023
788b2dd
solidity-semantic-money bootstrapped
hellwolf Feb 9, 2023
71a0ef0
delete hie stuff
hellwolf Feb 9, 2023
a85252b
add minimumEVMDevInputs for spec buildInputs
hellwolf Feb 9, 2023
150fa20
flow2 implemented
hellwolf Feb 9, 2023
fda46ab
fix github workflow for spec-haskell
hellwolf Feb 9, 2023
6896858
fix cabal lint
hellwolf Feb 9, 2023
8470527
fix workflow
hellwolf Feb 9, 2023
c7a508f
fix workflow
hellwolf Feb 9, 2023
95cdedf
fix workflow
hellwolf Feb 9, 2023
8743ca7
fix workflow
hellwolf Feb 9, 2023
16c8f9c
fix workflow
hellwolf Feb 9, 2023
3f813e4
fix workflow
hellwolf Feb 9, 2023
95b2e64
fix workflow
hellwolf Feb 9, 2023
b84c942
fix lint and build
hellwolf Feb 9, 2023
c7ae0df
fix lint and build
hellwolf Feb 9, 2023
f42cd8b
fix lint and build
hellwolf Feb 9, 2023
dd6f547
fix lint and build
hellwolf Feb 9, 2023
45516df
fix lint and build
hellwolf Feb 9, 2023
a65ad50
fix lint and build
hellwolf Feb 9, 2023
d9f377a
fix lint and build
hellwolf Feb 9, 2023
057c822
fix lint and build
hellwolf Feb 9, 2023
03ea526
fix lint and build
hellwolf Feb 9, 2023
7ef3de7
fix lint and build
hellwolf Feb 9, 2023
735c896
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Feb 10, 2023
8c4bb9d
add 9.4.4 to cabal
hellwolf Feb 14, 2023
ebf537c
pool and its payment primitives
hellwolf Feb 14, 2023
3b5a5f7
WIP flow2flow2 for updp fails atm
hellwolf Feb 17, 2023
83b683e
SemanticMoney.t.sol tested
hellwolf Feb 17, 2023
684003b
added test_UPDP_1Member_ tests
hellwolf Feb 21, 2023
f686826
SuperToken
hellwolf Feb 21, 2023
29807f1
Semantic money spec improvements:
hellwolf Feb 22, 2023
55ed9ab
make repl-* commands
hellwolf Feb 22, 2023
a570cf7
some WIP checkins
hellwolf Feb 22, 2023
ad777c7
bring back the prim2
hellwolf Feb 23, 2023
b4a762e
SuperToken with distributeFlow
hellwolf Feb 23, 2023
66410ec
added ERC20 approve/allowance code
hellwolf Feb 23, 2023
1dc7447
preliminary wasm wasi build
hellwolf Feb 24, 2023
6881379
added ghc-wasm to nix flake
hellwolf Feb 24, 2023
4c3e876
remove sign restrictions for Time and Unit
hellwolf Feb 28, 2023
31dbcfa
making Unit int128
hellwolf Feb 28, 2023
7fa5268
more comments to SemanticMoney.sol
hellwolf Feb 28, 2023
73b42a3
using more syntatic sugars from solidity 0.8.19 compiler
hellwolf Mar 1, 2023
2399acc
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Mar 1, 2023
e6f282f
use EnumerableSet.AddressSet instead
hellwolf Mar 2, 2023
ebedfda
use function pointers to simplify the test code
hellwolf Mar 3, 2023
39401ad
shorterning some function names
hellwolf Mar 3, 2023
a463bb3
add monetary unit laws
hellwolf Mar 7, 2023
f04b470
Support pool's pending distribution.
hellwolf Mar 7, 2023
4b74733
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Mar 7, 2023
5b9eaf4
some adjustments
hellwolf Mar 7, 2023
6fe9954
some fine tuning
hellwolf Mar 7, 2023
ef5370f
improve test-coverage
hellwolf Mar 8, 2023
5685f69
allow multiple distributors
hellwolf Mar 8, 2023
7cf0dec
make pdindex monoid, remove excessive Default instances
hellwolf Mar 8, 2023
abe2f71
add shiftFlow2
hellwolf Mar 8, 2023
7c0204a
Merge branch 'dev' into semantic-money
0xdavinchee Mar 9, 2023
bc97ad3
minor adjustment
hellwolf Mar 8, 2023
ece3084
implement shiftFlow2a shiftFlow2b primitives
hellwolf Mar 9, 2023
8d51365
shiftFlow2 for solidity semantic library
hellwolf Mar 9, 2023
3d9b238
fine tunings
hellwolf Mar 9, 2023
c04c791
pushing some comments
hellwolf Mar 10, 2023
d5e1978
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Mar 10, 2023
4ee8024
create ref-impl folder
hellwolf Mar 13, 2023
23a5948
Merge branch 'dev' into semantic-money
0xdavinchee Mar 13, 2023
caa43e3
added realtime balance functions
hellwolf Mar 14, 2023
dab840f
[ETHEREUM-CONTRACTS/SDK-CORE] Increase/DecreaseAllowance for ACL Flow…
0xdavinchee Mar 13, 2023
c4ae1c5
Add missing index mapping to index events (#1316)
kasparkallas Mar 14, 2023
8dbe7a7
add certora to the nix flake!
hellwolf Mar 14, 2023
69fad81
certora integration
hellwolf Mar 14, 2023
1e270bf
typo
hellwolf Mar 14, 2023
fadb425
minor code block adjustment
hellwolf Mar 14, 2023
f0dc249
ToySuperToken.spec WIP
hellwolf Mar 14, 2023
c49bb08
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Mar 15, 2023
0bbc662
[IMPORTANT] Fix a bug in pool claimAll logic
hellwolf Mar 16, 2023
948c611
[IMPORTANT] More view functions to ISuperTokenPool
hellwolf Mar 18, 2023
83e518e
[IMPORTANT] Fix a bug in distributeFlow
hellwolf Mar 18, 2023
21999de
Example: Aqueduct
hellwolf Mar 18, 2023
2ef1ad3
certora spec improvements
hellwolf Mar 18, 2023
6082ab6
[SPEC] Fix PDPoolMemberMU.settle logic
hellwolf Mar 19, 2023
5ee055a
[IMPORTANT] Fix PDPoolMemberMU.settle per spec
hellwolf Mar 19, 2023
5e2a47e
Fix aqueduct logic
hellwolf Mar 19, 2023
9153170
minor fix
hellwolf Mar 19, 2023
86d1f1d
minor fix
hellwolf Mar 19, 2023
c056cc4
make _claimAll clean again
hellwolf Mar 20, 2023
c5446f0
use env NO_FOUNDRY_TEST_STEPS_LIMIT for longer running tests
hellwolf Mar 20, 2023
783cdd6
use vm.envOr
hellwolf Mar 20, 2023
51bcc79
[IMPORTANT] _claimAll to use absorbParticlesFromPool
hellwolf Mar 21, 2023
2116084
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Mar 21, 2023
dc21f6b
add package.json to solidity-semantic-money
hellwolf Mar 21, 2023
95e566c
disable test:deployment:scripts-js-truffle
hellwolf Mar 22, 2023
3884030
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Mar 22, 2023
aa210cc
Merge branch 'dev' into semantic-money
0xdavinchee Mar 22, 2023
aebe380
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Mar 23, 2023
74c488d
split ToySuperTokenPool out
hellwolf Mar 24, 2023
3461340
WIP certora rules
hellwolf Mar 24, 2023
c0fe8b3
coding style fixups
hellwolf Mar 27, 2023
9584c36
[IMPORTANT] introduce TokenMonad to simplify storage accesses
hellwolf Mar 27, 2023
6d27bd8
add rem, and use it in quotrem
hellwolf Mar 27, 2023
2f96006
more certora verifications
hellwolf Mar 27, 2023
4d2db6b
use relative links for semantic money code for now
hellwolf Mar 27, 2023
8ee3239
some certora rule updates
hellwolf Mar 28, 2023
412c9f1
split token monad out
hellwolf Mar 28, 2023
0fefcd0
WIP certora invariant
hellwolf Mar 28, 2023
5447d62
add sload hooks
hellwolf Mar 28, 2023
06dc447
WIP certora invariances
hellwolf Mar 29, 2023
9efa5f3
workflow and bash scripts cleanup
0xdavinchee Mar 29, 2023
dcaa9d9
Revert "workflow and bash scripts cleanup"
0xdavinchee Mar 29, 2023
03b8dd2
add singed int range checks
hellwolf Mar 29, 2023
3ef9211
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Apr 4, 2023
080d59b
token monad with eff
hellwolf Apr 4, 2023
e061a08
fix certora methods block
hellwolf Apr 4, 2023
3bd9a83
added test_1to1_flow_updates test case
hellwolf Apr 5, 2023
53dd6ac
WIP certora rules
hellwolf Apr 5, 2023
0ed0069
added test_erc20_self_transfer case
hellwolf Apr 6, 2023
e5fbcc3
update certora-cli
hellwolf Apr 6, 2023
b0adc0e
added TokenEff: Alternative monadic interface for semantic money usin…
hellwolf Apr 6, 2023
a9fd15a
cleanup toysupertoken & make new pools clones of the master copy.
hellwolf Apr 6, 2023
3673263
consistent .solhint
hellwolf Apr 6, 2023
bbd8b22
WIP certora rules
hellwolf Apr 6, 2023
1fa9e93
WIP certora stuff
hellwolf Apr 7, 2023
e9f900a
[IMPORTANT] Adjustments to SemanticMoney
hellwolf Apr 10, 2023
c9bca82
Merge branch 'dev' into semantic-money
0xdavinchee Apr 11, 2023
c6ae9c6
split ToySuperfluidToken from ToySuperToken
hellwolf Apr 11, 2023
c3ec904
fix some solc warnings
hellwolf Apr 11, 2023
4711d2c
certora refactoring
hellwolf Apr 11, 2023
4c5ddff
[IMPORTANT] simple _adjustBuffer function works!
hellwolf Apr 12, 2023
1f1481a
A bit looser type for TransactionResponse (#1358)
kasparkallas Apr 11, 2023
29a9617
[WORKFLOW/ETHEREUM-CONTRACTS] Fix Up Coverage (#1348)
0xdavinchee Apr 12, 2023
9a1ec20
add buffer to distributeFlow
hellwolf Apr 13, 2023
721d7f5
Explicitly specify the decimal expectations.
hellwolf Apr 25, 2023
ca7aff4
test_flowrate_unit_quotrem property test
hellwolf Apr 25, 2023
c777bed
Aqueduct example update: unit as downscaled flow rate
hellwolf Apr 25, 2023
a03906d
WIP certora
hellwolf Apr 25, 2023
703cdae
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Apr 25, 2023
8673687
fix flake again
hellwolf Apr 25, 2023
a4b036d
fix flake again
hellwolf Apr 25, 2023
5a539d0
more comment about fixed-point arithmetic
hellwolf Apr 25, 2023
20e668b
certora wip: make it pooless again
hellwolf Apr 25, 2023
861d0e2
fix buffer logic
hellwolf Apr 25, 2023
2418dc7
aqueduct small refactoring
hellwolf Apr 26, 2023
6245411
small improvement to test setup
hellwolf Apr 26, 2023
f6d1204
added test_pool_random_seqs for new counter cases
hellwolf Apr 26, 2023
69ebad0
api improvement to distributeFlow
hellwolf Apr 26, 2023
10798a0
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf Apr 26, 2023
54c4bfe
add foundry profile build-without-ir
hellwolf Apr 27, 2023
c95088d
disable ir by default
hellwolf Apr 27, 2023
f4b5b72
major fix to pool flow adjustment logic
hellwolf Apr 27, 2023
665e43d
make build-src and test use different outputs
hellwolf Apr 29, 2023
4b282c2
remove rtb_per_unit
hellwolf Apr 29, 2023
5120dda
fix pool adjustment flow logic
hellwolf Apr 29, 2023
2d6b14d
fine tuning Aqueduct
hellwolf Apr 29, 2023
8964829
some reformatting
hellwolf Apr 30, 2023
e15b243
remove the deliberate revert from TokenMonad
hellwolf Apr 30, 2023
c5eb79e
correct implementation _disconnectedMembers, with tests
hellwolf May 2, 2023
9e83aae
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf May 2, 2023
f0a04e8
update fondry version in nix flake
hellwolf May 2, 2023
7c3a195
added README.md
hellwolf May 2, 2023
ce6bcfa
add call.test-solidity-semantic-money.yml
hellwolf May 2, 2023
1feae32
fix workflow
hellwolf May 2, 2023
8f37cc7
fine tuning workflows
hellwolf May 2, 2023
0a43ae4
fine tuning workflows
hellwolf May 2, 2023
85f8125
fine tuning workflows
hellwolf May 2, 2023
3a3cbda
fine tuning
hellwolf May 2, 2023
ae77b4d
fix a typo
hellwolf May 2, 2023
726afc9
update README
hellwolf May 3, 2023
f5cb960
do not access _settled_value directly
hellwolf May 3, 2023
c05d1e0
rename to ISuperfluidPoolOperator
hellwolf May 3, 2023
aa2ffb9
some mroe comments
hellwolf May 3, 2023
7de79f5
fix an edge case of test_flowrate_mul_unit_distributive_law
hellwolf May 3, 2023
6e036ad
added additional property (re deposit) to test
hellwolf May 3, 2023
8ddf651
add some docs
hellwolf May 3, 2023
23c0e6c
docs/pool-concept-overview.png
hellwolf May 3, 2023
c47edfb
docs/pool-concept-overview.png
hellwolf May 3, 2023
9b5393f
added getDistributionFlowRate
hellwolf May 3, 2023
bfa212c
added == operator overloading for monetary types
hellwolf May 3, 2023
fc2e956
added docs/aqueduct-remainder-flow-adjustment.png
hellwolf May 3, 2023
725a73c
some aqueduct fix tuning
hellwolf May 4, 2023
3565bce
updated diagrams for semantic money
hellwolf May 4, 2023
08025c4
fine tune aqueduct
hellwolf May 4, 2023
226f655
update foundry version in nix flake
hellwolf May 4, 2023
a2997bf
Merge remote-tracking branch 'origin/dev' into semantic-money
hellwolf May 4, 2023
5716f0e
limit test_random_seqs to 20 steps max
hellwolf May 4, 2023
60d0c2f
Merge branch 'dev' into semantic-money
0xdavinchee May 5, 2023
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
Prev Previous commit
Next Next commit
bring back the prim2
  • Loading branch information
hellwolf committed Feb 23, 2023
commit ad777c70cbff0b239c6b494fd0f78030e9947dcc
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,26 @@ class ( MonetaryTypes mt, t ~ MT_TIME mt, v ~ MT_VALUE mt, u ~ MT_UNIT mt
-- polymorphic 2-primitives
--

-- 2-primitive higher order function
prim2 :: (Index mt t v u a, Index mt t v u b)
=> ((a, b) -> (a, b)) -> t -> (a, b) -> (a, b)
prim2 op t' (a, b) = op (settle t' a, settle t' b)

-- shift2, right side biased
shift2 :: (Index mt t v u a, Index mt t v u b)
=> v -> t -> (a, b) -> (a, b)
shift2 amount _ (a, b) = let (b', amount') = shift1 amount b
(a', _) = shift1 (-amount') a
in (a', b')
shift2 amount = prim2 op
where op (a, b) = let (b', amount') = shift1 amount b
(a', _) = shift1 (-amount') a
in (a', b')

-- flow2, right side biased
flow2 :: (Index mt t v u a, Index mt t v u b)
=> v -> t -> (a, b) -> (a, b)
flow2 flowRate t' (a, b) = let (b', flowRate') = flow1 flowRate (settle t' b)
(a', _) = flow1 (-flowRate') (settle t' a)
in (a', b')
flow2 flowRate = prim2 op
where op (a, b) = let (b', flowRate') = flow1 flowRate b
(a', _) = flow1 (-flowRate') a
in (a', b')

--
-- Univeral Index
Expand Down