-
Notifications
You must be signed in to change notification settings - Fork 341
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
Add ERC: Union Lock #382
base: master
Are you sure you want to change the base?
Add ERC: Union Lock #382
Conversation
Links to EIP1153 cannot be introduced. |
ERCS/erc-8000.md
Outdated
@@ -0,0 +1,129 @@ | |||
--- | |||
eip: 8000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eip: 8000 | |
eip: 7690 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks
The commit 4bb4aac (as a parent of 33f31b0) contains errors. |
--- | ||
eip: 7690 | ||
title: Union Lock | ||
description: Union Lock based on TSTORE/TLOAD can avoid flash loan attacks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most important thing your description should explain is probably what a "union lock" is.
|
||
## Abstract | ||
|
||
The feature of Union Lock can query the number of calls of other contracts and the number of calls of other contract functions in the same Ethereum transaction, thereby realizing the cross-contract locking function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could include a sentence or two on how querying the number of calls realizes cross-contract locks, I think that would really help your readers.
## Specification | ||
|
||
```solidity | ||
// SPDX-License-Identifier: MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code in the proposal file must be licensed under CC0-1.0
. If that isn't possible, you can put MIT licensed stuff in the assets
directory.
|
||
`getContractCallTimes`: Allows cross-contract acquisition of the number of times a contract is called in a transaction. | ||
|
||
## Rationale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of your rationale (except the last paragraph) seems to be justifying the proposal as a whole. That kind of content belongs in the Motivation section.
The Rationale section exists to explain choices within the proposal.
My favorite analogy is:
Motivation: We need to build a shed because...
Rationale: We painted the shed red because...
|
||
## Test Cases | ||
|
||
Reference @1999321 Union-Lock repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this external link. If you'd like to include test cases, they can live in the assets
directory.
## Reference Implementation | ||
|
||
```solidity | ||
// SPDX-License-Identifier: MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same license comment.
The feature of Union Lock can query the number of calls of other contracts and the number of calls of other contract functions in the same Ethereum transaction, thereby realizing the cross-contract locking function.
Union Lock is based on EIP-1153 , it can make DApps avoid flash loan attacks.
Discuss: https://ethereum-magicians.org/t/union-lock-based-on-tstore-tload-can-avoid-flash-loan-attacks/19676