matic receiver condition

This commit is contained in:
Samyak Jain 2021-04-16 03:06:40 +05:30
parent bd72d17bc5
commit e31032a3d3
2 changed files with 6 additions and 1 deletions

View File

@ -112,6 +112,8 @@ contract AaveV2Migrator is MigrateResolver {
}
function onStateReceive(uint256 stateId, bytes calldata receivedData) external {
// Add some more require statements. Any kind of hashing for better privacy?
require(msg.sender == maticReceiver, "not-receiver-address");
require(stateId > lastStateId, "wrong-data");
lastStateId = stateId;

View File

@ -36,6 +36,9 @@ contract Variables {
// TODO: Set by construtor?
mapping(address => bool) public isSupportedToken;
address[] public supportedTokens; // don't add ethAddr. Only add wethAddr
address[] public supportedTokens; // don't add maticAddr. Only add wmaticAddr?
// Address which will receive L1 data and post it on L2
address public maticReceiver = address(0); // TODO: Change address
}