You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
call approve() on the SCD token with the parameters <migration contract address>, <SCD token contract address>.balanceOf(this) (or curBalance)
call swapSaiToDai() on the migration contract with the parameter curBalance.
Although these actions could lead to the bridge balance evolution:
-curBalance of SCD
+curBalance of MCD
it is not enough for the bridge migration to MCD.
It is necessary also to change the token address in the bridge contract on the Ethereum Mainnet side as so the correct contract was used to unlock tokens when a withdrawal happens. It can be achieved by invoking setErc20token() on the bridge contract. This method is not available for external calls. So, the changing the token address must be performed from a method belonging to the bridge contract.
Bearing in mind facts considered above, the bridge implementation contract must be changed to have a new method migrateToMCD. This method must be permissible to be invoked by the bridge administrators. The method must forbid multiple invocation:
function migrateToMCD(address_migrationContract, address_mcdContract) external onlyOwner {
bytes32 storageAddress =keccak256(abi.encodePacked("migrationToMcdCompleted"));
require(!boolStorage[storageAddress]);
require(AddressUtils.isContract(_migrationContract));
require(AddressUtils.isContract(_mcdContract));
uint256 curBalance =erc20token().balanceOf(address(this));
require(erc20token().approve(_migrationContract, curBalance));
//It is important to note that this action will cause appearing of `Transfer`//event as part of the tokens mintingScdMcdMigration(_migrationContract).swapSaiToDai(curBalance);
address saiContract =erc20token();
setErc20token(_mcdContract);
require(erc20token().balanceOf(address(this)) == curBalance);
emitTokensSwapped(saiContract, erc20token(), curBalance);
boolStorage[storageAddress] =true;
}
The bridge contract on the xDai chain side has no reference to the token contract so no changes is needed on this side.
The text was updated successfully, but these errors were encountered:
As per the documentation clarifying migration to MCD provided by MakerDAO, the accounts owning SCD must perform two consequent actions:
approve()
on the SCD token with the parameters<migration contract address>
,<SCD token contract address>.balanceOf(this)
(orcurBalance
)swapSaiToDai()
on the migration contract with the parametercurBalance
.Although these actions could lead to the bridge balance evolution:
-curBalance
of SCD+curBalance
of MCDit is not enough for the bridge migration to MCD.
It is necessary also to change the token address in the bridge contract on the Ethereum Mainnet side as so the correct contract was used to unlock tokens when a withdrawal happens. It can be achieved by invoking
setErc20token()
on the bridge contract. This method is not available for external calls. So, the changing the token address must be performed from a method belonging to the bridge contract.Bearing in mind facts considered above, the bridge implementation contract must be changed to have a new method
migrateToMCD
. This method must be permissible to be invoked by the bridge administrators. The method must forbid multiple invocation:The bridge contract on the xDai chain side has no reference to the token contract so no changes is needed on this side.
The text was updated successfully, but these errors were encountered: