https://github.com/kaonone/gsn-v1-adapter
GSNV1 Adapter
https://github.com/kaonone/gsn-v1-adapter
Last synced: 2 months ago
JSON representation
GSNV1 Adapter
- Host: GitHub
- URL: https://github.com/kaonone/gsn-v1-adapter
- Owner: kaonone
- License: mit
- Created: 2020-07-08T19:28:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T09:06:17.000Z (almost 5 years ago)
- Last Synced: 2025-01-24T06:12:45.267Z (4 months ago)
- Language: TypeScript
- Size: 158 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GSNV1 Adapter
[](https://travis-ci.com/akropolisio/gsn-v1-adapter)
[](https://codecov.io/gh/akropolisio/gsn-v1-adapter)Implements delegation of calls to other contracts via GSN, with proper forwarding of return values and bubbling of failures.
## Developer Tools 🛠️
- [Truffle](https://trufflesuite.com/)
- [TypeChain](https://github.com/ethereum-ts/TypeChain)
- [OpenZeppelin SDK](https://openzeppelin.com)## Start
Create `.infura` and `.secret` files. Install the dependencies:
```bash
$ yarn
```## Tests
```bash
$ yarn test
```## Coverage
```bash
$ yarn coverage
```## Deploying
Deploy to Kovan:
```bash
$ yarn oz deploy
```## API
All functions in this implementation have a `0xb373a41f` postfix, that prevents names from intersecting with the target contract.
> 0xb373a41f == bytes4(keccak256(bytes("GSNV1Adapter")))
## deposit\_\_0xb373a41f
_No parameters_
See {IRelayHub-depositFor}. https://github.com/OpenZeppelin/openzeppelin-contracts-ethereum-packageReturns:
|name |type |description
|-----|-----|-----------
|result|bool|Boolean value indicating whether the operation succeeded.## getManagerRole\_\_0xb373a41f - read
_No parameters_
Returns hash of the manager role.
Returns:
|name |type |description
|-----|-----|-----------
|managerRole|bytes32|Hash of the manager role.## getTargetAddress\_\_0xb373a41f - read
| name | type | description |
| --------------- | ----- | ----------------------------------- |
| encodedFunction | bytes | First 4 bytes of the function hash. |Returns address of the target.
Returns:
|name |type |description
|-----|-----|-----------
|targetAddress|address|Address of the target.## getTargetName\_\_0xb373a41f - read
| name | type | description |
| --------------- | ----- | ----------------------------------- |
| encodedFunction | bytes | First 4 bytes of the function hash. |Returns name of the target.
Returns:
|name |type |description
|-----|-----|-----------
|targetName|string|Name of the target.## initilize\_\_0xb373a41f
| name | type | description |
| ------------- | ------- | ------------------------------ |
| trustedSigner | address | Address of the trusted signer. |
| admin | address | Address of the admin. |Sets the values for {trustedSigner} and {admin}. All two of these values are immutable: they can only be set once during initialization.
Returns:
_No parameters_## setTarget\_\_0xb373a41f
| name | type | description |
| --------------- | ------- | ----------------------------------- |
| encodedFunction | bytes | First 4 bytes of the function hash. |
| targetName | string | String name of the target. |
| targetAddress | address | Address of the target. |Sets target struct in mapping. Returns a boolean value indicating whether the operation succeeded.
Returns:
|name |type |description
|-----|-----|-----------
|result|bool|Boolean value indicating whether the operation succeeded.## withdraw\_\_0xb373a41f
| name | type | description |
| ------ | ------- | ----------------------------------------------------------------- |
| amount | uint256 | The amount of eth that is transferred to the recipient's address. |
| payee | address | Recipient address. |Withdraws the recipient's deposits in `RelayHub`. Returns a boolean value indicating whether the operation succeeded.
Returns:
|name |type |description
|-----|-----|-----------
|result|bool|Boolean value indicating whether the operation succeeded.