Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
3bba6e11
Unverified
Commit
3bba6e11
authored
Feb 04, 2022
by
Conner Fromknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: emit depositId in TeleportrDeposit.EtherReceived event
parent
99532fd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
TeleportrDeposit.sol
...ges/contracts/contracts/L1/teleportr/TeleportrDeposit.sol
+7
-2
No files found.
packages/contracts/contracts/L1/teleportr/TeleportrDeposit.sol
View file @
3bba6e11
...
@@ -12,6 +12,7 @@ contract TeleportrDeposit {
...
@@ -12,6 +12,7 @@ contract TeleportrDeposit {
uint256 public minDepositAmount;
uint256 public minDepositAmount;
uint256 public maxDepositAmount;
uint256 public maxDepositAmount;
uint256 public maxBalance;
uint256 public maxBalance;
uint256 public totalDeposits;
// Events
// Events
event OwnerSet(address indexed oldOwner, address indexed newOwner);
event OwnerSet(address indexed oldOwner, address indexed newOwner);
...
@@ -19,7 +20,7 @@ contract TeleportrDeposit {
...
@@ -19,7 +20,7 @@ contract TeleportrDeposit {
event MaxDepositAmountSet(uint256 previousAmount, uint256 newAmount);
event MaxDepositAmountSet(uint256 previousAmount, uint256 newAmount);
event MaxBalanceSet(uint256 previousBalance, uint256 newBalance);
event MaxBalanceSet(uint256 previousBalance, uint256 newBalance);
event BalanceWithdrawn(address indexed owner, uint256 balance);
event BalanceWithdrawn(address indexed owner, uint256 balance);
event EtherReceived(
address indexed emitter, uint256
amount);
event EtherReceived(
uint256 indexed depositId, address indexed emitter, uint256 indexed
amount);
// Modifiers
// Modifiers
modifier isOwner() {
modifier isOwner() {
...
@@ -36,6 +37,7 @@ contract TeleportrDeposit {
...
@@ -36,6 +37,7 @@ contract TeleportrDeposit {
minDepositAmount = _minDepositAmount;
minDepositAmount = _minDepositAmount;
maxDepositAmount = _maxDepositAmount;
maxDepositAmount = _maxDepositAmount;
maxBalance = _maxBalance;
maxBalance = _maxBalance;
totalDeposits = 0;
emit OwnerSet(address(0), msg.sender);
emit OwnerSet(address(0), msg.sender);
emit MinDepositAmountSet(0, _minDepositAmount);
emit MinDepositAmountSet(0, _minDepositAmount);
emit MaxDepositAmountSet(0, _maxDepositAmount);
emit MaxDepositAmountSet(0, _maxDepositAmount);
...
@@ -50,7 +52,10 @@ contract TeleportrDeposit {
...
@@ -50,7 +52,10 @@ contract TeleportrDeposit {
require(msg.value <= maxDepositAmount, "Deposit amount is too big");
require(msg.value <= maxDepositAmount, "Deposit amount is too big");
require(address(this).balance <= maxBalance, "Contract max balance exceeded");
require(address(this).balance <= maxBalance, "Contract max balance exceeded");
emit EtherReceived(msg.sender, msg.value);
emit EtherReceived(totalDeposits, msg.sender, msg.value);
unchecked {
totalDeposits += 1;
}
}
}
// Send the contract's balance to the owner
// Send the contract's balance to the owner
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment