https://github.com/blockclusterapp/proxy-contract
A minimal Dynamo Proxy Contract Boilerplate
https://github.com/blockclusterapp/proxy-contract
blockcluster mocha-chai solidity truffle-framework web3js
Last synced: about 2 months ago
JSON representation
A minimal Dynamo Proxy Contract Boilerplate
- Host: GitHub
- URL: https://github.com/blockclusterapp/proxy-contract
- Owner: BlockClusterApp
- Created: 2018-09-04T19:30:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T12:11:17.000Z (almost 8 years ago)
- Last Synced: 2025-03-29T17:34:43.095Z (about 1 year ago)
- Topics: blockcluster, mocha-chai, solidity, truffle-framework, web3js
- Language: JavaScript
- Homepage: https://www.blockcluster.io
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A minimal, beginner friendly boilerplate for writing dynamo proxy contracts in BlockCluster platform.
# Proxy Contract
A proxy contract in dynamo is used to implement custom logic such as advanced permissions, implementing new actors, calculating or conditioning assets metadata and so on.
It's useful when you need more customized and advanced operations over Dynamo's native assets and streams protocol. For example: if you have an asset and want to give two different members the ability to modify the asset then you would require to write a proxy contract as native set of operations over assets doesn't provide this feature.
### Configuring
To run this truffle project you need to configure your networks smart contract addresses and replace the node URL with your's node URL.
First of all create a new network on [app.blockcluster.io](http://app.blockcluster.io/login). The you will see this control panel for your network:

Then click on Node Info and Settings option to view your dynamo node's network and contracts information. You would see a screen similar to this:

Now copy the assets, streams and atomic swap contracts addresses and replace with the dummy ones provided in the [contracts/Example.sol](https://github.com/BlockClusterApp/proxy-contract/blob/master/contracts/Example.sol) file.
The next step is to go to the API option on the control panel page. You will see a screen similar to this:

Now copy the Dynamo APIs URL and replace with the dummy one provided in the [truffle.js](https://github.com/BlockClusterApp/proxy-contract/blob/master/truffle.js) file.
## Testing
Just like testing any other truffle project you need to first compile smart contracts, then deploy the contracts and finally run Mocha tests.
Let's first install the dependencies:
```shell
npm install
```
Then compile the contracts:
```shell
truffle compile
```
Then deploy the contracts:
```shell
truffle migrate --reset --network development
```
Finally, run the mocha tests:
```shell
truffle test
```
## Auditing
To convert the transactions related to the proxy contract into readable format in Audit explorer you would need to add the proxy contract's bytecode and ABI in dynamo.
To do this, click on Add Smart Contracts option in control panel. You will see a screen similar to this:

Now copy the bytecode and ABI from your projects build/contracts/Example.json file and paste it in the form. Then submit the form. Now you will be able to audit all `Example` contracts transactions in the explorer.
Here is how a transaction will look when viewed in explorer:
