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

Add ERC: Union Lock #382

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add ERC: Union Lock #382

wants to merge 7 commits into from

Conversation

1999321
Copy link

@1999321 1999321 commented Apr 16, 2024

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

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Apr 16, 2024

File ERCS/erc-7690.md

Requires 1 more reviewers from @axic, @g11tech, @SamWilsn, @xinbenlv

@1999321
Copy link
Author

1999321 commented Apr 16, 2024

Links to EIP1153 cannot be introduced.

ERCS/erc-8000.md Outdated
@@ -0,0 +1,129 @@
---
eip: 8000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eip: 8000
eip: 7690

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks

@github-actions github-actions bot removed the w-ci label Apr 23, 2024
@github-actions github-actions bot added the w-ci label Apr 23, 2024
Copy link

The commit 4bb4aac (as a parent of 33f31b0) contains errors.
Please inspect the Run Summary for details.

---
eip: 7690
title: Union Lock
description: Union Lock based on TSTORE/TLOAD can avoid flash loan attacks.
Copy link
Collaborator

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.
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same license comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants