-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from aragon/aragonos-4
Update to solidity 0.4.24
- Loading branch information
Showing
21 changed files
with
132 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
module.exports = { | ||
norpc: true, | ||
testCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network coverage', | ||
skipFiles: [ | ||
'IFIFSResolvingRegistrar.sol', | ||
'ens/IPublicResolver.sol', | ||
'ens/', | ||
'interface/ApproveAndCallReceiver.sol', | ||
'misc/Migrations.sol', | ||
'zeppelin/ERC20.sol', | ||
'zeppelin/ERC20Basic.sol', | ||
'zeppelin/Ownable.sol', | ||
], | ||
copyNodeModules: true, | ||
'zeppelin/', | ||
'test/', | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
contracts/ens | ||
contracts/interface | ||
contracts/misc | ||
contracts/test | ||
contracts/zeppelin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"extends": "solium:all", | ||
"plugins": ["security"], | ||
"rules": { | ||
"security/no-low-level-calls": "off", | ||
"security/no-inline-assembly": "off", | ||
"error-reason": "off", | ||
"imports-on-top": "error", | ||
"variable-declarations": "error", | ||
"array-declarations": "error", | ||
"operator-whitespace": "error", | ||
"conditionals-whitespace": "error", | ||
"comma-whitespace": "error", | ||
"semicolon-whitespace": "error", | ||
"function-whitespace": "error", | ||
"lbrace": "error", | ||
"mixedcase": "error", | ||
"camelcase": "error", | ||
"uppercase": "error", | ||
"no-empty-blocks": "error", | ||
"no-unused-vars": "error", | ||
"quotes": "error", | ||
"blank-lines": "error", | ||
"indentation": "error", | ||
"arg-overflow": ["error", 8], | ||
"whitespace": "error", | ||
"deprecated-suicide": "error", | ||
"pragma-on-top": "error", | ||
"function-order": "error", | ||
"emit": "error", | ||
"no-constant": "error", | ||
"value-in-payable": "error", | ||
"max-len": "error", | ||
"visibility-first": "error", | ||
"linebreak-style": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity 0.4.18; | ||
pragma solidity 0.4.24; | ||
|
||
import "./ens/IPublicResolver.sol"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pragma solidity ^0.4.15; | ||
|
||
|
||
interface AbstractENS { | ||
function owner(bytes32 _node) public constant returns (address); | ||
function resolver(bytes32 _node) public constant returns (address); | ||
function ttl(bytes32 _node) public constant returns (uint64); | ||
function setOwner(bytes32 _node, address _owner) public; | ||
function setSubnodeOwner(bytes32 _node, bytes32 label, address _owner) public; | ||
function setResolver(bytes32 _node, address _resolver) public; | ||
function setTTL(bytes32 _node, uint64 _ttl) public; | ||
|
||
// Logged when the owner of a node assigns a new owner to a subnode. | ||
event NewOwner(bytes32 indexed _node, bytes32 indexed _label, address _owner); | ||
|
||
// Logged when the owner of a node transfers ownership to a new account. | ||
event Transfer(bytes32 indexed _node, address _owner); | ||
|
||
// Logged when the resolver for a node changes. | ||
event NewResolver(bytes32 indexed _node, address _resolver); | ||
|
||
// Logged when the TTL of a node changes | ||
event NewTTL(bytes32 indexed _node, uint64 _ttl); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity 0.4.18; | ||
pragma solidity 0.4.24; | ||
|
||
/* | ||
Copyright 2017, Jordi Baylina (Giveth) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/ens/FIFSRegistrar.sol → contracts/test/ens/FIFSRegistrar.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/ens/PublicResolver.sol → contracts/test/ens/PublicResolver.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../mocks/MockAcceptingTransferRegistrar.sol → .../mocks/MockAcceptingTransferRegistrar.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity 0.4.18; | ||
pragma solidity 0.4.24; | ||
|
||
import "../ens/Registrar.sol"; | ||
|
||
|
4 changes: 2 additions & 2 deletions
4
test/mocks/MockApproveAndCallERC20.sol → ...ts/test/mocks/MockApproveAndCallERC20.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/mocks/MockResolver.sol → contracts/test/mocks/MockResolver.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
const namehash = require('eth-ens-namehash').hash | ||
const keccak256 = require('js-sha3').keccak_256 | ||
|
||
const FIFSResolvingRegistrar = artifacts.require('FIFSResolvingRegistrar') | ||
const ENS = artifacts.require('AbstractENS') | ||
|
||
const owner = process.env.OWNER || '0x4cb3fd420555a09ba98845f0b816e45cfb230983' | ||
const ens = process.env.ENS || '0xfbae32d1cde62858bc45f51efc8cc4fa1415447e' | ||
const globalArtifacts = this.artifacts // Not injected unless called directly via truffle | ||
const defaultOwner = process.env.OWNER || '0x4cb3fd420555a09ba98845f0b816e45cfb230983' | ||
const defaultENSAddress = process.env.ENS || '0xfbae32d1cde62858bc45f51efc8cc4fa1415447e' | ||
|
||
const tld = namehash('eth') | ||
const label = '0x'+keccak256('aragonid') | ||
const node = namehash('aragonid.eth') | ||
|
||
module.exports = async callback => { | ||
const publicResolver = await ENS.at(ens).resolver(namehash('resolver.eth')) | ||
console.log('deploying AragonID') | ||
const aragonID = await FIFSResolvingRegistrar.new(ens, publicResolver, node) | ||
|
||
console.log('assigning ENS name to AragonID') | ||
await ENS.at(ens).setSubnodeOwner(tld, label, aragonID.address) | ||
|
||
console.log('assigning owner name') | ||
module.exports = async ( | ||
truffleExecCallback, | ||
{ | ||
artifacts = globalArtifacts, | ||
ensAddress = defaultENSAddress, | ||
owner = defaultOwner, | ||
verbose = true | ||
} = {} | ||
) => { | ||
const log = (...args) => { | ||
if (verbose) { console.log(...args) } | ||
} | ||
|
||
log(`Deploying AragonID with ENS: ${ensAddress} and owner: ${owner}`) | ||
const FIFSResolvingRegistrar = artifacts.require('FIFSResolvingRegistrar') | ||
const ENS = artifacts.require('AbstractENS') | ||
|
||
const publicResolver = await ENS.at(ensAddress).resolver(namehash('resolver.eth')) | ||
log('deploying AragonID') | ||
const aragonID = await FIFSResolvingRegistrar.new(ensAddress, publicResolver, node) | ||
|
||
log('assigning ENS name to AragonID') | ||
await ENS.at(ensAddress).setSubnodeOwner(tld, label, aragonID.address) | ||
|
||
log('assigning owner name') | ||
await aragonID.register('0x'+keccak256('owner'), owner) | ||
|
||
console.log('===========') | ||
console.log('Deployed AragonID:', aragonID.address) | ||
log('===========') | ||
log('Deployed AragonID:', aragonID.address) | ||
} | ||
|
||
// Deployed AragonID: 0x3a06a6544e48708142508d9042f94ddda769d04f |