diff options
Diffstat (limited to 'test/contracts/FixedFeeRegistrar.cpp')
-rw-r--r-- | test/contracts/FixedFeeRegistrar.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp index ff683de0..bc0c4118 100644 --- a/test/contracts/FixedFeeRegistrar.cpp +++ b/test/contracts/FixedFeeRegistrar.cpp @@ -58,10 +58,10 @@ pragma solidity ^0.4.0; contract Registrar { event Changed(string indexed name); - function owner(string memory _name) view returns (address o_owner); - function addr(string memory _name) view returns (address o_address); - function subRegistrar(string memory _name) view returns (address o_subRegistrar); - function content(string memory _name) view returns (bytes32 o_content); + function owner(string memory _name) public view returns (address o_owner); + function addr(string memory _name) public view returns (address o_address); + function subRegistrar(string memory _name) public view returns (address o_subRegistrar); + function content(string memory _name) public view returns (bytes32 o_content); } contract FixedFeeRegistrar is Registrar { @@ -74,47 +74,47 @@ contract FixedFeeRegistrar is Registrar { modifier onlyrecordowner(string memory _name) { if (m_record(_name).owner == msg.sender) _; } - function reserve(string memory _name) payable { + function reserve(string memory _name) public payable { Record storage rec = m_record(_name); if (rec.owner == 0x0000000000000000000000000000000000000000 && msg.value >= c_fee) { rec.owner = msg.sender; emit Changed(_name); } } - function disown(string memory _name, address _refund) onlyrecordowner(_name) { + function disown(string memory _name, address _refund) onlyrecordowner(_name) public { delete m_recordData[uint(keccak256(bytes(_name))) / 8]; if (!_refund.send(c_fee)) throw; emit Changed(_name); } - function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) { + function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) public { m_record(_name).owner = _newOwner; emit Changed(_name); } - function setAddr(string memory _name, address _a) onlyrecordowner(_name) { + function setAddr(string memory _name, address _a) onlyrecordowner(_name) public { m_record(_name).addr = _a; emit Changed(_name); } - function setSubRegistrar(string memory _name, address _registrar) onlyrecordowner(_name) { + function setSubRegistrar(string memory _name, address _registrar) onlyrecordowner(_name) public { m_record(_name).subRegistrar = _registrar; emit Changed(_name); } - function setContent(string memory _name, bytes32 _content) onlyrecordowner(_name) { + function setContent(string memory _name, bytes32 _content) onlyrecordowner(_name) public { m_record(_name).content = _content; emit Changed(_name); } - function record(string memory _name) view returns (address o_addr, address o_subRegistrar, bytes32 o_content, address o_owner) { + function record(string memory _name) public view returns (address o_addr, address o_subRegistrar, bytes32 o_content, address o_owner) { Record storage rec = m_record(_name); o_addr = rec.addr; o_subRegistrar = rec.subRegistrar; o_content = rec.content; o_owner = rec.owner; } - function addr(string memory _name) view returns (address) { return m_record(_name).addr; } - function subRegistrar(string memory _name) view returns (address) { return m_record(_name).subRegistrar; } - function content(string memory _name) view returns (bytes32) { return m_record(_name).content; } - function owner(string memory _name) view returns (address) { return m_record(_name).owner; } + function addr(string memory _name) public view returns (address) { return m_record(_name).addr; } + function subRegistrar(string memory _name) public view returns (address) { return m_record(_name).subRegistrar; } + function content(string memory _name) public view returns (bytes32) { return m_record(_name).content; } + function owner(string memory _name) public view returns (address) { return m_record(_name).owner; } Record[2**253] m_recordData; function m_record(string memory _name) view internal returns (Record storage o_record) { |