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

Commit

Permalink
Merge pull request #43 from rnsdomains/npm
Browse files Browse the repository at this point in the history
Npm
  • Loading branch information
ilanolkies authored Jan 3, 2020
2 parents c4be07c + fec6887 commit ef55791
Show file tree
Hide file tree
Showing 34 changed files with 93 additions and 1,037 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ slither .
> Get truffle: https://www.trufflesuite.com/
> Get slither:https://github.com/crytic/slither
## Import contracts

```
npm i @rsksmart/rns-rskregistrar
```

## References

1. Strongly based on https://github.com/ensdomains/ethregistrar.
Expand Down
8 changes: 8 additions & 0 deletions contracts/Dummy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pragma solidity ^0.5.3;

import "@rsksmart/rns-registry/contracts/RNS.sol";
import "@rsksmart/rns-auction-registrar/contracts/TokenRegistrar.sol";
import "@rsksmart/erc677/contracts/ERC677.sol";

contract Dummy {
}
10 changes: 5 additions & 5 deletions contracts/FIFSRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pragma solidity ^0.5.3;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@ensdomains/ethregistrar/contracts/StringUtils.sol";
import "./testing/ERC677TokenContract.sol";
import "./testing/ERC677Receiver.sol";
import "@rsksmart/erc677/contracts/ERC677.sol";
import "@rsksmart/erc677/contracts/ERC677TransferReceiver.sol";
import "./NodeOwner.sol";
import "./PricedContract.sol";
import "./AbstractNamePrice.sol";
Expand All @@ -12,7 +12,7 @@ import "./BytesUtils.sol";
/// @title First-in first-served registrar.
/// @notice You can use this contract to register .rsk names in RNS.
/// @dev This contract has permission to register in RSK Owner.
contract FIFSRegistrar is PricedContract, ERC677Receiver {
contract FIFSRegistrar is PricedContract, ERC677TransferReceiver {
using SafeMath for uint256;
using StringUtils for string;
using BytesUtils for bytes;
Expand All @@ -22,15 +22,15 @@ contract FIFSRegistrar is PricedContract, ERC677Receiver {

uint public minLength = 5;

ERC677TokenContract rif;
ERC677 rif;
NodeOwner nodeOwner;
address pool;

// sha3('register(string,address,bytes32,uint)')
bytes4 constant REGISTER_SIGNATURE = 0xc2c414c8;

constructor (
ERC677TokenContract _rif,
ERC677 _rif,
NodeOwner _nodeOwner,
address _pool,
AbstractNamePrice _namePrice
Expand Down
2 changes: 1 addition & 1 deletion contracts/NamePrice.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.5.3;

import "./AbstractNamePrice.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./AbstractNamePrice.sol";

/// @title NamePrice contract
/// @author Javier Esses
Expand Down
2 changes: 1 addition & 1 deletion contracts/NodeOwner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.5.3;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/ownership/Ownable.sol";
import "@openzeppelin/contracts/access/Roles.sol";
import "./testing/AbstractRNS.sol";
import "@rsksmart/rns-registry/contracts/AbstractRNS.sol";

contract NodeOwner is ERC721, Ownable {
using Roles for Roles.Role;
Expand Down
2 changes: 1 addition & 1 deletion contracts/PricedContract.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.5.3;

import "./AbstractNamePrice.sol";
import "@openzeppelin/contracts/ownership/Ownable.sol";
import "./AbstractNamePrice.sol";

contract PricedContract is Ownable {
AbstractNamePrice public namePrice;
Expand Down
6 changes: 4 additions & 2 deletions contracts/RSKOwner.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.5.3;

import "./testing/TokenRegistrar.sol";
import "./testing/TokenDeed.sol";
import "@rsksmart/rns-auction-registrar/contracts/TokenRegistrar.sol";
import "@rsksmart/rns-auction-registrar/contracts/TokenDeed.sol";
import "./NodeOwner.sol";

contract RSKOwner is NodeOwner {
Expand Down Expand Up @@ -45,13 +45,15 @@ contract RSKOwner is NodeOwner {
domain is not transfered and it expires, it might be
registered by someone else.
*/
event Test();

/// @notice Accept domain transfer from previous registrar.
/// @dev Use it via tokenRegistrar.trnasferRegistrars(label).
/// All locked tokens in Deed are returned.
/// @param label Accepted domain label.
/// @param deed Deed contract address holding tokens.
function acceptRegistrarTransfer(bytes32 label, TokenDeed deed, uint) external onlyPreviousRegistrar {
emit Test();
uint256 tokenId = uint256(label);
expirationTime[tokenId] = deed.expirationDate();
_mint(deed.owner(), tokenId);
Expand Down
10 changes: 5 additions & 5 deletions contracts/Renewer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pragma solidity ^0.5.3;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@ensdomains/ethregistrar/contracts/StringUtils.sol";
import "./testing/ERC677TokenContract.sol";
import "./testing/ERC677Receiver.sol";
import "@rsksmart/erc677/contracts/ERC677.sol";
import "@rsksmart/erc677/contracts/ERC677TransferReceiver.sol";
import "./NodeOwner.sol";
import "./PricedContract.sol";
import "./AbstractNamePrice.sol";
Expand All @@ -12,20 +12,20 @@ import "./BytesUtils.sol";
/// @title Simple renewer.
/// @notice You can use this contract to renew names registered in Node Owner.
/// @dev This contract has permission to renew in Node Owner.
contract Renewer is PricedContract {
contract Renewer is PricedContract, ERC677TransferReceiver {
using SafeMath for uint256;
using StringUtils for string;
using BytesUtils for bytes;

ERC677TokenContract rif;
ERC677 rif;
NodeOwner nodeOwner;
address pool;

// sha3('renew(string,uint)')
bytes4 constant RENEW_SIGNATURE = 0x14b1a4fc;

constructor (
ERC677TokenContract _rif,
ERC677 _rif,
NodeOwner _nodeOwner,
address _pool,
AbstractNamePrice _namePrice
Expand Down
25 changes: 0 additions & 25 deletions contracts/testing/AbstractRNS.sol

This file was deleted.

11 changes: 0 additions & 11 deletions contracts/testing/ContractReceiver.sol

This file was deleted.

11 changes: 0 additions & 11 deletions contracts/testing/ERC677.sol

This file was deleted.

5 changes: 0 additions & 5 deletions contracts/testing/ERC677Receiver.sol

This file was deleted.

25 changes: 0 additions & 25 deletions contracts/testing/ERC677TokenContract.sol

This file was deleted.

6 changes: 0 additions & 6 deletions contracts/testing/README.md

This file was deleted.

107 changes: 0 additions & 107 deletions contracts/testing/RNS.sol

This file was deleted.

Loading

0 comments on commit ef55791

Please sign in to comment.