Guest User

Untitled

a guest
Nov 13th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. /**
  2. * @dev Allows the upgradeability owner to upgrade the current version of the proxy and call the new implementation
  3. * to initialize whatever is needed through a low level call.
  4. * @param _newVersion representing the version name of the new implementation to be set.
  5. * @param _newImplementation representing the address of the new implementation to be set.
  6. * @param _data represents the msg.data to bet sent in the low level call. This parameter may include the function
  7. * signature of the implementation to be called with the needed payload
  8. */
  9. function upgradeToAndCall(string _newVersion, address _newImplementation, bytes _data) external payable ifOwner {
  10. _upgradeTo(_newVersion, _newImplementation);
  11. /*solium-disable-next-line security/no-call-value*/
  12. require(address(this).call.value(msg.value)(_data), "Fail in executing the function of implementation contract");
  13. }
Add Comment
Please, Sign In to add comment