Skip to content

Inline solidity imports from node_modules (e.g. from @openzeppelin/contracts)

License

Notifications You must be signed in to change notification settings

hacktisch/solwrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solwrap

npm license

Flatten your contract code into one file by inlining all imports recursively.

This library is handy when you need to verify your Solidity contract code on platforms that require flat files, like Etherscan. Or when you need to compile in your production app without access to node_modules.

Installation

Use the package manager npm to install Solwrap.

npm install solwrap

This library has not install any dependencies and any library referenced in your contract (e.g. @openzeppelin/contracts) must be installed separately.

Usage

const solwrap = require('solwrap');

// specify the path to your solidity file
const contractSource = fs.readFileSync('./path/to/your/Contract.sol', 'utf8');

const flattenedCode=solwrap(contractSource);

About

Inline solidity imports from node_modules (e.g. from @openzeppelin/contracts)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published