InstaWallet -> UserWallet

This commit is contained in:
Samyak Jain 2019-04-03 15:16:56 +05:30
parent c45d3b3c79
commit 1dc4371360

View File

@ -105,12 +105,12 @@ contract WalletRegistry is LogicRegistry {
event Created(address indexed sender, address indexed owner, address proxy); event Created(address indexed sender, address indexed owner, address proxy);
mapping(address => InstaWallet) public proxies; mapping(address => UserWallet) public proxies;
/** /**
* @dev deploys a new proxy instance and sets msg.sender as owner of proxy * @dev deploys a new proxy instance and sets msg.sender as owner of proxy
*/ */
function build() public returns (InstaWallet proxy) { function build() public returns (UserWallet proxy) {
proxy = build(msg.sender); proxy = build(msg.sender);
} }
@ -118,9 +118,9 @@ contract WalletRegistry is LogicRegistry {
* @dev deploys a new proxy instance and sets custom owner of proxy * @dev deploys a new proxy instance and sets custom owner of proxy
* Throws if the owner already have a UserWallet * Throws if the owner already have a UserWallet
*/ */
function build(address owner) public returns (InstaWallet proxy) { function build(address owner) public returns (UserWallet proxy) {
require(proxies[owner] == InstaWallet(0), "multiple-proxy-per-user-not-allowed"); require(proxies[owner] == UserWallet(0), "multiple-proxy-per-user-not-allowed");
proxy = new InstaWallet(); proxy = new UserWallet();
proxy.setOwner(owner); proxy.setOwner(owner);
emit Created(msg.sender, owner, address(proxy)); emit Created(msg.sender, owner, address(proxy));
proxies[owner] = proxy; proxies[owner] = proxy;
@ -133,7 +133,7 @@ contract WalletRegistry is LogicRegistry {
function updateProxyRecord(address currentOwner, address nextOwner) public { function updateProxyRecord(address currentOwner, address nextOwner) public {
require(msg.sender == address(proxies[currentOwner]), "invalid-proxy-or-owner"); require(msg.sender == address(proxies[currentOwner]), "invalid-proxy-or-owner");
proxies[nextOwner] = proxies[currentOwner]; proxies[nextOwner] = proxies[currentOwner];
proxies[currentOwner] = InstaWallet(0); proxies[currentOwner] = UserWallet(0);
} }
} }