Closed chriseth closed 6 years ago
contract RegistrarProxy {
mapping (address => address) addresses;
address registrar;
bytes32 functioncall = sha3("register(bytes32,address)");
function RegistrarProxy (address _registrar) {
registrar = _registrar;
}
function () {
if (addresses[msg.sender] == 1) {
throw;
}
if (registrar.call(functioncall, msg.data, msg.sender)) {
addresses[msg.sender] = 1;
}
}
}
Can you move it to GitHub to be loaded into remix?
I think the proxy represent an event so it should have a name. And that name should go to the registrar.
Also, should we allow the user to add additional message? Line name?
the name to register is msg.data
Shouldn't we have a function making suicide ? we'll call it when disabling proxy
A specific contract should forward new requests to register names to the actual registrar. It should work by just sending a transaction with the name as data, i.e. its fallback function should forward the request to the registrar. Furthermore, there should be at most one successful register attempt per sender.