Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
3eec054c
Commit
3eec054c
authored
Dec 06, 2021
by
hezhengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support to config platform token symbol
parent
3afbe34a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
BridgeBank.sol
...oss2eth/contracts/contracts4eth/BridgeBank/BridgeBank.sol
+18
-3
BridgeBank.go
...cross2eth/contracts/contracts4eth/generated/BridgeBank.go
+0
-0
No files found.
plugin/dapp/cross2eth/contracts/contracts4eth/BridgeBank/BridgeBank.sol
View file @
3eec054c
...
@@ -21,6 +21,8 @@ contract BridgeBank is Chain33Bank, EthereumBank {
...
@@ -21,6 +21,8 @@ contract BridgeBank is Chain33Bank, EthereumBank {
address public operator;
address public operator;
Oracle public oracle;
Oracle public oracle;
Chain33Bridge public chain33Bridge;
Chain33Bridge public chain33Bridge;
string public platformTokenSymbol;
bool public hasSetPlatformTokenSymbol;
/*
/*
* @dev: Constructor, sets operator
* @dev: Constructor, sets operator
...
@@ -193,12 +195,25 @@ contract BridgeBank is Chain33Bank, EthereumBank {
...
@@ -193,12 +195,25 @@ contract BridgeBank is Chain33Bank, EthereumBank {
if (address(0) != _token) {
if (address(0) != _token) {
require(keccak256(bytes(BridgeToken(_token).symbol())) == keccak256(bytes(_symbol)), "token address and symbol is not consistent");
require(keccak256(bytes(BridgeToken(_token).symbol())) == keccak256(bytes(_symbol)), "token address and symbol is not consistent");
} else {
} else {
require(keccak256(bytes("ETH")) == keccak256(bytes(_symbol)), "token address and symbol is not consistent");
require(true == hasSetPlatformTokenSymbol, "The platform Token Symbol has not been configured");
require(keccak256(bytes(platformTokenSymbol)) == keccak256(bytes(_symbol)), "token address and symbol is not consistent");
}
}
configOfflineSave4Lock(_token, _symbol, _threshold, _percents);
configOfflineSave4Lock(_token, _symbol, _threshold, _percents);
}
}
/*
/*
* @dev: configplatformTokenSymbol used to config platform token symbol,and just could be configured once
*
* @param _symbol:token symbol,just used for double check that token address and symbol is consistent
*/
function configplatformTokenSymbol(string memory _symbol) public onlyOperator
{
require(false == hasSetPlatformTokenSymbol, "The platform Token Symbol has been configured");
platformTokenSymbol = _symbol;
hasSetPlatformTokenSymbol = true;
}
/*
* @dev: configOfflineSaveAccount used to config offline account to receive token
* @dev: configOfflineSaveAccount used to config offline account to receive token
* when the balance of locked token reaches threshold
* when the balance of locked token reaches threshold
*
*
...
@@ -237,9 +252,9 @@ contract BridgeBank is Chain33Bank, EthereumBank {
...
@@ -237,9 +252,9 @@ contract BridgeBank is Chain33Bank, EthereumBank {
msg.value == _amount,
msg.value == _amount,
"The transactions value must be equal the specified amount (in wei)"
"The transactions value must be equal the specified amount (in wei)"
);
);
require(true == hasSetPlatformTokenSymbol, "The platform Token Symbol has not been configured");
// Set the the symbol to ETH
// Set the the symbol to ETH
symbol =
"ETH"
;
symbol =
platformTokenSymbol
;
// ERC20 deposit
// ERC20 deposit
} else {
} else {
require(
require(
...
...
plugin/dapp/cross2eth/contracts/contracts4eth/generated/BridgeBank.go
View file @
3eec054c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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