Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

Forwarding / proxy contract to register names #3

Closed
chriseth opened this issue Mar 10, 2017 · 4 comments
Closed

Forwarding / proxy contract to register names #3

chriseth opened this issue Mar 10, 2017 · 4 comments
Assignees

Comments

@chriseth
Copy link

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.

@yann300 yann300 self-assigned this Mar 17, 2017
@yann300
Copy link
Contributor

yann300 commented Mar 17, 2017

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;
        }
    }
}

@chfast
Copy link
Member

chfast commented Mar 17, 2017

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?

@yann300
Copy link
Contributor

yann300 commented Mar 17, 2017

the name to register is msg.data

@gumb0
Copy link
Member

gumb0 commented Mar 24, 2017

Shouldn't we have a function making suicide ?
we'll call it when disabling proxy

@chfast chfast closed this as completed Jan 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants