-
Notifications
You must be signed in to change notification settings - Fork 18
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 #277 from DXgovernance/v2.0
dxdao-contracts v2.0
- Loading branch information
Showing
210 changed files
with
42,886 additions
and
30,760 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 +1,2 @@ | ||
coverage | ||
coverage | ||
docs |
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,4 @@ | ||
root: ./ | ||
structure: | ||
readme: README.md | ||
summary: docs/SUMMARY.md |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
docs |
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,5 @@ | ||
module.exports = { | ||
skipFiles: ["daostack/", "deploy/", "test/", "utils/"], | ||
skipFiles: ["test/", "utils/", "hardhat-dependency-compiler/"], | ||
istanbulReporter: ["lcov"], | ||
configureYulOptimizer: true, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity ^0.8.17; | ||
|
||
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | ||
|
||
/** | ||
* @title DAO Avatar | ||
* @dev The avatar, representing the DAO, owned by the DAO, controls the reputation and funds of the DAO. | ||
*/ | ||
contract DAOAvatar is OwnableUpgradeable { | ||
/// @notice Emitted when the call was executed | ||
event CallExecuted(address indexed to, bytes data, uint256 value, bool callSuccess, bytes callData); | ||
|
||
receive() external payable {} | ||
|
||
/** | ||
* @dev Initialize the avatar contract. | ||
* @param owner The address of the owner | ||
*/ | ||
function initialize(address owner) public initializer { | ||
__Ownable_init(); | ||
transferOwnership(owner); | ||
} | ||
|
||
/** | ||
* @dev Perform a call to an arbitrary contract | ||
* @param to The contract's address to call | ||
* @param data ABI-encoded contract call to call `_to` address. | ||
* @param value Value (ETH) to transfer with the transaction | ||
* @return callSuccess Whether call was executed successfully or not | ||
* @return callData Call data returned | ||
*/ | ||
function executeCall( | ||
address to, | ||
bytes memory data, | ||
uint256 value | ||
) public onlyOwner returns (bool callSuccess, bytes memory callData) { | ||
(callSuccess, callData) = to.call{value: value}(data); | ||
emit CallExecuted(to, data, value, callSuccess, callData); | ||
return (callSuccess, callData); | ||
} | ||
} |
Oops, something went wrong.