Commit a8d839c6 authored by hezhengjun's avatar hezhengjun Committed by whisker

add token address when burn from chain33

parent fc3dafc5
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -379,6 +379,5 @@ contract Chain33Bank { ...@@ -379,6 +379,5 @@ contract Chain33Bank {
{ {
bytes32 symHash = keccak256(abi.encodePacked(_symbol)); bytes32 symHash = keccak256(abi.encodePacked(_symbol));
return token2address[symHash]; return token2address[symHash];
} }
} }
\ No newline at end of file
...@@ -208,6 +208,7 @@ contract Chain33Bridge { ...@@ -208,6 +208,7 @@ contract Chain33Bridge {
bytes memory _chain33Sender, bytes memory _chain33Sender,
address payable _ethereumReceiver, address payable _ethereumReceiver,
address _originalValidator, address _originalValidator,
address _tokenAddress,
string memory _symbol, string memory _symbol,
uint256 _amount uint256 _amount
) )
...@@ -219,7 +220,10 @@ contract Chain33Bridge { ...@@ -219,7 +220,10 @@ contract Chain33Bridge {
prophecyClaimCount = prophecyClaimCount.add(1); prophecyClaimCount = prophecyClaimCount.add(1);
ClaimType claimType = ClaimType(_claimType); ClaimType claimType = ClaimType(_claimType);
address tokenAddress = bridgeBank.getToken2address(_symbol); //overwrite the token address in case of lock
if (claimType == ClaimType.Lock) {
_tokenAddress = bridgeBank.getToken2address(_symbol);
}
// Create the new ProphecyClaim // Create the new ProphecyClaim
ProphecyClaim memory prophecyClaim = ProphecyClaim( ProphecyClaim memory prophecyClaim = ProphecyClaim(
...@@ -227,7 +231,7 @@ contract Chain33Bridge { ...@@ -227,7 +231,7 @@ contract Chain33Bridge {
_chain33Sender, _chain33Sender,
_ethereumReceiver, _ethereumReceiver,
_originalValidator, _originalValidator,
tokenAddress, _tokenAddress,
_symbol, _symbol,
_amount, _amount,
Status.Pending Status.Pending
...@@ -242,7 +246,7 @@ contract Chain33Bridge { ...@@ -242,7 +246,7 @@ contract Chain33Bridge {
_chain33Sender, _chain33Sender,
_ethereumReceiver, _ethereumReceiver,
_originalValidator, _originalValidator,
tokenAddress, _tokenAddress,
_symbol, _symbol,
_amount _amount
); );
......
...@@ -130,6 +130,7 @@ contract Oracle { ...@@ -130,6 +130,7 @@ contract Oracle {
ClaimType _claimType, ClaimType _claimType,
bytes memory _chain33Sender, bytes memory _chain33Sender,
address payable _ethereumReceiver, address payable _ethereumReceiver,
address _tokenAddress,
string memory _symbol, string memory _symbol,
uint256 _amount, uint256 _amount,
bytes32 _claimID, bytes32 _claimID,
...@@ -163,6 +164,7 @@ contract Oracle { ...@@ -163,6 +164,7 @@ contract Oracle {
_chain33Sender, _chain33Sender,
_ethereumReceiver, _ethereumReceiver,
validatorAddress, validatorAddress,
_tokenAddress,
_symbol, _symbol,
_amount); _amount);
} }
......
...@@ -467,7 +467,7 @@ func MakeNewProphecyClaim(newProphecyClaimPara *NewProphecyClaimPara, client *et ...@@ -467,7 +467,7 @@ func MakeNewProphecyClaim(newProphecyClaimPara *NewProphecyClaimPara, client *et
return "", err return "", err
} }
tx, err := x2EthContracts.Oracle.NewOracleClaim(authVali, newProphecyClaimPara.ClaimType, newProphecyClaimPara.Chain33Sender, ethReceiver, newProphecyClaimPara.Symbol, amount, claimID, signature) tx, err := x2EthContracts.Oracle.NewOracleClaim(authVali, newProphecyClaimPara.ClaimType, newProphecyClaimPara.Chain33Sender, ethReceiver, newProphecyClaimPara.TokenAddr, newProphecyClaimPara.Symbol, amount, claimID, signature)
if nil != err { if nil != err {
return "", err return "", err
} }
......
...@@ -40,7 +40,7 @@ func RelayOracleClaimToEthereum(oracleInstance *generated.Oracle, client *ethcli ...@@ -40,7 +40,7 @@ func RelayOracleClaimToEthereum(oracleInstance *generated.Oracle, client *ethcli
return "", err return "", err
} }
tx, err := oracleInstance.NewOracleClaim(auth, uint8(claim.ClaimType), claim.Chain33Sender, claim.EthereumReceiver, claim.Symbol, claim.Amount, claimID, signature) tx, err := oracleInstance.NewOracleClaim(auth, uint8(claim.ClaimType), claim.Chain33Sender, claim.EthereumReceiver, claim.TokenContractAddress, claim.Symbol, claim.Amount, claimID, signature)
if nil != err { if nil != err {
txslog.Error("RelayProphecyClaimToEthereum", "NewOracleClaim failed due to:", err.Error()) txslog.Error("RelayProphecyClaimToEthereum", "NewOracleClaim failed due to:", err.Error())
return "", err return "", err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment